-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
52 lines (51 loc) · 1.24 KB
/
.eslintrc.cjs
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
// See https://github.com/import-js/eslint-plugin-import
const moduleImportRules = {
"import/exports-last": 2,
"import/first": 2,
"import/newline-after-import": 2,
"import/no-duplicates": 2,
"import/order": [
"error",
{
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
}
module.exports = {
root: true,
env: {
node: true,
es6: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2022,
},
overrides: [
// Avoid linting JavaScript config files with TypeScript rules...
{
files: ["**/*.ts"],
excludedFiles: "{a11y,e2e}/**/*.ts",
extends: [
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
rules: { ...moduleImportRules },
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
},
// ...and avoid linting TypeScript files with ES rules for JavaScript config files!
{
files: ["**/*.js"],
extends: ["eslint:recommended", "plugin:import/recommended"],
rules: { ...moduleImportRules },
},
],
}