-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
73 lines (72 loc) · 2.1 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import globals from "globals";
import pluginJs from "@eslint/js";
import tsparser from "@typescript-eslint/parser";
import pluginTs from "@typescript-eslint/eslint-plugin";
import pluginReact from "eslint-plugin-react";
import pluginPreact from "eslint-plugin-preact";
import pluginImport from "eslint-plugin-import";
import pluginJSDoc from "eslint-plugin-jsdoc";
import pluginSonarJS from "eslint-plugin-sonarjs";
import cssPlugin from "eslint-plugin-css"
export default [
{
files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
project: "./tsconfig.json",
},
globals: {
...globals.browser,
JSX: true,
Bun: true,
process: true,
},
},
plugins: {
"@typescript-eslint": pluginTs,
react: pluginReact,
preact: pluginPreact,
import: pluginImport,
jsdoc: pluginJSDoc,
sonarjs: pluginSonarJS,
},
rules: {
"no-unused-vars": "warn",
"no-undef": "off",
"no-mixed-spaces-and-tabs": "off",
"no-case-declarations": "off",
"no-extra-semi": "off",
"sonarjs/cognitive-complexity": "off",
"sonarjs/no-all-duplicated-branches": "off",
"react/react-in-jsx-scope": "off", // Not needed for Preact
"react/no-unknown-property": "warn",
"import/no-unresolved": "error",
"import/order": ["warn", { "newlines-between": "always" }],
"jsdoc/check-alignment": "warn",
"jsdoc/check-indentation": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/explicit-module-boundary-types": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-inferrable-types": "warn",
"@typescript-eslint/consistent-type-imports": "warn",
},
},
pluginJs.configs.recommended,
{
settings: {
react: {
version: "18.2.0",
},
},
},
{
ignores: ["example/*", "test/**/*"],
},
cssPlugin.configs["flat/recommended"],
];