@lomray/eslint-config-react 5.0.3 → 5.0.5

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/README.md CHANGED
@@ -15,6 +15,10 @@ This package provides Lomray eslint config as an extensible shared config for Re
15
15
  import lomrayConfig from '@lomray/eslint-config-react';
16
16
 
17
17
  export default [
18
- ...lomrayConfig.recommended,
18
+ ...lomrayConfig.recommended, // without files and ignores
19
+ // or
20
+ ...lomrayConfig.config(), // with predefined files and ignores
21
+ // or
22
+ ...lomrayConfig.config({ here: 'your config to exend' }),
19
23
  ];
20
24
  ```
@@ -0,0 +1,9 @@
1
+ import globals from 'globals';
2
+
3
+ export default {
4
+ languageOptions: {
5
+ globals: {
6
+ ...globals.browser,
7
+ }
8
+ }
9
+ }
package/configs/react.js CHANGED
@@ -4,6 +4,11 @@ export default {
4
4
  plugins: {
5
5
  react: pluginReact,
6
6
  },
7
+ settings: {
8
+ react: {
9
+ version: 'detect',
10
+ },
11
+ },
7
12
  rules: {
8
13
  'react/no-deprecated': ['warn'],
9
14
  'react/no-did-mount-set-state': ['warn'],
package/index.js CHANGED
@@ -2,17 +2,23 @@ import baseConfig from '@lomray/eslint-config';
2
2
  import react from './configs/react.js';
3
3
  import reactHooks from './configs/react-hooks.js';
4
4
  import jsx from './configs/jsx-a11y.js';
5
+ import base from './configs/base.js';
5
6
 
6
7
  const reactConfig = [
8
+ base,
7
9
  react,
8
10
  reactHooks,
9
11
  jsx,
10
12
  ];
11
13
 
14
+ const recommended = [
15
+ ...baseConfig.recommended,
16
+ ...reactConfig,
17
+ ];
18
+
12
19
  export default {
13
- recommended: [
14
- ...baseConfig.recommended,
15
- ...reactConfig,
16
- ],
20
+ recommended,
17
21
  react: reactConfig,
22
+ config: (extendConfig = baseConfig.filesIgnores) =>
23
+ recommended.map((original) => ({ ...original, ...extendConfig })),
18
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lomray/eslint-config-react",
3
- "version": "5.0.3",
3
+ "version": "5.0.5",
4
4
  "description": "This package provides Lomray eslint config as an extensible shared config for React.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -25,9 +25,10 @@
25
25
  },
26
26
  "homepage": "https://github.com/Lomray-Software/eslint-config-react",
27
27
  "dependencies": {
28
- "@lomray/eslint-config": "^5.0.2",
28
+ "@lomray/eslint-config": "^5.0.3",
29
29
  "eslint-plugin-jsx-a11y": "^6.8.0",
30
30
  "eslint-plugin-react": "^7.33.2",
31
- "eslint-plugin-react-hooks": "^4.6.0"
31
+ "eslint-plugin-react-hooks": "^4.6.0",
32
+ "globals": "^14.0.0"
32
33
  }
33
34
  }