@lomray/eslint-config-react 4.1.1 → 5.0.1

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.
@@ -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
+ }
@@ -0,0 +1,11 @@
1
+ import pluginReactHooks from 'eslint-plugin-react-hooks';
2
+
3
+ export default {
4
+ plugins: {
5
+ 'react-hooks': pluginReactHooks,
6
+ },
7
+ rules: {
8
+ 'react-hooks/rules-of-hooks': 'error',
9
+ 'react-hooks/exhaustive-deps': 'warn',
10
+ },
11
+ }
@@ -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
- module.exports = {
2
- extends: ['@lomray/eslint-config'],
3
- plugins: ['react', 'react-hooks'],
4
- rules: {
5
- 'react/react-in-jsx-scope': 'off',
6
- 'react-hooks/exhaustive-deps': 'off',
7
- 'react-hooks/rules-of-hooks': 'off',
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
- },
1
+ import baseConfig from '@lomray/eslint-config';
2
+ import react from './configs/react.js';
3
+ import reactHooks from './configs/react-hooks.js';
4
+ import jsx from './configs/jsx-a11y.js';
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.1.1",
4
- "description": "This package provides Lomray .eslintrc as an extensible shared config for React.",
3
+ "version": "5.0.1",
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
- "styleguide",
18
- "es2015",
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": "^4.0.1",
28
+ "@lomray/eslint-config": "^5.0.2",
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
  }