Skip to content

Commit a4736aa

Browse files
committed
chore: upgrade to new eslint config
1 parent 93da45e commit a4736aa

File tree

6 files changed

+797
-283
lines changed

6 files changed

+797
-283
lines changed

.eslintrc.json

+43-7
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
{
22
"env": {
33
"browser": true,
4-
"es2021": true
4+
"es2021": true,
5+
"jest": true
56
},
67
"extends": [
8+
"plugin:prettier/recommended",
79
"eslint:recommended",
810
"plugin:react/recommended",
911
"plugin:@typescript-eslint/recommended",
10-
"prettier",
11-
"plugin:react-hooks/recommended"
12+
"plugin:react-hooks/recommended",
13+
"airbnb",
14+
"airbnb-typescript",
15+
"prettier"
1216
],
1317
"parser": "@typescript-eslint/parser",
1418
"parserOptions": {
1519
"ecmaFeatures": {
1620
"jsx": true
1721
},
1822
"ecmaVersion": 12,
19-
"sourceType": "module"
23+
"sourceType": "module",
24+
"project": "./tsconfig.json"
2025
},
21-
"plugins": ["react", "@typescript-eslint"],
26+
"plugins": ["react", "@typescript-eslint", "prettier"],
2227
"rules": {
2328
"linebreak-style": ["error", "unix"],
2429
"quotes": ["error", "single"],
@@ -36,7 +41,38 @@
3641
{
3742
"additionalHooks": "(useSideEffect)|(useMemoizedObject)"
3843
}
39-
]
44+
],
45+
"import/prefer-default-export": "off",
46+
"react/jsx-props-no-spreading": "off",
47+
"no-nested-ternary": "off",
48+
"@typescript-eslint/no-shadow": "off",
49+
"import/no-extraneous-dependencies": "off",
50+
51+
// TODO these came up when upgrading to new eslint config. fix these.
52+
"no-restricted-syntax": "off",
53+
"no-param-reassign": "off",
54+
"@typescript-eslint/no-use-before-define": "off",
55+
"@typescript-eslint/no-unnecessary-type-constraint": "off",
56+
"consistent-return": "off",
57+
"no-await-in-loop": "off",
58+
"@typescript-eslint/no-unused-vars": "off",
59+
"import/no-cycle": "off",
60+
"no-plusplus": "off",
61+
"no-case-declarations": "off",
62+
"react/function-component-definition": "off",
63+
"react/jsx-no-constructed-context-values": "off", // TODO important!,
64+
"react/destructuring-assignment": "off",
65+
"react/button-has-type": "off",
66+
"no-promise-executor-return": "off",
67+
"react/no-danger": "off",
68+
"react/no-unstable-nested-components": "off",
69+
"react/require-default-props": "off",
70+
"react/jsx-no-useless-fragment": "off",
71+
"array-callback-return": "off",
72+
"guard-for-in": "off",
73+
"no-unreachable-loop": "off",
74+
"@typescript-eslint/no-throw-literal": "off",
75+
"jsx-a11y/no-static-element-interactions": "off"
4076
},
41-
"ignorePatterns": ["**/lib"]
77+
"ignorePatterns": ["**/lib", "**/webpack.config.ts"]
4278
}

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea
22
node_modules
3-
storybook-static
3+
storybook-static
4+
yarn-error.log

.prettierrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/prettierrc",
33
"bracketSpacing": true,
4-
"printWidth": 120,
4+
"printWidth": 80,
55
"semi": true,
66
"singleQuote": true,
77
"tabWidth": 2,

package.json

+13-8
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,20 @@
3131
"@storybook/preset-typescript": "^3.0.0",
3232
"@storybook/react": "^6.4.17",
3333
"@types/storybook__react": "^5.2.1",
34-
"@typescript-eslint/eslint-plugin": "^4.28.2",
35-
"@typescript-eslint/parser": "^4.28.2",
36-
"eslint": "^7.30.0",
37-
"eslint-config-prettier": "^8.3.0",
38-
"eslint-plugin-react": "^7.24.0",
39-
"eslint-plugin-react-hooks": "^4.2.0",
40-
"eslint-plugin-storybook": "^0.5.6",
34+
"@typescript-eslint/eslint-plugin": "^5.41.0",
35+
"@typescript-eslint/parser": "^5.41.0",
36+
"eslint": "^8.26.0",
37+
"eslint-config-airbnb": "^19.0.4",
38+
"eslint-config-airbnb-typescript": "^17.0.0",
39+
"eslint-config-prettier": "^8.5.0",
40+
"eslint-plugin-prettier": "^4.2.1",
41+
"eslint-plugin-react": "^7.31.10",
42+
"eslint-plugin-react-hooks": "^4.6.0",
43+
"eslint-plugin-storybook": "^0.6.6",
44+
"eslint-plugin-import": "^2.26.0",
45+
"eslint-plugin-jsx-a11y": "^6.6.1",
4146
"lerna": "^3.22.1",
42-
"prettier": "^2.3.2",
47+
"prettier": "^2.7.1",
4348
"react-docgen": "^5.3.1",
4449
"react-docgen-typescript": "^1.20.5",
4550
"react-docgen-typescript-loader": "^3.7.2",

packages/core/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
"typescript": "4.2.2",
4646
"webpack-cli": "^4.7.2"
4747
},
48+
"peerDependencies": {
49+
"react": "*"
50+
},
4851
"scripts": {
4952
"build": "run-p \"build:*\"",
5053
"build:cjs": "tsc -m commonjs --outDir lib/cjs",

0 commit comments

Comments
 (0)