@nice-move/eslint-config-react 0.5.71 → 0.5.75

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.
Files changed (3) hide show
  1. package/index.cjs +8 -1
  2. package/lib/react.cjs +11 -10
  3. package/package.json +5 -4
package/index.cjs CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  const { extends: roots } = require('@nice-move/eslint-config-base');
4
4
 
5
+ const { getPkg } = require('settingz');
6
+
7
+ function getConfig() {
8
+ const { 'jsx-runtime': runtime = true } = getPkg('nice-move');
9
+ return runtime;
10
+ }
11
+
5
12
  module.exports = {
6
13
  extends: ['@nice-move/eslint-config-base'],
7
14
  overrides: [
@@ -10,7 +17,7 @@ module.exports = {
10
17
  extends: [
11
18
  'airbnb',
12
19
  'airbnb/hooks',
13
- 'plugin:react/jsx-runtime',
20
+ ...(getConfig() ? ['plugin:react/jsx-runtime'] : []),
14
21
  ...roots.filter(
15
22
  (item) => !['eslint:recommended', 'airbnb-base'].includes(item),
16
23
  ),
package/lib/react.cjs CHANGED
@@ -2,18 +2,19 @@
2
2
 
3
3
  module.exports = {
4
4
  rules: {
5
- 'jsx-a11y/anchor-is-valid': 'off',
6
- 'jsx-a11y/click-events-have-key-events': 'off',
7
- 'jsx-a11y/media-has-caption': 'off',
8
- 'jsx-a11y/no-static-element-interactions': 'off',
9
- 'react/destructuring-assignment': 'off',
5
+ 'jsx-a11y/anchor-is-valid': 0,
6
+ 'jsx-a11y/click-events-have-key-events': 0,
7
+ 'jsx-a11y/media-has-caption': 0,
8
+ 'jsx-a11y/no-static-element-interactions': 0,
9
+ 'react/destructuring-assignment': 0,
10
+ 'react/function-component-definition': 0,
10
11
  'react/jsx-curly-brace-presence': [
11
12
  'error',
12
13
  { props: 'ignore', children: 'never' },
13
14
  ],
14
- 'react/jsx-filename-extension': 'off',
15
+ 'react/jsx-filename-extension': 0,
15
16
  'react/jsx-no-useless-fragment': 'warn',
16
- 'react/jsx-props-no-spreading': 'off',
17
+ 'react/jsx-props-no-spreading': 0,
17
18
  'react/prefer-exact-props': 0,
18
19
  'react/prop-types': [
19
20
  'warn',
@@ -24,8 +25,8 @@ module.exports = {
24
25
  'react/require-default-props': 'warn',
25
26
 
26
27
  // handing by garou
27
- 'react/jsx-boolean-value': 'off',
28
- 'react/self-closing-comp': 'off',
29
- 'react/sort-comp': 'off',
28
+ 'react/jsx-boolean-value': 0,
29
+ 'react/self-closing-comp': 0,
30
+ 'react/sort-comp': 0,
30
31
  },
31
32
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-move/eslint-config-react",
3
- "version": "0.5.71",
3
+ "version": "0.5.75",
4
4
  "description": "A `eslint` config for `react` project best practice",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -36,12 +36,13 @@
36
36
  },
37
37
  "main": "index.cjs",
38
38
  "dependencies": {
39
- "@nice-move/eslint-config-base": "^0.5.71",
40
- "eslint-config-airbnb": "^19.0.1",
39
+ "@nice-move/eslint-config-base": "^0.5.75",
40
+ "eslint-config-airbnb": "^19.0.2",
41
41
  "eslint-plugin-import": "^2.25.3",
42
42
  "eslint-plugin-jsx-a11y": "^6.5.1",
43
43
  "eslint-plugin-react": "^7.27.1",
44
- "eslint-plugin-react-hooks": "^4.3.0"
44
+ "eslint-plugin-react-hooks": "^4.3.0",
45
+ "settingz": "^0.1.2"
45
46
  },
46
47
  "peerDependencies": {
47
48
  "eslint": "^7.32.0"