@lomray/eslint-config-react 4.1.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configs/jsx-a11y.js +17 -0
- package/configs/react-hooks.js +11 -0
- package/configs/react.js +30 -0
- package/index.js +17 -29
- package/package.json +7 -8
- package/.nvmrc +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import pluginJSX from 'eslint-plugin-jsx-a11y';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
plugins: {
|
|
5
|
+
'jsx-a11y': pluginJSX,
|
|
6
|
+
},
|
|
7
|
+
languageOptions: {
|
|
8
|
+
parserOptions: {
|
|
9
|
+
ecmaFeatures: {
|
|
10
|
+
jsx: true
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
rules: {
|
|
15
|
+
...pluginJSX.configs.recommended.rules,
|
|
16
|
+
},
|
|
17
|
+
}
|
package/configs/react.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import pluginReact from 'eslint-plugin-react';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
plugins: {
|
|
5
|
+
folders: pluginReact,
|
|
6
|
+
},
|
|
7
|
+
rules: {
|
|
8
|
+
'react/no-deprecated': ['warn'],
|
|
9
|
+
'react/no-did-mount-set-state': ['warn'],
|
|
10
|
+
'react/no-did-update-set-state': ['warn'],
|
|
11
|
+
'react/no-unused-prop-types': ['warn'],
|
|
12
|
+
'react/no-unused-state': ['warn'],
|
|
13
|
+
'react/no-redundant-should-component-update': ['warn'],
|
|
14
|
+
'react/button-has-type': ['error'],
|
|
15
|
+
'react/jsx-boolean-value': ['error', 'never', { always: ['personal'] }],
|
|
16
|
+
'react/destructuring-assignment': ['error'],
|
|
17
|
+
'react/jsx-closing-tag-location': ['error'],
|
|
18
|
+
'react/jsx-curly-newline': ['error'],
|
|
19
|
+
'react/jsx-fragments': ['error'],
|
|
20
|
+
'react/jsx-handler-names': ['error'],
|
|
21
|
+
'react/jsx-key': ['error'],
|
|
22
|
+
'react/jsx-no-constructed-context-values': ['error'],
|
|
23
|
+
'react/no-direct-mutation-state': ['error'],
|
|
24
|
+
'react/jsx-no-useless-fragment': ['error'],
|
|
25
|
+
'react/jsx-uses-react': ['error'],
|
|
26
|
+
'react/no-multi-comp': ['error', { ignoreStateless: true }],
|
|
27
|
+
'react/no-access-state-in-setstate': ['error'],
|
|
28
|
+
'react/no-array-index-key': ['error'],
|
|
29
|
+
},
|
|
30
|
+
}
|
package/index.js
CHANGED
|
@@ -1,30 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
'react/jsx-curly-newline': ['error'],
|
|
19
|
-
'react/jsx-fragments': ['error'],
|
|
20
|
-
'react/jsx-handler-names': ['error'],
|
|
21
|
-
'react/jsx-key': ['error'],
|
|
22
|
-
'react/jsx-no-constructed-context-values': ['error'],
|
|
23
|
-
'react/no-direct-mutation-state': ['error'],
|
|
24
|
-
'react/jsx-no-useless-fragment': ['error'],
|
|
25
|
-
'react/jsx-uses-react': ['error'],
|
|
26
|
-
'react/no-multi-comp': ['error', { ignoreStateless: true }],
|
|
27
|
-
'react/no-access-state-in-setstate': ['error'],
|
|
28
|
-
'react/no-array-index-key': ['error'],
|
|
29
|
-
},
|
|
1
|
+
import baseConfig from '@lomray/eslint-config';
|
|
2
|
+
import react from './configs/react';
|
|
3
|
+
import reactHooks from './configs/react-hooks';
|
|
4
|
+
import jsx from './configs/jsx-a11y';
|
|
5
|
+
|
|
6
|
+
const current = [
|
|
7
|
+
react,
|
|
8
|
+
reactHooks,
|
|
9
|
+
jsx,
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
recommended: [
|
|
14
|
+
baseConfig,
|
|
15
|
+
...current,
|
|
16
|
+
],
|
|
17
|
+
react: current,
|
|
30
18
|
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lomray/eslint-config-react",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "This package provides Lomray
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"description": "This package provides Lomray eslint config as an extensible shared config for React.",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "https://github.com/Lomray-Software/eslint-config-react"
|
|
@@ -14,11 +15,8 @@
|
|
|
14
15
|
"lomray",
|
|
15
16
|
"react",
|
|
16
17
|
"javascript",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"es2016",
|
|
20
|
-
"es2017",
|
|
21
|
-
"es2018"
|
|
18
|
+
"typescript",
|
|
19
|
+
"styleguide"
|
|
22
20
|
],
|
|
23
21
|
"author": "Mikhail Yarmaliuk",
|
|
24
22
|
"license": "MIT",
|
|
@@ -27,7 +25,8 @@
|
|
|
27
25
|
},
|
|
28
26
|
"homepage": "https://github.com/Lomray-Software/eslint-config-react",
|
|
29
27
|
"dependencies": {
|
|
30
|
-
"@lomray/eslint-config": "^
|
|
28
|
+
"@lomray/eslint-config": "^5.0.1",
|
|
29
|
+
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
31
30
|
"eslint-plugin-react": "^7.33.2",
|
|
32
31
|
"eslint-plugin-react-hooks": "^4.6.0"
|
|
33
32
|
}
|
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
18.19.0
|