-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy patheslint.config.mjs
More file actions
65 lines (64 loc) · 1.89 KB
/
eslint.config.mjs
File metadata and controls
65 lines (64 loc) · 1.89 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
65
import { defineConfig } from "eslint/config";
import pluginImport from "eslint-plugin-import";
import pluginReact from "eslint-plugin-react";
import pluginUnusedImports from "eslint-plugin-unused-imports";
import globals from "globals";
import typescriptEslint from "typescript-eslint";
export default defineConfig([
{
ignores: ["**/api/**/*", "**/react-app-env.d.ts"],
},
{
languageOptions: {
globals: { ...globals.browser, ...globals.jest, ...globals.node },
parser: typescriptEslint.parser,
parserOptions: { project: true, tsconfigRootDir: import.meta.dirname },
},
plugins: {
import: pluginImport,
react: pluginReact,
"unused-imports": pluginUnusedImports,
},
rules: {
"import/first": "warn",
"import/newline-after-import": "warn",
"import/no-duplicates": "warn",
"import/order": [
"warn",
{
alphabetize: { order: "asc" },
groups: [
"builtin",
"external",
["internal", "parent", "sibling", "index", "object", "type"],
],
"newlines-between": "always",
},
],
"prefer-const": "warn",
"react/jsx-boolean-value": "warn",
"unused-imports/no-unused-imports": "warn",
},
settings: {
react: { version: "detect" },
"import/resolver": { typescript: { alwaysTryTypes: true } },
},
},
...typescriptEslint.configs.strict.map((config) => ({
...config,
files: ["**/*.ts", "**/*.tsx"],
})),
{
files: ["**/*.ts", "**/*.tsx"],
rules: {
"@typescript-eslint/explicit-function-return-type": [
"warn",
{ allowExpressions: true },
],
"@typescript-eslint/no-dynamic-delete": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "warn",
"@typescript-eslint/no-non-null-assertion": "off",
},
},
]);