-
-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy patheslint.config.js
35 lines (34 loc) · 987 Bytes
/
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
const stylistic = require("@stylistic/eslint-plugin");
const unusedImports = require("eslint-plugin-unused-imports");
const typescript = require("@typescript-eslint/parser");
module.exports = [
{ // Apply to `cjs`, `.mjs` and `.js` files.
files: ["**/*.?([cm])js?(x)"]
},
{ // Apply to `cts`, `.mts` and `.ts` files.
files: ["**/*.?([cm])ts?(x)"],
languageOptions: {
parser: require("@typescript-eslint/parser"),
parserOptions: {
sourceType: "module"
}
}
},
{
languageOptions: {
parser: typescript
},
plugins: {
"@stylistic": stylistic,
"unused-imports": unusedImports
},
rules: {
"@stylistic/indent": ["error", 2],
"@stylistic/no-trailing-spaces": "error",
"@stylistic/quotes": ["error", "double"],
"@stylistic/semi": ["error", "always"],
"@stylistic/space-before-function-paren": ["error", "always"],
"unused-imports/no-unused-imports": "error"
}
}
];