-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patheslint.config.mjs
42 lines (41 loc) · 1.51 KB
/
eslint.config.mjs
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
import pluginJs from "@eslint/js";
import { Linter } from "eslint";
import globals from "globals";
import tseslint from "typescript-eslint";
/** @type {Linter.Config[]} */
export default [
{ files: ["**/*.?(c|m)ts"] },
{ ignores: ["**/*.?(c|m)js", "**/*.d.?(c|m)ts"] },
{ languageOptions: { globals: globals.node } },
{ languageOptions: { sourceType: "script" } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
"@typescript-eslint/consistent-type-imports": ["warn", { fixStyle: "inline-type-imports" }],
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-declaration-merging": "off",
"@typescript-eslint/no-unused-vars": ["warn", {
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
}],
"@typescript-eslint/prefer-ts-expect-error": "warn",
"comma-dangle": ["warn", "always-multiline"],
"func-style": ["warn", "declaration"],
indent: ["warn", 2, { SwitchCase: 1 }],
"no-case-declarations": "off",
"no-duplicate-imports": ["warn", { includeExports: true }],
"no-empty": "off",
"no-unused-private-class-members": "warn",
"no-unused-vars": "off",
"prefer-const": "warn",
"prefer-object-has-own": "warn",
"prefer-regex-literals": "warn",
quotes: ["warn", "double"],
semi: ["warn", "always"],
},
},
];