-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
64 lines (62 loc) · 1.71 KB
/
eslint.config.js
File metadata and controls
64 lines (62 loc) · 1.71 KB
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
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
import typescriptEslintPlugin from "@typescript-eslint/eslint-plugin";
import typescriptParser from "@typescript-eslint/parser";
import importPlugin from "eslint-plugin-import";
const compat = new FlatCompat({
baseDirectory: __dirname,
});
export default [
js.configs.recommended,
...compat.extends(["@open-wc", "prettier"]),
{
files: ["**/*.ts"],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 2022,
sourceType: "module",
project: "./tsconfig.eslint.json",
},
},
plugins: {
"@typescript-eslint": typescriptEslintPlugin,
deprecation,
import: importPlugin,
},
settings: {
"import/resolver": {
typescript: true,
node: true,
},
"import/parsers": {
"@typescript-eslint/parser": [".ts"],
},
},
rules: {
"no-unused-vars": "off",
"no-continue": "off",
"no-plusplus": "off",
"no-shadow": "off",
"deprecation/deprecation": "warn",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/explicit-function-return-type": "error",
"class-methods-use-this": "off",
"@typescript-eslint/no-unused-vars": ["error"],
"import/no-unresolved": "error",
"import/extensions": "off",
"import/no-cycle": [2, { maxDepth: 1 }],
// overrides for TS files
"no-useless-constructor": "off",
"no-empty-function": "off",
"no-use-before-define": "off",
"no-dupe-class-members": "off",
},
},
{
files: ["**/*.js"],
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
},
},
];