@modern-js-app/eslint-config 1.2.7 → 1.2.10

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,37 @@
1
1
  # @modern-js-app/eslint-config
2
2
 
3
+ ## 1.2.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 40b78af3d: fix(eslint): remove eslint-import-resolver-webpack
8
+ - Updated dependencies [602299a4d]
9
+ - Updated dependencies [40b78af3d]
10
+ - @modern-js/babel-preset-app@1.3.3
11
+ - @modern-js/plugin-jarvis@1.2.11
12
+
13
+ ## 1.2.9
14
+
15
+ ### Patch Changes
16
+
17
+ - 86c243ca: refactor: ts type checking extends `@typescript-eslint/recommended-requiring-type-checking`
18
+ - 3908299a: fix: peer deps warning of eslint plugins
19
+ - Updated dependencies [a0475f1a]
20
+ - @modern-js/plugin-jarvis@1.2.8
21
+ - @modern-js/babel-preset-app@1.2.7
22
+
23
+ ## 1.2.8
24
+
25
+ ### Patch Changes
26
+
27
+ - 6cffe99d: chore:
28
+ remove react eslint rules for `modern-js` rule set.
29
+ add .eslintrc for each package to speed up linting
30
+ - Updated dependencies [6cffe99d]
31
+ - Updated dependencies [04ae5262]
32
+ - Updated dependencies [60f7d8bf]
33
+ - @modern-js/babel-preset-app@1.2.7
34
+
3
35
  ## 1.2.7
4
36
 
5
37
  ### Patch Changes
package/base.js CHANGED
@@ -8,7 +8,6 @@ module.exports = {
8
8
  ecmaVersion: 8,
9
9
  ecmaFeatures: {
10
10
  impliedStrict: true,
11
- jsx: true,
12
11
  },
13
12
  sourceType: 'module',
14
13
  babelOptions: {
@@ -35,10 +34,6 @@ module.exports = {
35
34
  plugins: [
36
35
  // https://www.npmjs.com/package/@babel/eslint-plugin
37
36
  '@babel',
38
- // https://www.npmjs.com/package/eslint-plugin-react
39
- 'react',
40
- // https://www.npmjs.com/package/eslint-plugin-react-hooks
41
- 'react-hooks',
42
37
  // https://www.npmjs.com/package/eslint-plugin-import
43
38
  'import',
44
39
  // https://www.npmjs.com/package/eslint-plugin-eslint-comments
@@ -58,7 +53,6 @@ module.exports = {
58
53
  extends: [
59
54
  // https://eslint.org/docs/user-guide/configuring#using-eslintrecommended
60
55
  'eslint:recommended',
61
- 'plugin:react/recommended',
62
56
  'plugin:import/errors',
63
57
  'plugin:import/warnings',
64
58
  'plugin:eslint-comments/recommended',
@@ -247,7 +241,7 @@ module.exports = {
247
241
  * ],
248
242
  * https://eslint.org/docs/rules/no-empty-function
249
243
  * @TIPS
250
- * add commment to explain why we need a empty function/method here
244
+ * add comment to explain why we need a empty function/method here
251
245
  */
252
246
  'no-empty-function': ['error', { allow: [] }],
253
247
  // https://eslint.org/docs/rules/no-empty-pattern
@@ -965,166 +959,6 @@ module.exports = {
965
959
  },
966
960
  ],
967
961
 
968
- /*
969
- * react
970
- * https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/boolean-prop-naming.md
971
- */
972
- 'react/boolean-prop-naming': [
973
- 'error',
974
- {
975
- propTypeNames: ['bool'],
976
- rule: '^(is|has|should)[A-Z]([A-Za-z0-9]?)+',
977
- },
978
- ],
979
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/button-has-type.md
980
- 'react/button-has-type': 'error',
981
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/default-props-match-prop-types.md
982
- 'react/default-props-match-prop-types': 'error',
983
-
984
- /*
985
- * https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/display-name.md
986
- * @TODO
987
- * @TIPS
988
- * for stateless component: use named function for now
989
- * const Dialog = ({ children }) => (
990
- * <div className="dialog">{children}</div>
991
- * )
992
- * ->
993
- * const Dialog = function Dialog({ children }) {
994
- * return (
995
- * <div className="dialog">{children}</div>
996
- * )
997
- * }
998
- * issues:
999
- * https://github.com/yannickcr/eslint-plugin-react/issues/1297
1000
- * https://github.com/yannickcr/eslint-plugin-react/issues/412
1001
- * feedback:
1002
- * - 把一个render 作为props传入组件还是比较常见的
1003
- * - 嗯ok,这个规则现在的性价比是不太高了…
1004
- */
1005
- 'react/display-name': 'off',
1006
- /*
1007
- * @CUSTOM
1008
- * "react/forbid-prop-types": [
1009
- * "error",
1010
- * {
1011
- * "forbid": [],
1012
- * "allowInPropTypes": []
1013
- * }
1014
- * ],
1015
- * https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/forbid-foreign-prop-types.md
1016
- */
1017
- 'react/forbid-foreign-prop-types': 'error',
1018
-
1019
- /*
1020
- * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-access-state-in-setstate.md
1021
- * @TIPS
1022
- * this.setState({value: this.state.value + 1});
1023
- * ->
1024
- * this.setState(prevState => ({value: prevState.value + 1}));
1025
- */
1026
- 'react/no-access-state-in-setstate': 'error',
1027
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-array-index-key.md
1028
- 'react/no-array-index-key': 'warn',
1029
- /*
1030
- * https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-danger.md
1031
- * @TIPS
1032
- * explicitly declare `eslint-disable` when truly necessary
1033
- */
1034
- 'react/no-danger': 'error',
1035
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-did-mount-set-state.md
1036
- 'react/no-did-mount-set-state': 'error',
1037
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-multi-comp.md
1038
- 'react/no-multi-comp': ['error', { ignoreStateless: true }],
1039
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-redundant-should-component-update.md
1040
- 'react/no-redundant-should-component-update': 'error',
1041
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-typos.md
1042
- 'react/no-typos': 'error',
1043
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-this-in-sfc.md
1044
- 'react/no-this-in-sfc': 'error',
1045
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unsafe.md
1046
- 'react/no-unsafe': ['error', { checkAliases: true }],
1047
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-unused-prop-types.md
1048
- 'react/no-unused-prop-types': 'error',
1049
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-will-update-set-state.md
1050
- 'react/no-will-update-set-state': 'error',
1051
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/prefer-es6-class.md
1052
- 'react/prefer-es6-class': 'error',
1053
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/prefer-stateless-function.md
1054
- 'react/prefer-stateless-function': [
1055
- 'error',
1056
- { ignorePureComponents: false },
1057
- ],
1058
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/prop-types.md
1059
- 'react/prop-types': [
1060
- 'error',
1061
- {
1062
- skipUndeclared: true,
1063
- ignore: ['children', 'className'],
1064
- },
1065
- ],
1066
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/react-in-jsx-scope.md
1067
- // react 17
1068
- 'react/react-in-jsx-scope': 'off',
1069
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/require-default-props.md
1070
- 'react/require-default-props': [
1071
- 'error',
1072
- { forbidDefaultForRequired: true },
1073
- ],
1074
-
1075
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/self-closing-comp.md
1076
- 'react/self-closing-comp': [
1077
- 'error',
1078
- {
1079
- component: true,
1080
- html: false,
1081
- },
1082
- ],
1083
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md
1084
- 'react/style-prop-object': 'error',
1085
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md
1086
- 'react/void-dom-elements-no-children': 'error',
1087
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
1088
- 'react/jsx-filename-extension': [
1089
- 'error',
1090
- { extensions: ['.jsx', '.tsx', '.mjsx', '.cjsx'] },
1091
- ],
1092
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md
1093
- 'react/jsx-handler-names': [
1094
- 'error',
1095
- {
1096
- eventHandlerPrefix: '',
1097
- // eventHandlerPrefix: 'handle',
1098
- eventHandlerPropPrefix: 'on',
1099
- },
1100
- ],
1101
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md
1102
- 'react/jsx-no-bind': [
1103
- 'error',
1104
- {
1105
- ignoreRefs: true,
1106
- allowArrowFunctions: true,
1107
- },
1108
- ],
1109
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md
1110
- 'react/jsx-no-duplicate-props': ['error', { ignoreCase: true }],
1111
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
1112
- 'react/jsx-no-target-blank': 'off',
1113
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
1114
- 'react/jsx-no-undef': ['error', { allowGlobals: true }],
1115
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
1116
- 'react/jsx-pascal-case': 'error',
1117
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-state.md
1118
- 'react/no-unused-state': 'error',
1119
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/state-in-constructor.md
1120
- 'react/state-in-constructor': ['error', 'never'],
1121
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/static-property-placement.md
1122
- 'react/static-property-placement': 'error',
1123
- // https://reactjs.org/docs/hooks-rules.html
1124
- 'react-hooks/rules-of-hooks': 'error',
1125
- // https://github.com/facebook/react/issues/16006
1126
- 'react-hooks/exhaustive-deps': 'off',
1127
-
1128
962
  /*
1129
963
  * import
1130
964
  * Static analysis
@@ -1435,71 +1269,10 @@ module.exports = {
1435
1269
  'node/prefer-promises/dns': 'off',
1436
1270
  // https://github.com/mysticatea/eslint-plugin-node/blob/v9.0.0/docs/rules/prefer-promises/fs.md
1437
1271
  'node/prefer-promises/fs': 'off',
1438
-
1439
- /*
1440
- * JSDoc
1441
- * @TIPS
1442
- * if your block comments are not JSDoc,
1443
- * change `/**` into `/*`
1444
- * https://github.com/gajus/eslint-plugin-jsdoc#check-alignment
1445
- */
1446
- // 'jsdoc/check-alignment': 'error',
1447
- // // https://github.com/gajus/eslint-plugin-jsdoc#check-examples
1448
- // 'jsdoc/check-examples': 'off',
1449
- // // https://github.com/gajus/eslint-plugin-jsdoc#check-indentation
1450
- // 'jsdoc/check-indentation': 'off',
1451
- // // https://github.com/gajus/eslint-plugin-jsdoc#check-param-names
1452
- // 'jsdoc/check-param-names': 'error',
1453
- // // https://github.com/gajus/eslint-plugin-jsdoc#check-syntax
1454
- // 'jsdoc/check-syntax': 'error',
1455
- // // https://github.com/gajus/eslint-plugin-jsdoc#check-tag-names
1456
- // 'jsdoc/check-tag-names': 'error',
1457
- // // https://github.com/gajus/eslint-plugin-jsdoc#check-types
1458
- // 'jsdoc/check-types': 'error',
1459
- // // https://github.com/gajus/eslint-plugin-jsdoc#implements-on-classes
1460
- // 'jsdoc/implements-on-classes': 'error',
1461
- // // https://github.com/gajus/eslint-plugin-jsdoc#match-description
1462
- // 'jsdoc/match-description': 'off',
1463
- // // https://github.com/gajus/eslint-plugin-jsdoc#newline-after-description
1464
- // 'jsdoc/newline-after-description': ['error', 'always'],
1465
- // // https://github.com/gajus/eslint-plugin-jsdoc#no-types
1466
- // 'jsdoc/no-types': 'off',
1467
- // // https://github.com/gajus/eslint-plugin-jsdoc#no-undefined-types
1468
- // 'jsdoc/no-undefined-types': 'error',
1469
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-description-complete-sentence
1470
- // 'jsdoc/require-description-complete-sentence': 'off',
1471
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-description
1472
- // 'jsdoc/require-description': 'error',
1473
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-example
1474
- // 'jsdoc/require-example': 'off',
1475
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-hyphen-before-param-description
1476
- // 'jsdoc/require-hyphen-before-param-description': ['error', 'always'],
1477
- // // https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-jsdoc
1478
- // 'jsdoc/require-jsdoc': 'off',
1479
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-param-description
1480
- // 'jsdoc/require-param-description': 'error',
1481
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-param-name
1482
- // 'jsdoc/require-param-name': 'error',
1483
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-param-type
1484
- // 'jsdoc/require-param-type': 'off',
1485
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-param
1486
- // 'jsdoc/require-param': 'off',
1487
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-returns-check
1488
- // 'jsdoc/require-returns-check': 'error',
1489
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-returns-description
1490
- // 'jsdoc/require-returns-description': 'error',
1491
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-returns-type
1492
- // 'jsdoc/require-returns-type': 'off',
1493
- // // https://github.com/gajus/eslint-plugin-jsdoc#require-returns
1494
- // 'jsdoc/require-returns': 'off',
1495
- // // https://github.com/gajus/eslint-plugin-jsdoc#valid-types
1496
- // 'jsdoc/valid-types': 'off',
1497
1272
  },
1498
1273
  settings: {
1499
- 'import/resolver': 'webpack',
1500
1274
  'import/extensions': jsExtensions,
1501
1275
  'import/ignore': ['\\.coffee$'],
1502
- react: { version: '16.0' },
1503
1276
  },
1504
1277
  // https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns
1505
1278
  // 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
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.7",
3
+ "version": "1.2.10",
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.11"
33
17
  },
34
18
  "dependencies": {
35
- "@modern-js/babel-preset-app": "^1.2.6"
19
+ "@modern-js/babel-preset-app": "^1.3.3"
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
  ],