Skip to content

Commit 80832a6

Browse files
committed
update eslint config
1 parent 71a8610 commit 80832a6

File tree

5 files changed

+186
-26
lines changed

5 files changed

+186
-26
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 4
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,3 @@
2626
npm-debug.log*
2727
yarn-debug.log*
2828
yarn-error.log*
29-
30-
# Editors
31-
.editorconfig

package.json

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"start": "sh start-ssl.sh",
88
"start:brooke": "sudo sh start-ssl-brooke.sh",
99
"build": "yarn react-app-rewired build",
10-
"lint:ts": "eslint -c ./src-ts/.eslintrc.js 'src-ts/**/*.{ts,tsx}'",
11-
"lint:ts:fix": "eslint -c ./src-ts/.eslintrc.js 'src-ts/**/*.{ts,tsx}' --fix",
10+
"lint:ts": "eslint -c ./src-ts/.eslintrc.js 'src-ts/tools/learn/**/*.{ts,tsx}'",
11+
"lint:ts:fix": "eslint -c ./src-ts/.eslintrc.js 'src-ts/tools/learn/**/*.{ts,tsx}' --fix",
1212
"lint:js": "eslint -c ./src/.eslintrc.js 'src/**/*.{js,jsx}'",
1313
"lint:js:fix": "eslint -c ./src/.eslintrc.js 'src/**/*.{js,jsx}' --fix",
1414
"lint": "npm run lint:js && npm run lint:ts",
@@ -128,10 +128,10 @@
128128
"eslint-plugin-cypress": "^2.12.1",
129129
"eslint-plugin-import": "^2.25.3",
130130
"eslint-plugin-jsx-a11y": "^6.5.1",
131-
"eslint-plugin-no-null": "^1.0.2",
132131
"eslint-plugin-ordered-imports": "^0.6.0",
133132
"eslint-plugin-react": "^7.28.0",
134133
"eslint-plugin-react-hooks": "^4.3.0",
134+
"eslint-plugin-unicorn": "^46.0.0",
135135
"file-loader": "^6.2.0",
136136
"husky": "^8.0.1",
137137
"identity-obj-proxy": "^3.0.0",
@@ -156,15 +156,6 @@
156156
"webpack-dev-server": "^4.11.1",
157157
"webpack-merge": "^5.8.0"
158158
},
159-
"eslintConfig": {
160-
"extends": [
161-
"react-app",
162-
"react-app/jest"
163-
],
164-
"rules": {
165-
"no-useless-escape": 0
166-
}
167-
},
168159
"browserslist": {
169160
"production": [
170161
">0.2%",

src-ts/.eslintrc.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = {
2121
},
2222
plugins: [
2323
'@typescript-eslint',
24-
'no-null',
24+
'unicorn',
2525
'ordered-imports',
2626
'react',
2727
'react-hooks'
@@ -50,7 +50,7 @@ module.exports = {
5050
allowExpressions: true
5151
}
5252
],
53-
'@typescript-eslint/no-explicit-any': 'error',
53+
'@typescript-eslint/no-explicit-any': 'off',
5454
'@typescript-eslint/no-inferrable-types': 'off',
5555
'@typescript-eslint/no-shadow': 'error',
5656
'@typescript-eslint/no-unused-vars': 'error',
@@ -89,9 +89,9 @@ module.exports = {
8989
'error',
9090
'prefer-single'
9191
],
92-
'jsx-a11y/click-events-have-key-events': 'warn',
93-
'jsx-a11y/no-noninteractive-element-interactions': 'warn',
94-
'jsx-a11y/no-static-element-interactions': 'warn',
92+
'jsx-a11y/click-events-have-key-events': 'off',
93+
'jsx-a11y/no-noninteractive-element-interactions': 'off',
94+
'jsx-a11y/no-static-element-interactions': 'off',
9595
'jsx-a11y/tabindex-no-positive': [
9696
'warn'
9797
],
@@ -107,7 +107,6 @@ module.exports = {
107107
],
108108
'no-extra-boolean-cast': 'off',
109109
'no-nested-ternary': 'off',
110-
'no-null/no-null': 'error',
111110
'no-param-reassign': [
112111
'error',
113112
{
@@ -181,6 +180,7 @@ module.exports = {
181180
],
182181
},
183182
],
183+
'no-empty': ["error", { "allowEmptyCatch": true }],
184184
'padded-blocks': 'off',
185185
'padding-line-between-statements': [
186186
'error',
@@ -263,12 +263,14 @@ module.exports = {
263263
'react/jsx-props-no-spreading': [
264264
0
265265
],
266+
'react/no-danger': 'off',
266267
'react/react-in-jsx-scope': 'off',
267268
'react/require-default-props': 'off',
268269
'semi': [
269270
'error',
270271
'never',
271272
],
272-
'sort-keys': 'error'
273+
'sort-keys': 'error',
274+
'unicorn/no-null': 'error'
273275
},
274276
};

0 commit comments

Comments
 (0)