-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy patheslint.config.js
66 lines (61 loc) · 1.81 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
import js from "@eslint/js";
import stylistic from "@stylistic/eslint-plugin";
import importPlugin from "eslint-plugin-import";
import globals from "globals";
import tseslint from "typescript-eslint";
export default [
js.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
importPlugin.flatConfigs.recommended,
stylistic.configs.customize({
arrowParens: true,
braceStyle: "1tbs",
commaDangle: "never",
flat: true,
jsx: false,
quotes: "double",
semi: true
}),
{
languageOptions: {
ecmaVersion: "latest",
globals: {
...globals.node
},
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname
}
},
settings: {
"import/resolver": {
node: {},
typescript: {}
}
},
rules: {
// JavaScript
"no-console": ["error"],
"no-empty-function": "off",
"no-fallthrough": "off",
// TypeScript
"@typescript-eslint/no-unused-vars": ["error", { caughtErrorsIgnorePattern: "^_" }],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
// Imports
"import/extensions": ["error", "ignorePackages"],
"import/newline-after-import": ["error", { count: 2, exactCount: false, considerComments: true }],
// Stylistic
"@stylistic/multiline-ternary": "off",
"@stylistic/no-mixed-operators": "off",
"@stylistic/no-multiple-empty-lines": ["error", { max: 2, maxEOF: 0, maxBOF: 0 }], // Allow max=2 for imports
"@stylistic/quote-props": ["error", "consistent"],
"@stylistic/yield-star-spacing": ["error", "after"]
}
},
{
files: ["**/*.js"],
...tseslint.configs.disableTypeChecked
}
];