-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.ts
62 lines (59 loc) · 1.96 KB
/
eslint.config.ts
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
// eslint-disable-next-line import/no-namespace
import * as typescriptEslintParser from "@typescript-eslint/parser";
// eslint-disable-next-line import/no-namespace
import * as eslintPluginImport from "eslint-plugin-import";
import typescriptEslintPlugin from "@typescript-eslint/eslint-plugin";
import stylisticEslintPlugin from "@stylistic/eslint-plugin";
import eslintPluginModulesNewlines from "eslint-plugin-modules-newlines";
import globals from "globals";
import "eslint-import-resolver-typescript";
import type {
ESLint,
Linter
} from "eslint";
const configs: Linter.FlatConfig[] = [
{
files: ["**/*.ts"],
ignores: ["dist/**"],
languageOptions: {
parser: typescriptEslintParser as Linter.ParserModule,
sourceType: "module",
globals: {
...globals.browser,
...globals.node
},
parserOptions: {
project: "./tsconfig.json"
}
},
plugins: {
"@typescript-eslint": typescriptEslintPlugin,
"import": eslintPluginImport,
"modules-newlines": eslintPluginModulesNewlines,
"@stylistic": stylisticEslintPlugin as ESLint.Plugin
},
rules: {
...typescriptEslintPlugin.configs["eslint-recommended"]!.overrides[0]!.rules,
...typescriptEslintPlugin.configs["recommended"]!.rules,
...typescriptEslintPlugin.configs["recommended-type-checked"]!.rules,
"import/no-unresolved": "error",
"import/no-namespace": "error",
"modules-newlines/import-declaration-newline": "error",
"modules-newlines/export-declaration-newline": "error",
"@typescript-eslint/explicit-function-return-type": "error",
"@stylistic/indent": ["error", 2],
"@stylistic/quotes": ["error", "double"],
semi: "error",
"no-extra-semi": "error",
"@typescript-eslint/explicit-member-accessibility": "error"
},
settings: {
"import/resolver": {
typescript: {
alwaysTryTypes: true
}
}
}
}
];
export default configs;