-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
123 lines (122 loc) · 3.63 KB
/
.eslintrc.js
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
const restrictedGlobals = require("confusing-browser-globals");
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
project: "./tsconfig.json",
},
plugins: [
"import",
"jsx-a11y",
"react",
"react-hooks",
"@typescript-eslint",
"sort-destructure-keys",
"no-type-assertion",
],
extends: [
"eslint:recommended",
"plugin:react/all",
"plugin:react/jsx-runtime",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:jsx-a11y/strict",
"plugin:import/typescript",
"prettier",
],
env: {
browser: true,
es6: true,
node: true,
},
settings: {
"import/resolver": {
typescript: {},
},
react: {
version: "detect",
},
},
rules: {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ ignoreRestSiblings: true },
],
"import/export": "error",
"import/extensions": [
"error",
"always",
{ js: "never", ts: "never", tsx: "never" },
],
"import/named": "error",
"import/newline-after-import": "error",
"import/no-absolute-path": "error",
"import/no-amd": "error",
"import/no-deprecated": "warn",
"import/no-duplicates": "error",
"import/no-dynamic-require": "error",
"import/no-extraneous-dependencies": "error",
"import/no-mutable-exports": "error",
"import/no-named-as-default-member": "error",
"import/no-named-default": "error",
"import/no-self-import": "error",
"import/no-unresolved": "error",
"import/no-unused-modules": [
"error",
{ unusedExports: true, missingExports: true },
],
"import/no-useless-path-segments": "error",
"import/no-webpack-loader-syntax": "error",
"import/order": [
"error",
{
groups: [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
],
"newlines-between": "always",
alphabetize: { order: "asc", caseInsensitive: true },
},
],
"jsx-a11y/no-autofocus": "off",
"no-restricted-globals": ["error"].concat(restrictedGlobals),
"no-restricted-imports": ["error", { patterns: ["../../*"] }],
"no-shadow": "error",
"no-type-assertion/no-type-assertion": "error",
"no-useless-constructor": "error",
"padding-line-between-statements": [
"error",
{ blankLine: "always", prev: "*", next: "multiline-block-like" },
{ blankLine: "always", prev: "*", next: "multiline-const" },
{ blankLine: "always", prev: "*", next: "multiline-expression" },
{ blankLine: "always", prev: "*", next: "multiline-let" },
{ blankLine: "always", prev: "multiline-block-like", next: "*" },
{ blankLine: "always", prev: "multiline-const", next: "*" },
{ blankLine: "always", prev: "multiline-expression", next: "*" },
{ blankLine: "always", prev: "multiline-let", next: "*" },
],
"prefer-arrow-callback": "error",
"prefer-object-spread": "error",
"react-hooks/exhaustive-deps": "error",
"react-hooks/rules-of-hooks": "error",
"react/jsx-filename-extension": [
"error",
{ allow: "as-needed", extensions: ["tsx"] },
],
"react/jsx-max-depth": "off",
"react/jsx-no-literals": "off",
"react/require-default-props": "off",
"sort-imports": ["error", { ignoreDeclarationSort: true }],
"sort-destructure-keys/sort-destructure-keys": "error",
},
};