@modern-js-app/eslint-config 1.2.6 → 1.2.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @modern-js-app/eslint-config
2
2
 
3
+ ## 1.2.9
4
+
5
+ ### Patch Changes
6
+
7
+ - 86c243ca: refactor: ts type checking extends `@typescript-eslint/recommended-requiring-type-checking`
8
+ - 3908299a: fix: peer deps warning of eslint plugins
9
+ - Updated dependencies [a0475f1a]
10
+ - @modern-js/plugin-jarvis@1.2.8
11
+ - @modern-js/babel-preset-app@1.2.7
12
+
13
+ ## 1.2.8
14
+
15
+ ### Patch Changes
16
+
17
+ - 6cffe99d: chore:
18
+ remove react eslint rules for `modern-js` rule set.
19
+ add .eslintrc for each package to speed up linting
20
+ - Updated dependencies [6cffe99d]
21
+ - Updated dependencies [04ae5262]
22
+ - Updated dependencies [60f7d8bf]
23
+ - @modern-js/babel-preset-app@1.2.7
24
+
25
+ ## 1.2.7
26
+
27
+ ### Patch Changes
28
+
29
+ - d6522e85: feat: remove max-params and max-statements rule
30
+ - Updated dependencies [17d0cc46]
31
+ - @modern-js/babel-preset-app@1.2.6
32
+
3
33
  ## 1.2.6
4
34
 
5
35
  ### Patch Changes
package/base.js CHANGED
@@ -1,5 +1,4 @@
1
- /* eslint-disable max-lines, no-magic-numbers */
2
-
1
+ /* eslint-disable max-lines */
3
2
  const { jsExtensions } = require('./utils');
4
3
 
5
4
  module.exports = {
@@ -9,7 +8,6 @@ module.exports = {
9
8
  ecmaVersion: 8,
10
9
  ecmaFeatures: {
11
10
  impliedStrict: true,
12
- jsx: true,
13
11
  },
14
12
  sourceType: 'module',
15
13
  babelOptions: {
@@ -36,10 +34,6 @@ module.exports = {
36
34
  plugins: [
37
35
  // https://www.npmjs.com/package/@babel/eslint-plugin
38
36
  '@babel',
39
- // https://www.npmjs.com/package/eslint-plugin-react
40
- 'react',
41
- // https://www.npmjs.com/package/eslint-plugin-react-hooks
42
- 'react-hooks',
43
37
  // https://www.npmjs.com/package/eslint-plugin-import
44
38
  'import',
45
39
  // https://www.npmjs.com/package/eslint-plugin-eslint-comments
@@ -59,7 +53,6 @@ module.exports = {
59
53
  extends: [
60
54
  // https://eslint.org/docs/user-guide/configuring#using-eslintrecommended
61
55
  'eslint:recommended',
62
- 'plugin:react/recommended',
63
56
  'plugin:import/errors',
64
57
  'plugin:import/warnings',
65
58
  'plugin:eslint-comments/recommended',
@@ -619,28 +612,11 @@ module.exports = {
619
612
  skipComments: true,
620
613
  },
621
614
  ],
622
- // https://eslint.org/docs/rules/max-lines-per-function
623
- 'max-lines-per-function': 'off',
624
615
 
625
616
  /*
626
- * 'max-lines-per-function': [
627
- * 'error',
628
- * {
629
- * max: 50,
630
- * skipBlankLines: true,
631
- * skipComments: true,
632
- * IIFEs: true,
633
- * },
634
- * ],
635
617
  * https://eslint.org/docs/rules/max-nested-callbacks
636
618
  */
637
619
  'max-nested-callbacks': ['warn', 4],
638
- // https://eslint.org/docs/rules/max-params
639
- 'max-params': ['warn', 4],
640
- // https://eslint.org/docs/rules/max-statements
641
- 'max-statements': ['warn', 20],
642
- // https://eslint.org/docs/rules/max-statements-per-line
643
- 'max-statements-per-line': ['error', { max: 1 }],
644
620
  // https://eslint.org/docs/rules/multiline-comment-style
645
621
  // @TODO bug:
646
622
  // // class Foo {
@@ -983,166 +959,6 @@ module.exports = {
983
959
  },
984
960
  ],
985
961
 
986
- /*
987
- * react
988
- * https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/boolean-prop-naming.md
989
- */
990
- 'react/boolean-prop-naming': [
991
- 'error',
992
- {
993
- propTypeNames: ['bool'],
994
- rule: '^(is|has|should)[A-Z]([A-Za-z0-9]?)+',
995
- },
996
- ],
997
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/button-has-type.md
998
- 'react/button-has-type': 'error',
999
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/default-props-match-prop-types.md
1000
- 'react/default-props-match-prop-types': 'error',
1001
-
1002
- /*
1003
- * https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/display-name.md
1004
- * @TODO
1005
- * @TIPS
1006
- * for stateless component: use named function for now
1007
- * const Dialog = ({ children }) => (
1008
- * <div className="dialog">{children}</div>
1009
- * )
1010
- * ->
1011
- * const Dialog = function Dialog({ children }) {
1012
- * return (
1013
- * <div className="dialog">{children}</div>
1014
- * )
1015
- * }
1016
- * issues:
1017
- * https://github.com/yannickcr/eslint-plugin-react/issues/1297
1018
- * https://github.com/yannickcr/eslint-plugin-react/issues/412
1019
- * feedback:
1020
- * - 把一个render 作为props传入组件还是比较常见的
1021
- * - 嗯ok,这个规则现在的性价比是不太高了…
1022
- */
1023
- 'react/display-name': 'off',
1024
- /*
1025
- * @CUSTOM
1026
- * "react/forbid-prop-types": [
1027
- * "error",
1028
- * {
1029
- * "forbid": [],
1030
- * "allowInPropTypes": []
1031
- * }
1032
- * ],
1033
- * https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/forbid-foreign-prop-types.md
1034
- */
1035
- 'react/forbid-foreign-prop-types': 'error',
1036
-
1037
- /*
1038
- * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-access-state-in-setstate.md
1039
- * @TIPS
1040
- * this.setState({value: this.state.value + 1});
1041
- * ->
1042
- * this.setState(prevState => ({value: prevState.value + 1}));
1043
- */
1044
- 'react/no-access-state-in-setstate': 'error',
1045
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-array-index-key.md
1046
- 'react/no-array-index-key': 'warn',
1047
- /*
1048
- * https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-danger.md
1049
- * @TIPS
1050
- * explicitly declare `eslint-disable` when truly necessary
1051
- */
1052
- 'react/no-danger': 'error',
1053
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-did-mount-set-state.md
1054
- 'react/no-did-mount-set-state': 'error',
1055
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-multi-comp.md
1056
- 'react/no-multi-comp': ['error', { ignoreStateless: true }],
1057
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-redundant-should-component-update.md
1058
- 'react/no-redundant-should-component-update': 'error',
1059
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-typos.md
1060
- 'react/no-typos': 'error',
1061
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-this-in-sfc.md
1062
- 'react/no-this-in-sfc': 'error',
1063
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unsafe.md
1064
- 'react/no-unsafe': ['error', { checkAliases: true }],
1065
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-unused-prop-types.md
1066
- 'react/no-unused-prop-types': 'error',
1067
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-will-update-set-state.md
1068
- 'react/no-will-update-set-state': 'error',
1069
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/prefer-es6-class.md
1070
- 'react/prefer-es6-class': 'error',
1071
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/prefer-stateless-function.md
1072
- 'react/prefer-stateless-function': [
1073
- 'error',
1074
- { ignorePureComponents: false },
1075
- ],
1076
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/prop-types.md
1077
- 'react/prop-types': [
1078
- 'error',
1079
- {
1080
- skipUndeclared: true,
1081
- ignore: ['children', 'className'],
1082
- },
1083
- ],
1084
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/react-in-jsx-scope.md
1085
- // react 17
1086
- 'react/react-in-jsx-scope': 'off',
1087
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/require-default-props.md
1088
- 'react/require-default-props': [
1089
- 'error',
1090
- { forbidDefaultForRequired: true },
1091
- ],
1092
-
1093
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/self-closing-comp.md
1094
- 'react/self-closing-comp': [
1095
- 'error',
1096
- {
1097
- component: true,
1098
- html: false,
1099
- },
1100
- ],
1101
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md
1102
- 'react/style-prop-object': 'error',
1103
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md
1104
- 'react/void-dom-elements-no-children': 'error',
1105
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
1106
- 'react/jsx-filename-extension': [
1107
- 'error',
1108
- { extensions: ['.jsx', '.tsx', '.mjsx', '.cjsx'] },
1109
- ],
1110
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md
1111
- 'react/jsx-handler-names': [
1112
- 'error',
1113
- {
1114
- eventHandlerPrefix: '',
1115
- // eventHandlerPrefix: 'handle',
1116
- eventHandlerPropPrefix: 'on',
1117
- },
1118
- ],
1119
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md
1120
- 'react/jsx-no-bind': [
1121
- 'error',
1122
- {
1123
- ignoreRefs: true,
1124
- allowArrowFunctions: true,
1125
- },
1126
- ],
1127
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md
1128
- 'react/jsx-no-duplicate-props': ['error', { ignoreCase: true }],
1129
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
1130
- 'react/jsx-no-target-blank': 'off',
1131
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
1132
- 'react/jsx-no-undef': ['error', { allowGlobals: true }],
1133
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
1134
- 'react/jsx-pascal-case': 'error',
1135
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-state.md
1136
- 'react/no-unused-state': 'error',
1137
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/state-in-constructor.md
1138
- 'react/state-in-constructor': ['error', 'never'],
1139
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/static-property-placement.md
1140
- 'react/static-property-placement': 'error',
1141
- // https://reactjs.org/docs/hooks-rules.html
1142
- 'react-hooks/rules-of-hooks': 'error',
1143
- // https://github.com/facebook/react/issues/16006
1144
- 'react-hooks/exhaustive-deps': 'off',
1145
-
1146
962
  /*
1147
963
  * import
1148
964
  * Static analysis
@@ -1453,71 +1269,11 @@ module.exports = {
1453
1269
  'node/prefer-promises/dns': 'off',
1454
1270
  // https://github.com/mysticatea/eslint-plugin-node/blob/v9.0.0/docs/rules/prefer-promises/fs.md
1455
1271
  'node/prefer-promises/fs': 'off',
1456
-
1457
- /*
1458
- * JSDoc
1459
- * @TIPS
1460
- * if your block comments are not JSDoc,
1461
- * change `/**` into `/*`
1462
- * https://github.com/gajus/eslint-plugin-jsdoc#check-alignment
1463
- */
1464
- // 'jsdoc/check-alignment': 'error',
1465
- // // https://github.com/gajus/eslint-plugin-jsdoc#check-examples
1466
- // 'jsdoc/check-examples': 'off',
1467
- // // https://github.com/gajus/eslint-plugin-jsdoc#check-indentation
1468
- // 'jsdoc/check-indentation': 'off',
1469
- // // https://github.com/gajus/eslint-plugin-jsdoc#check-param-names
1470
- // 'jsdoc/check-param-names': 'error',
1471
- // // https://github.com/gajus/eslint-plugin-jsdoc#check-syntax
1472
- // 'jsdoc/check-syntax': 'error',
1473
- // // https://github.com/gajus/eslint-plugin-jsdoc#check-tag-names
1474
- // 'jsdoc/check-tag-names': 'error',
1475
- // // https://github.com/gajus/eslint-plugin-jsdoc#check-types
1476
- // 'jsdoc/check-types': 'error',
1477
- // // https://github.com/gajus/eslint-plugin-jsdoc#implements-on-classes
1478
- // 'jsdoc/implements-on-classes': 'error',
1479
- // // https://github.com/gajus/eslint-plugin-jsdoc#match-description
1480
- // 'jsdoc/match-description': 'off',
1481
- // // https://github.com/gajus/eslint-plugin-jsdoc#newline-after-description
1482
- // 'jsdoc/newline-after-description': ['error', 'always'],
1483
- // // https://github.com/gajus/eslint-plugin-jsdoc#no-types
1484
- // 'jsdoc/no-types': 'off',
1485
- // // https://github.com/gajus/eslint-plugin-jsdoc#no-undefined-types
1486
- // 'jsdoc/no-undefined-types': 'error',
1487
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-description-complete-sentence
1488
- // 'jsdoc/require-description-complete-sentence': 'off',
1489
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-description
1490
- // 'jsdoc/require-description': 'error',
1491
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-example
1492
- // 'jsdoc/require-example': 'off',
1493
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-hyphen-before-param-description
1494
- // 'jsdoc/require-hyphen-before-param-description': ['error', 'always'],
1495
- // // https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-jsdoc
1496
- // 'jsdoc/require-jsdoc': 'off',
1497
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-param-description
1498
- // 'jsdoc/require-param-description': 'error',
1499
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-param-name
1500
- // 'jsdoc/require-param-name': 'error',
1501
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-param-type
1502
- // 'jsdoc/require-param-type': 'off',
1503
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-param
1504
- // 'jsdoc/require-param': 'off',
1505
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-returns-check
1506
- // 'jsdoc/require-returns-check': 'error',
1507
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-returns-description
1508
- // 'jsdoc/require-returns-description': 'error',
1509
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-returns-type
1510
- // 'jsdoc/require-returns-type': 'off',
1511
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-returns
1512
- // 'jsdoc/require-returns': 'off',
1513
- // // https://github.com/gajus/eslint-plugin-jsdoc#valid-types
1514
- // 'jsdoc/valid-types': 'off',
1515
1272
  },
1516
1273
  settings: {
1517
1274
  'import/resolver': 'webpack',
1518
1275
  'import/extensions': jsExtensions,
1519
1276
  'import/ignore': ['\\.coffee$'],
1520
- react: { version: '16.0' },
1521
1277
  },
1522
1278
  // https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns
1523
1279
  // https://eslint.org/docs/user-guide/migrating-to-6.0.0#-overrides-in-an-extended-config-file-can-now-be-overridden-by-a-parent-config-file
@@ -1560,4 +1316,4 @@ module.exports = {
1560
1316
  },
1561
1317
  ],
1562
1318
  };
1563
- /* eslint-enable max-lines, no-magic-numbers */
1319
+ /* eslint-enable max-lines */
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  module.exports = {
2
2
  // https://eslint.org/docs/user-guide/configuring#extending-configuration-files
3
- extends: ['./base.js', './ts', './ts.withType.js', './prettier'],
3
+ extends: ['./base.js', './react', './ts', './ts.withType.js', './prettier'],
4
4
  };
package/lite.js CHANGED
@@ -1,4 +1,4 @@
1
1
  module.exports = {
2
2
  // https://eslint.org/docs/user-guide/configuring#extending-configuration-files
3
- extends: ['./base.js', './ts.js', './prettier'],
3
+ extends: ['./base.js', './react', './ts.js', './prettier'],
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modern-js-app/eslint-config",
3
- "version": "1.2.6",
3
+ "version": "1.2.9",
4
4
  "description": "The meta-framework suite designed from scratch for frontend-focused modern web development.",
5
5
  "homepage": "https://modernjs.dev",
6
6
  "bugs": "https://github.com/modern-js-dev/modern.js/issues",
@@ -13,28 +13,13 @@
13
13
  "modern.js"
14
14
  ],
15
15
  "peerDependencies": {
16
- "@babel/eslint-parser": "^7.15.0",
17
- "@babel/eslint-plugin": "^7.13.10",
18
- "@typescript-eslint/eslint-plugin": "^5.17.0",
19
- "@typescript-eslint/parser": "^5.17.0",
20
- "eslint": "^7.32.0",
21
- "eslint-config-prettier": "^8.3.0",
22
- "eslint-import-resolver-webpack": "^0.13.1",
23
- "eslint-plugin-eslint-comments": "^3.1.1",
24
- "eslint-plugin-filenames": "^1.3.2",
25
- "eslint-plugin-import": "^2.18.2",
26
- "eslint-plugin-markdown": "^2.2.0",
27
- "eslint-plugin-node": "^11.1.0",
28
- "eslint-plugin-prettier": "^4.0.0",
29
- "eslint-plugin-promise": "^5.1.0",
30
- "eslint-plugin-react": "^7.24.0",
31
- "eslint-plugin-react-hooks": "^4.2.0",
32
- "prettier": "^2.5.1"
16
+ "@modern-js/plugin-jarvis": "^1.2.8"
33
17
  },
34
18
  "dependencies": {
35
- "@modern-js/babel-preset-app": "^1.2.5"
19
+ "@modern-js/babel-preset-app": "^1.2.7"
36
20
  },
37
21
  "devDependencies": {
22
+ "@scripts/build": "0.0.0",
38
23
  "eslint": "^7.32.0",
39
24
  "eslint-find-rules": "^3.4.0",
40
25
  "eslint-index": "^1.5.0"
package/react.js ADDED
@@ -0,0 +1,123 @@
1
+ module.exports = {
2
+ // https://eslint.org/docs/user-guide/configuring#specifying-parser-options
3
+ parserOptions: {
4
+ ecmaFeatures: {
5
+ jsx: true,
6
+ },
7
+ },
8
+ // https://eslint.org/docs/user-guide/configuring#configuring-plugins
9
+ plugins: [
10
+ // https://www.npmjs.com/package/eslint-plugin-react
11
+ 'react',
12
+ // https://www.npmjs.com/package/eslint-plugin-react-hooks
13
+ 'react-hooks',
14
+ ],
15
+ // https://eslint.org/docs/user-guide/configuring#extending-configuration-files
16
+ extends: ['plugin:react/recommended', 'plugin:react/jsx-runtime'],
17
+
18
+ settings: {
19
+ react: { version: '16.0' },
20
+ },
21
+
22
+ rules: {
23
+ /*
24
+ * https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/display-name.md
25
+ * @TODO
26
+ * @TIPS
27
+ * for stateless component: use named function for now
28
+ * const Dialog = ({ children }) => (
29
+ * <div className="dialog">{children}</div>
30
+ * )
31
+ * ->
32
+ * const Dialog = function Dialog({ children }) {
33
+ * return (
34
+ * <div className="dialog">{children}</div>
35
+ * )
36
+ * }
37
+ * issues:
38
+ * https://github.com/yannickcr/eslint-plugin-react/issues/1297
39
+ * https://github.com/yannickcr/eslint-plugin-react/issues/412
40
+ * feedback:
41
+ * - 把一个render 作为props传入组件还是比较常见的
42
+ * - 嗯ok,这个规则现在的性价比是不太高了…
43
+ */
44
+ 'react/display-name': 'off',
45
+ /*
46
+ * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-access-state-in-setstate.md
47
+ * @TIPS
48
+ * this.setState({value: this.state.value + 1});
49
+ * ->
50
+ * this.setState(prevState => ({value: prevState.value + 1}));
51
+ */
52
+ 'react/no-access-state-in-setstate': 'error',
53
+ // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-array-index-key.md
54
+ 'react/no-array-index-key': 'warn',
55
+ /*
56
+ * https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-danger.md
57
+ * @TIPS
58
+ * explicitly declare `eslint-disable` when truly necessary
59
+ */
60
+ 'react/no-danger': 'error',
61
+ // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-did-mount-set-state.md
62
+ 'react/no-did-mount-set-state': 'error',
63
+ // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-redundant-should-component-update.md
64
+ 'react/no-redundant-should-component-update': 'error',
65
+ // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-typos.md
66
+ 'react/no-typos': 'error',
67
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-this-in-sfc.md
68
+ 'react/no-this-in-sfc': 'error',
69
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unsafe.md
70
+ 'react/no-unsafe': ['error', { checkAliases: true }],
71
+ // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-unused-prop-types.md
72
+ 'react/no-unused-prop-types': 'error',
73
+ // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-will-update-set-state.md
74
+ 'react/no-will-update-set-state': 'error',
75
+ // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/prefer-stateless-function.md
76
+ 'react/prefer-stateless-function': [
77
+ 'warn',
78
+ { ignorePureComponents: false },
79
+ ],
80
+ // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/prop-types.md
81
+ 'react/prop-types': [
82
+ 'error',
83
+ {
84
+ skipUndeclared: true,
85
+ ignore: ['children', 'className'],
86
+ },
87
+ ],
88
+ // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/require-default-props.md
89
+ 'react/require-default-props': [
90
+ 'error',
91
+ { forbidDefaultForRequired: true },
92
+ ],
93
+
94
+ // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/self-closing-comp.md
95
+ 'react/self-closing-comp': [
96
+ 'error',
97
+ {
98
+ component: true,
99
+ html: false,
100
+ },
101
+ ],
102
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md
103
+ 'react/style-prop-object': 'error',
104
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md
105
+ 'react/void-dom-elements-no-children': 'error',
106
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
107
+ 'react/jsx-no-target-blank': 'off',
108
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
109
+ 'react/jsx-no-undef': ['error', { allowGlobals: true }],
110
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
111
+ 'react/jsx-pascal-case': 'error',
112
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-state.md
113
+ 'react/no-unused-state': 'error',
114
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/state-in-constructor.md
115
+ 'react/state-in-constructor': ['error', 'never'],
116
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/static-property-placement.md
117
+ 'react/static-property-placement': 'error',
118
+ // https://reactjs.org/docs/hooks-rules.html
119
+ 'react-hooks/rules-of-hooks': 'error',
120
+ // https://github.com/facebook/react/issues/16006
121
+ 'react-hooks/exhaustive-deps': 'off',
122
+ },
123
+ };
package/ts.withType.js CHANGED
@@ -9,48 +9,23 @@ module.exports = {
9
9
  // don't set tsconfigRootDir, using the path relative to the cwd
10
10
  project: ['./tsconfig.json'],
11
11
  },
12
+ extends: [
13
+ 'plugin:@typescript-eslint/recommended-requiring-type-checking',
14
+ ],
12
15
  rules: {
13
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/await-thenable.md
14
- '@typescript-eslint/await-thenable': 'error',
15
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-for-in-array.md
16
- '@typescript-eslint/no-for-in-array': 'error',
17
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md
18
- 'no-implied-eval': 'off',
19
- '@typescript-eslint/no-implied-eval': 'error',
20
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-misused-promises.md
16
+ '@typescript-eslint/no-floating-promises': 'off',
21
17
  '@typescript-eslint/no-misused-promises': [
22
18
  'error',
23
19
  { checksVoidReturn: false },
24
20
  ],
25
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md
26
- '@typescript-eslint/no-unnecessary-type-assertion': 'error',
27
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-base-to-string.md
28
- '@typescript-eslint/no-base-to-string': 'error',
29
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md
30
- '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
31
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md
32
- '@typescript-eslint/no-unnecessary-qualifier': 'error',
33
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin//docs/rules/no-unnecessary-type-arguments.md
34
- '@typescript-eslint/no-unnecessary-type-arguments': 'error',
35
- // https://github.com/typescript-eslint/typescript-eslint/pull/294
36
- '@typescript-eslint/prefer-includes': 'error',
37
- // https://github.com/typescript-eslint/typescript-eslint/pull/289
38
- '@typescript-eslint/prefer-string-starts-ends-with': 'error',
39
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md
40
- '@typescript-eslint/prefer-regexp-exec': 'error',
41
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-readonly.md
42
- '@typescript-eslint/prefer-readonly': 'error',
43
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md
44
- '@typescript-eslint/switch-exhaustiveness-check': 'error',
45
- // https://github.com/typescript-eslint/typescript-eslint/blob/55eb0cfac20ccbc2e954083dd554dbcfcbed64fb/packages/eslint-plugin/docs/rules/return-await.md
46
- 'no-return-await': 'off',
47
- '@typescript-eslint/return-await': 'error',
48
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md
49
- 'dot-notation': 'off',
50
- '@typescript-eslint/dot-notation': ['error', { allowKeywords: true }],
51
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md
52
- 'no-throw-literal': 'off',
53
- '@typescript-eslint/no-throw-literal': 'error',
21
+ '@typescript-eslint/no-unsafe-argument': 'off',
22
+ '@typescript-eslint/no-unsafe-assignment': 'off',
23
+ '@typescript-eslint/no-unsafe-call': 'off',
24
+ '@typescript-eslint/no-unsafe-member-access': 'off',
25
+ '@typescript-eslint/no-unsafe-return': 'off',
26
+ '@typescript-eslint/require-await': 'off',
27
+ '@typescript-eslint/restrict-template-expressions': 'off',
28
+ '@typescript-eslint/unbound-method': 'off',
54
29
  },
55
30
  },
56
31
  ],