-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
142 lines (142 loc) · 4.13 KB
/
.eslintrc.json
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
{
"env": {
"browser": false,
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "react", "react-hooks", "jest"],
"extends": [
"airbnb-base",
"eslint:recommended",
"plugin:node/recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier"
],
"parserOptions": {
"ecmaVersion": 2020,
"ecmaFeatures": {
"jsx": true
},
"project": "./tsconfig.json",
"sourceType": "module"
},
"rules": {
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": ["camelCase"]
},
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE", "PascalCase"],
"leadingUnderscore": "allow"
},
{
"selector": "parameter",
"format": ["camelCase"],
"leadingUnderscore": "allow"
},
{
"selector": "memberLike",
"modifiers": ["private"],
"format": ["camelCase"],
"leadingUnderscore": "require"
},
{
"selector": "typeLike",
"format": ["PascalCase"]
},
{
"selector": "property",
"format": ["camelCase", "UPPER_CASE"],
"leadingUnderscore": "allowDouble"
}
],
"@typescript-eslint/no-confusing-void-expression": "error",
"import/extensions": "off",
"import/no-extraneous-dependencies": [
"error",
{ "devDependencies": ["*.js", "*.ts", "src/**/__tests__/**/*"] }
],
"import/no-unresolved": "off",
"import/prefer-default-export": "off",
"no-console": "off",
"no-empty": ["error", { "allowEmptyCatch": true }],
"no-plusplus": "off",
"no-process-exit": "off",
"no-ternary": "off",
"no-underscore-dangle": "error",
"no-void": "off",
"node/no-missing-import": "off",
"node/no-unsupported-features/es-syntax": "off",
"node/shebang": [
"error",
{
"convertPath": {
"src/index.tsx": ["^src/index.tsx$", "dist/index.js"]
}
}
],
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": "*", "next": "if" },
{ "blankLine": "always", "prev": "if", "next": "*" },
{ "blankLine": "always", "prev": "*", "next": "return" },
{ "blankLine": "always", "prev": "*", "next": "multiline-const" },
{ "blankLine": "always", "prev": "*", "next": "multiline-expression" },
{ "blankLine": "always", "prev": "*", "next": "multiline-let" },
{ "blankLine": "always", "prev": "multiline-const", "next": "*" },
{ "blankLine": "always", "prev": "multiline-expression", "next": "*" },
{ "blankLine": "always", "prev": "multiline-let", "next": "*" },
{ "blankLine": "always", "prev": "const", "next": "expression" },
{ "blankLine": "always", "prev": "let", "next": "expression" }
],
"react/function-component-definition": [
"error",
{
"namedComponents": "arrow-function",
"unnamedComponents": "arrow-function"
}
],
"react/hook-use-state": "error",
"react/jsx-curly-brace-presence": "error",
"react/jsx-boolean-value": "error",
"react/jsx-filename-extension": ["error", { "extensions": [".tsx"] }],
"react/jsx-uses-react": "off",
"react/no-unused-prop-types": "error",
"react/self-closing-comp": "error",
"react/react-in-jsx-scope": "off"
},
"overrides": [
{
"files": ["**/*.js"],
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
},
{
"files": ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"],
"extends": ["plugin:jest/recommended"],
"rules": {
"jest/prefer-lowercase-title": [
"error",
{
"ignore": ["describe"]
}
]
}
}
],
"settings": {
"react": {
"version": "detect"
}
},
"ignorePatterns": ["/coverage", "/dist", "/node_modules"]
}