-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mts
More file actions
64 lines (60 loc) · 1.82 KB
/
eslint.config.mts
File metadata and controls
64 lines (60 loc) · 1.82 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 * as typescriptEslintParser from "@typescript-eslint/parser";
import typescriptEslintPlugin from "@typescript-eslint/eslint-plugin";
import "eslint-import-resolver-typescript";
import type {
Linter
} from "eslint";
const configs: Linter.Config[] = [
{
ignores: [
"eslint.config.mts",
"templates/**"
]
},
{
files: ["**/*.ts"],
ignores: [
"dist/**",
"node_modules/**",
"main.js"
],
languageOptions: {
parser: typescriptEslintParser,
sourceType: "module",
parserOptions: {
project: "./tsconfig.json",
ecmaVersion: 2023
}
},
plugins: {
"@typescript-eslint": typescriptEslintPlugin as any // Type assertion to bypass type checking
},
rules: {
// Base rules
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", { "args": "none", "varsIgnorePattern": "^_" }],
"@typescript-eslint/ban-ts-comment": "warn",
"no-prototype-builtins": "off",
"@typescript-eslint/no-empty-function": "off",
// Useful rules but not too strict
"semi": "error",
"eqeqeq": ["error", "always"],
"prefer-const": "error",
"@typescript-eslint/explicit-function-return-type": ["warn", { "allowExpressions": true }],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/consistent-type-imports": ["warn", { "prefer": "type-imports" }],
// Disable overly strict rules
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-argument": "off"
}
},
{
files: ["src/**/*.ts"],
rules: {
"no-console": ["warn", { "allow": ["warn", "error", "debug"] }]
}
}
];
export default configs;