-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy path.eslintrc.cjs
More file actions
47 lines (45 loc) · 1.49 KB
/
.eslintrc.cjs
File metadata and controls
47 lines (45 loc) · 1.49 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
const js = require("@eslint/js");
const tseslint = require("@typescript-eslint/eslint-plugin");
const tsParser = require("@typescript-eslint/parser");
const stylistic = require("@stylistic/eslint-plugin");
const tsFiles = ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"];
module.exports = [
{
ignores: ["out", "dist", "**/*.d.ts", "esbuild.js"],
},
js.configs.recommended,
...tseslint.configs["flat/recommended-type-checked"],
stylistic.configs["disable-legacy"],
{
files: tsFiles,
languageOptions: {
parser: tsParser,
parserOptions: {
project: ["./tsconfig.json", "./test/tsconfig.json"],
},
},
plugins: {
"@typescript-eslint": tseslint,
"@stylistic": stylistic,
},
rules: {
// Disable 'no-unused-vars' for variables starting with `_`
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"@typescript-eslint/naming-convention": "warn",
"@stylistic/semi": "warn",
"@typescript-eslint/explicit-function-return-type": "warn",
curly: "warn",
eqeqeq: "warn",
"no-throw-literal": "warn",
semi: "off",
},
},
];