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

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.
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable max-lines, no-magic-numbers */
2
- // const path = require('path');
3
2
 
4
3
  const { jsExtensions } = require('./utils');
5
4
 
@@ -10,7 +9,6 @@ module.exports = {
10
9
  ecmaVersion: 8,
11
10
  ecmaFeatures: {
12
11
  impliedStrict: true,
13
- ecmaVersion: 2018,
14
12
  jsx: true,
15
13
  },
16
14
  sourceType: 'module',
@@ -23,8 +21,9 @@ module.exports = {
23
21
  // https://eslint.org/docs/user-guide/configuring#specifying-environments
24
22
  env: {
25
23
  es6: true,
24
+ commonjs: false,
26
25
  'shared-node-browser': true,
27
- browser: false,
26
+ browser: true,
28
27
  node: false,
29
28
  worker: false,
30
29
  serviceworker: false,
@@ -35,8 +34,6 @@ module.exports = {
35
34
  globals: { gql: 'readable' },
36
35
  // https://eslint.org/docs/user-guide/configuring#configuring-plugins
37
36
  plugins: [
38
- // https://www.npmjs.com/package/eslint-plugin-prettier
39
- 'prettier',
40
37
  // https://www.npmjs.com/package/@babel/eslint-plugin
41
38
  '@babel',
42
39
  // https://www.npmjs.com/package/eslint-plugin-react
@@ -100,7 +97,7 @@ module.exports = {
100
97
 
101
98
  /*
102
99
  * https://eslint.org/docs/rules/no-debugger
103
- * @TIPS: for non-VSCode users, please use `debugger // eslint-disable-line`
100
+ * @TIPS: for non-VS Code users, please use `debugger // eslint-disable-line`
104
101
  * instead of `debugger` to avoid it to be removed by IDE's autoFixOnSave feature
105
102
  */
106
103
  'no-debugger': 'error',
@@ -158,10 +155,6 @@ module.exports = {
158
155
  'no-unsafe-finally': 'error',
159
156
  // https://eslint.org/docs/rules/no-unsafe-negation
160
157
  'no-unsafe-negation': 'error',
161
- // https://eslint.org/docs/rules/require-atomic-updates
162
- // @bug https://github.com/eslint/eslint/issues/11899
163
- 'require-atomic-updates': 'warn',
164
- // 'require-atomic-updates': 'error',
165
158
  // https://eslint.org/docs/rules/use-isnan
166
159
  'use-isnan': 'error',
167
160
  // https://eslint.org/docs/rules/valid-typeof
@@ -430,17 +423,6 @@ module.exports = {
430
423
  // @CUSTOM
431
424
  ],
432
425
 
433
- /*
434
- * https://eslint.org/docs/rules/no-shadow
435
- * "no-shadow": "off",
436
- */
437
- 'no-shadow': [
438
- 'error',
439
- {
440
- builtinGlobals: false,
441
- allow: [],
442
- },
443
- ],
444
426
  // https://eslint.org/docs/rules/no-shadow-restricted-names
445
427
  'no-shadow-restricted-names': 'error',
446
428
  // https://eslint.org/docs/rules/no-undef
@@ -1016,12 +998,6 @@ module.exports = {
1016
998
  'react/button-has-type': 'error',
1017
999
  // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/default-props-match-prop-types.md
1018
1000
  'react/default-props-match-prop-types': 'error',
1019
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md
1020
- 'react/destructuring-assignment': [
1021
- 'error',
1022
- 'always',
1023
- { ignoreClassFields: true },
1024
- ],
1025
1001
 
1026
1002
  /*
1027
1003
  * https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/display-name.md
@@ -1045,59 +1021,6 @@ module.exports = {
1045
1021
  * - 嗯ok,这个规则现在的性价比是不太高了…
1046
1022
  */
1047
1023
  'react/display-name': 'off',
1048
- // 'react/display-name': [
1049
- // 'error',
1050
- // {
1051
- // ignoreTranspilerName: false,
1052
- // },
1053
- // ],
1054
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/forbid-component-props.md
1055
- 'react/forbid-component-props': 'off',
1056
-
1057
- /*
1058
- * @CUSTOM
1059
- * "react/forbid-component-props": [
1060
- * "error",
1061
- * {
1062
- * "forbid": [
1063
- * "className",
1064
- * "style"
1065
- * ]
1066
- * }
1067
- * ],
1068
- * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-dom-props.md
1069
- */
1070
- 'react/forbid-dom-props': 'off',
1071
-
1072
- /*
1073
- * @CUSTOM
1074
- * "react/forbid-dom-props": [
1075
- * "error",
1076
- * {
1077
- * "forbid": []
1078
- * }
1079
- * ],
1080
- * https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/forbid-elements.md
1081
- */
1082
- 'react/forbid-elements': 'off',
1083
-
1084
- /*
1085
- * @CUSTOM
1086
- * "react/forbid-elements": [
1087
- * "error",
1088
- * {
1089
- * "forbid": [
1090
- * {
1091
- * "element": "button",
1092
- * "message": "use <Button> instead"
1093
- * }
1094
- * ]
1095
- * }
1096
- * ],
1097
- * https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/forbid-prop-types.md
1098
- */
1099
- 'react/forbid-prop-types': 'off',
1100
-
1101
1024
  /*
1102
1025
  * @CUSTOM
1103
1026
  * "react/forbid-prop-types": [
@@ -1121,52 +1044,22 @@ module.exports = {
1121
1044
  'react/no-access-state-in-setstate': 'error',
1122
1045
  // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-array-index-key.md
1123
1046
  'react/no-array-index-key': 'warn',
1124
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-children-prop.md
1125
- 'react/no-children-prop': 'error',
1126
-
1127
1047
  /*
1128
1048
  * https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-danger.md
1129
1049
  * @TIPS
1130
1050
  * explicitly declare `eslint-disable` when truly necessary
1131
1051
  */
1132
1052
  'react/no-danger': 'error',
1133
-
1134
- /*
1135
- * https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-danger-with-children.md
1136
- * @TIPS
1137
- * explicitly declare `eslint-disable` when truly necessary
1138
- */
1139
- 'react/no-danger-with-children': 'error',
1140
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-deprecated.md
1141
- 'react/no-deprecated': 'error',
1142
1053
  // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-did-mount-set-state.md
1143
1054
  'react/no-did-mount-set-state': 'error',
1144
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-did-update-set-state.md
1145
- 'react/no-did-update-set-state': 'off',
1146
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-direct-mutation-state.md
1147
- 'react/no-direct-mutation-state': 'error',
1148
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-find-dom-node.md
1149
- 'react/no-find-dom-node': 'error',
1150
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-is-mounted.md
1151
- 'react/no-is-mounted': 'error',
1152
1055
  // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-multi-comp.md
1153
1056
  'react/no-multi-comp': ['error', { ignoreStateless: true }],
1154
1057
  // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-redundant-should-component-update.md
1155
1058
  'react/no-redundant-should-component-update': 'error',
1156
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-render-return-value.md
1157
- 'react/no-render-return-value': 'error',
1158
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-set-state.md
1159
- 'react/no-set-state': 'off',
1160
1059
  // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-typos.md
1161
1060
  'react/no-typos': 'error',
1162
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-string-refs.md
1163
- 'react/no-string-refs': 'error',
1164
1061
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-this-in-sfc.md
1165
1062
  'react/no-this-in-sfc': 'error',
1166
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-unescaped-entities.md
1167
- 'react/no-unescaped-entities': 'error',
1168
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-unknown-property.md
1169
- 'react/no-unknown-property': 'error',
1170
1063
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unsafe.md
1171
1064
  'react/no-unsafe': ['error', { checkAliases: true }],
1172
1065
  // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/no-unused-prop-types.md
@@ -1197,14 +1090,6 @@ module.exports = {
1197
1090
  { forbidDefaultForRequired: true },
1198
1091
  ],
1199
1092
 
1200
- /*
1201
- * https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/require-optimization.md
1202
- * https://github.com/facebook/react/pull/7195#issuecomment-236361372
1203
- * https://hackernoon.com/react-purecomponent-considered-harmful-8155b5c1d4bc
1204
- */
1205
- 'react/require-optimization': 'off',
1206
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/require-render-return.md
1207
- 'react/require-render-return': 'error',
1208
1093
  // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/self-closing-comp.md
1209
1094
  'react/self-closing-comp': [
1210
1095
  'error',
@@ -1213,102 +1098,15 @@ module.exports = {
1213
1098
  html: false,
1214
1099
  },
1215
1100
  ],
1216
- // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/sort-comp.md
1217
- 'react/sort-comp': [
1218
- 'error',
1219
- {
1220
- order: [
1221
- 'type-annotations',
1222
- 'class-properties-and-methods',
1223
- 'instance-variables',
1224
- 'state',
1225
- 'getInitialState',
1226
- 'getChildContext',
1227
- 'getDefaultProps',
1228
- 'constructor',
1229
- 'lifecycle',
1230
- '/^is.+$/',
1231
- '/^_is.+$/',
1232
- '/^has.+$/',
1233
- '/^_has.+$/',
1234
- '/^should.+$/',
1235
- '/^_should.+$/',
1236
- '/^get.+$/',
1237
- '/^_get.+$/',
1238
- 'getters',
1239
- '/^set.+$/',
1240
- '/^_set.+$/',
1241
- 'setters',
1242
- '/^on.+$/',
1243
- '/^_on.+$/',
1244
- '/^handle.+$/',
1245
- '/^_handle.+$/',
1246
- 'instance-methods',
1247
- 'everything-else',
1248
- 'rendering',
1249
- ],
1250
- groups: {
1251
- 'class-properties-and-methods': [
1252
- 'displayName',
1253
- 'propTypes',
1254
- 'contextTypes',
1255
- 'childContextTypes',
1256
- 'mixins',
1257
- 'statics',
1258
- 'defaultProps',
1259
- 'getDerivedStateFromProps',
1260
- 'static-methods',
1261
- ],
1262
- lifecycle: [
1263
- 'UNSAFE_componentWillMount',
1264
- 'componentWillMount',
1265
- 'componentDidMount',
1266
- 'UNSAFE_componentWillReceiveProps',
1267
- 'componentWillReceiveProps',
1268
- 'shouldComponentUpdate',
1269
- 'getSnapshotBeforeUpdate',
1270
- 'UNSAFE_componentWillUpdate',
1271
- 'componentWillUpdate',
1272
- 'componentDidUpdate',
1273
- 'componentWillUnmount',
1274
- ],
1275
- rendering: ['/^render.+$/', 'render'],
1276
- },
1277
- },
1278
- ],
1279
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md
1280
- 'react/sort-prop-types': 'off',
1281
1101
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md
1282
1102
  'react/style-prop-object': 'error',
1283
1103
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md
1284
1104
  'react/void-dom-elements-no-children': 'error',
1285
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
1286
- 'react/jsx-boolean-value': ['error', 'always'],
1287
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-child-element-spacing.md
1288
- 'react/jsx-child-element-spacing': 'error',
1289
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md
1290
- 'react/jsx-closing-bracket-location': [
1291
- 'error',
1292
- {
1293
- // "selfClosing": "props-aligned",
1294
- selfClosing: 'after-props',
1295
- // "nonEmpty": "props-aligned"
1296
- nonEmpty: 'after-props',
1297
- },
1298
- ],
1299
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md
1300
- 'react/jsx-closing-tag-location': 'error',
1301
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md
1302
- 'react/jsx-curly-spacing': ['error', { when: 'never' }],
1303
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-equals-spacing.md
1304
- 'react/jsx-equals-spacing': ['error', 'never'],
1305
1105
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
1306
1106
  'react/jsx-filename-extension': [
1307
1107
  'error',
1308
1108
  { extensions: ['.jsx', '.tsx', '.mjsx', '.cjsx'] },
1309
1109
  ],
1310
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md
1311
- 'react/jsx-first-prop-new-line': ['error', 'multiline'],
1312
1110
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md
1313
1111
  'react/jsx-handler-names': [
1314
1112
  'error',
@@ -1318,22 +1116,6 @@ module.exports = {
1318
1116
  eventHandlerPropPrefix: 'on',
1319
1117
  },
1320
1118
  ],
1321
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md
1322
- 'react/jsx-indent': ['error', 2],
1323
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md
1324
- 'react/jsx-indent-props': ['error', 2],
1325
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
1326
- 'react/jsx-key': 'error',
1327
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-depth.md
1328
- 'react/jsx-max-depth': 'off',
1329
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md
1330
- 'react/jsx-max-props-per-line': [
1331
- 'error',
1332
- {
1333
- maximum: 1,
1334
- when: 'always',
1335
- },
1336
- ],
1337
1119
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md
1338
1120
  'react/jsx-no-bind': [
1339
1121
  'error',
@@ -1342,85 +1124,20 @@ module.exports = {
1342
1124
  allowArrowFunctions: true,
1343
1125
  },
1344
1126
  ],
1345
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md
1346
- 'react/jsx-no-comment-textnodes': 'error',
1347
1127
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md
1348
1128
  'react/jsx-no-duplicate-props': ['error', { ignoreCase: true }],
1349
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md
1350
- 'react/jsx-no-literals': 'off',
1351
1129
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
1352
1130
  'react/jsx-no-target-blank': 'off',
1353
1131
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
1354
1132
  'react/jsx-no-undef': ['error', { allowGlobals: true }],
1355
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-one-expression-per-line.md
1356
- 'react/jsx-one-expression-per-line': ['error', { allow: 'single-child' }],
1357
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
1358
- 'react/jsx-curly-brace-presence': 'off',
1359
-
1360
- /*
1361
- * "react/jsx-curly-brace-presence": [
1362
- * "error",
1363
- * "never"
1364
- * ],
1365
- * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
1366
- * @TODO bug
1367
- */
1368
- 'react/jsx-fragments': 'off', // ['error', 'syntax'],
1369
1133
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
1370
1134
  'react/jsx-pascal-case': 'error',
1371
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-multi-spaces.md
1372
- 'react/jsx-props-no-multi-spaces': 'error',
1373
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-default-props.md
1374
- 'react/jsx-sort-default-props': 'off',
1375
-
1376
- /*
1377
- * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
1378
- * @TODO bug: conflict with prettier
1379
- */
1380
- 'react/jsx-sort-props': 'off',
1381
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md
1382
- 'react/jsx-tag-spacing': [
1383
- 'error',
1384
- {
1385
- closingSlash: 'never',
1386
- beforeSelfClosing: 'always',
1387
- afterOpening: 'never',
1388
- beforeClosing: 'never',
1389
- },
1390
- ],
1391
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md
1392
- // react 17
1393
- 'react/jsx-uses-react': 'error',
1394
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md
1395
- 'react/jsx-uses-vars': 'error',
1396
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-wrap-multilines.md
1397
- 'react/jsx-wrap-multilines': [
1398
- 'error',
1399
- {
1400
- declaration: true,
1401
- assignment: true,
1402
- return: true,
1403
- arrow: true,
1404
- condition: 'parens-new-line',
1405
- logical: 'parens-new-line',
1406
- prop: 'parens-new-line',
1407
- },
1408
- ],
1409
1135
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-state.md
1410
1136
  'react/no-unused-state': 'error',
1411
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md
1412
- 'react/jsx-props-no-spreading': 'off',
1413
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-read-only-props.md
1414
- 'react/prefer-read-only-props': 'off',
1415
1137
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/state-in-constructor.md
1416
1138
  'react/state-in-constructor': ['error', 'never'],
1417
1139
  // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/static-property-placement.md
1418
1140
  'react/static-property-placement': 'error',
1419
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md
1420
- 'react/jsx-curly-newline': [
1421
- 'error',
1422
- { multiline: 'require', singleline: 'forbid' },
1423
- ],
1424
1141
  // https://reactjs.org/docs/hooks-rules.html
1425
1142
  'react-hooks/rules-of-hooks': 'error',
1426
1143
  // https://github.com/facebook/react/issues/16006
@@ -1631,8 +1348,6 @@ module.exports = {
1631
1348
  * use Camel Case for others
1632
1349
  */
1633
1350
  'filenames/match-regex': ['error', '^[\\[\\]_a-zA-Z0-9.-]+$'],
1634
- // https://www.npmjs.com/package/eslint-plugin-filenames#matching-exported-values-match-exported
1635
- 'filenames/match-exported': ['error', ['kebab', 'camel', 'pascal']],
1636
1351
  // https://www.npmjs.com/package/eslint-plugin-filenames#dont-allow-indexjs-files-no-index
1637
1352
  'filenames/no-index': 'off',
1638
1353
 
@@ -1662,12 +1377,6 @@ module.exports = {
1662
1377
  // https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/valid-params.md
1663
1378
  'promise/valid-params': 'error',
1664
1379
 
1665
- /*
1666
- * https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/prefer-await-to-then.md
1667
- * @CUSTOM
1668
- */
1669
- 'promise/prefer-await-to-then': 'error',
1670
-
1671
1380
  /*
1672
1381
  * https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/prefer-await-to-callbacks.md
1673
1382
  * @CUSTOM
@@ -1813,467 +1522,6 @@ module.exports = {
1813
1522
  // https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns
1814
1523
  // 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
1815
1524
  overrides: [
1816
- {
1817
- files: ['*.ts', '*.d.ts', '*.tsx'],
1818
-
1819
- /*
1820
- * https://eslint.org/blog/2019/01/future-typescript-eslint
1821
- * https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser
1822
- */
1823
- parser: '@typescript-eslint/parser',
1824
- parserOptions: {
1825
- ecmaFeatures: { jsx: true },
1826
- project: ['./tsconfig.json', './packages/*/tsconfig.json'],
1827
- // createDefaultProgram: true,
1828
- // project: 'node_modules/@modern/config/defaults/tsconfig.json',
1829
- // tsconfigRootDir: path.resolve(
1830
- // path.dirname(require.resolve('eslint/package.json')),
1831
- // '../..',
1832
- // ),
1833
- },
1834
- // https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin
1835
- plugins: [
1836
- '@typescript-eslint',
1837
- // 'tsdoc'
1838
- ],
1839
- // @BUG
1840
- // extends: ['plugin:@typescript-eslint/recommended'],
1841
- // https://github.com/benmosher/eslint-plugin-import/blob/master/config/typescript.js
1842
- settings: {
1843
- 'import/external-module-folders': [
1844
- 'node_modules',
1845
- 'node_modules/@types',
1846
- ],
1847
- 'import/parsers': {
1848
- '@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'],
1849
- },
1850
- 'import/resolver': { node: { extensions: jsExtensions } },
1851
- },
1852
- rules: {
1853
- // https://github.com/benmosher/eslint-plugin-import/blob/master/config/typescript.js
1854
- 'import/named': 'off',
1855
- camelcase: 'off',
1856
- indent: 'off',
1857
- 'no-unused-vars': 'off',
1858
- 'no-use-before-define': 'off',
1859
- // type A = { foo: string; }; export { A };
1860
- 'no-undef': 'off',
1861
- 'prefer-named-capture-group': 'off',
1862
- 'no-useless-constructor': 'off',
1863
- 'no-array-constructor': 'off',
1864
- 'func-call-spacing': 'off',
1865
- // @BUG no ignore
1866
- 'no-magic-numbers': 'off',
1867
- semi: 'off',
1868
- 'no-empty-function': 'off',
1869
- 'equire-await': 'off',
1870
- 'require-await': 'off',
1871
- 'one-var': ['error', 'never'],
1872
- // 'jsdoc/no-types': 'error',
1873
- 'react/require-default-props': 'off',
1874
- // 'jsdoc/check-tag-names': 'off',
1875
- // https://github.com/microsoft/tsdoc/tree/master/eslint-plugin
1876
- // 'tsdoc/syntax': 'warn',
1877
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md
1878
- '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
1879
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md
1880
- '@typescript-eslint/adjacent-overload-signatures': 'error',
1881
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/array-type.md
1882
- '@typescript-eslint/array-type': 'off',
1883
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/await-thenable.md
1884
- '@typescript-eslint/await-thenable': 'error',
1885
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/ban-ts-comment.md
1886
- '@typescript-eslint/ban-ts-comment': [
1887
- 'error',
1888
- {
1889
- 'ts-expect-error': true,
1890
- 'ts-ignore': true,
1891
- 'ts-nocheck': true,
1892
- 'ts-check': false,
1893
- },
1894
- ],
1895
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/ban-types.md
1896
- '@typescript-eslint/ban-types': 'error',
1897
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/ban-ts-comment.md
1898
- '@typescript-eslint/ban-tslint-comment': 'error',
1899
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/class-literal-property-style.md
1900
- '@typescript-eslint/class-literal-property-style': ['error', 'fields'],
1901
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-indexed-object-style.md
1902
- '@typescript-eslint/consistent-indexed-object-style': 'off',
1903
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-assertions.md
1904
- '@typescript-eslint/consistent-type-assertions': 'error',
1905
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-definitions.md
1906
- '@typescript-eslint/consistent-type-definitions': 'off',
1907
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-imports.md
1908
- '@typescript-eslint/consistent-type-imports': 'off',
1909
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-function-return-type.md
1910
- '@typescript-eslint/explicit-function-return-type': 'off',
1911
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md
1912
- '@typescript-eslint/explicit-member-accessibility': 'off',
1913
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md
1914
- '@typescript-eslint/explicit-module-boundary-types': 'off',
1915
- '@typescript-eslint/indent': [
1916
- 'error',
1917
- 2,
1918
- {
1919
- SwitchCase: 1,
1920
- VariableDeclarator: 'first',
1921
- outerIIFEBody: 0,
1922
- MemberExpression: 1,
1923
- FunctionDeclaration: { parameters: 'first' },
1924
- FunctionExpression: { parameters: 'first' },
1925
- CallExpression: { arguments: 'first' },
1926
- ArrayExpression: 1,
1927
- ObjectExpression: 1,
1928
- ImportDeclaration: 1,
1929
- flatTernaryExpressions: false,
1930
- },
1931
- ],
1932
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-delimiter-style.md
1933
- '@typescript-eslint/member-delimiter-style': [
1934
- 'error',
1935
- {
1936
- multiline: {
1937
- delimiter: 'semi',
1938
- requireLast: true,
1939
- },
1940
- singleline: {
1941
- delimiter: 'semi',
1942
- requireLast: true,
1943
- },
1944
- },
1945
- ],
1946
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-ordering.md
1947
- '@typescript-eslint/member-ordering': [
1948
- 'error',
1949
- {
1950
- default: [
1951
- 'public-static-field',
1952
- 'protected-static-field',
1953
- 'private-static-field',
1954
- 'static-field',
1955
- 'public-static-method',
1956
- 'protected-static-method',
1957
- 'private-static-method',
1958
- 'static-method',
1959
- 'public-instance-field',
1960
- 'protected-instance-field',
1961
- 'private-instance-field',
1962
- 'instance-field',
1963
- 'public-field',
1964
- 'protected-field',
1965
- 'private-field',
1966
- 'field',
1967
- 'constructor',
1968
- // 'public-instance-method',
1969
- // 'protected-instance-method',
1970
- // 'private-instance-method',
1971
- 'instance-method',
1972
- // 'public-method',
1973
- // 'protected-method',
1974
- // 'private-method',
1975
- 'method',
1976
- ],
1977
- },
1978
- ],
1979
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/method-signature-style.md
1980
- '@typescript-eslint/method-signature-style': 'error',
1981
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md
1982
- '@typescript-eslint/naming-convention': [
1983
- 'error',
1984
- {
1985
- selector: 'default',
1986
- format: ['camelCase', 'PascalCase', 'UPPER_CASE', 'snake_case'],
1987
- leadingUnderscore: 'allowSingleOrDouble',
1988
- trailingUnderscore: 'allowSingleOrDouble',
1989
- },
1990
-
1991
- {
1992
- selector: 'variable',
1993
- format: ['camelCase', 'PascalCase', 'UPPER_CASE', 'snake_case'],
1994
- leadingUnderscore: 'allowSingleOrDouble',
1995
- trailingUnderscore: 'allowSingleOrDouble',
1996
- },
1997
-
1998
- {
1999
- selector: 'typeLike',
2000
- format: ['PascalCase'],
2001
- },
2002
- ],
2003
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md
2004
- '@typescript-eslint/no-array-constructor': 'error',
2005
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-interface.md
2006
- '@typescript-eslint/no-empty-interface': 'error',
2007
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-explicit-any.md
2008
- // @TODO disable?
2009
- '@typescript-eslint/no-explicit-any': 'off',
2010
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extraneous-class.md
2011
- '@typescript-eslint/no-extraneous-class': 'error',
2012
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-for-in-array.md
2013
- '@typescript-eslint/no-for-in-array': 'error',
2014
- // https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules
2015
- '@typescript-eslint/no-implicit-any-catch': 'off',
2016
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-inferrable-types.md
2017
- '@typescript-eslint/no-inferrable-types': [
2018
- 'error',
2019
- { ignoreProperties: true },
2020
- ],
2021
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-misused-new.md
2022
- '@typescript-eslint/no-misused-new': 'error',
2023
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-namespace.md
2024
- '@typescript-eslint/no-namespace': 'error',
2025
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-base-to-string.md
2026
- '@typescript-eslint/no-base-to-string': 'error',
2027
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md
2028
- '@typescript-eslint/no-confusing-non-null-assertion': 'error',
2029
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md
2030
- '@typescript-eslint/no-confusing-void-expression': 'off',
2031
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-non-null-assertion.md
2032
- // @feedback 在 middleware 下,如果有些参数是 optional 的,会在上一层被拦截掉,下一层一定会有这个参数
2033
- '@typescript-eslint/no-non-null-assertion': 'off',
2034
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md
2035
- '@typescript-eslint/no-extra-non-null-assertion': 'error',
2036
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-parameter-properties.md
2037
- '@typescript-eslint/no-parameter-properties': 'error',
2038
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-require-imports.md
2039
- '@typescript-eslint/no-require-imports': 'error',
2040
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-this-alias.md
2041
- '@typescript-eslint/no-this-alias': [
2042
- 'error',
2043
- { allowDestructuring: true },
2044
- ],
2045
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-type-alias.md
2046
- '@typescript-eslint/no-type-alias': 'off',
2047
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md
2048
- '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
2049
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md
2050
- '@typescript-eslint/no-unnecessary-condition': 'off',
2051
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md
2052
- '@typescript-eslint/no-unnecessary-qualifier': 'error',
2053
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md
2054
- '@typescript-eslint/no-unnecessary-type-assertion': 'error',
2055
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md
2056
- '@typescript-eslint/no-unnecessary-type-constraint': 'error',
2057
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md
2058
- '@typescript-eslint/no-unsafe-assignment': 'off',
2059
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unsafe-call.md
2060
- '@typescript-eslint/no-unsafe-call': 'off',
2061
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md
2062
- '@typescript-eslint/no-unsafe-member-access': 'off',
2063
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unsafe-return.md
2064
- '@typescript-eslint/no-unsafe-return': 'off',
2065
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md
2066
- '@typescript-eslint/no-unused-vars': [
2067
- 'error',
2068
- {
2069
- vars: 'all',
2070
- args: 'after-used',
2071
- ignoreRestSiblings: true,
2072
- argsIgnorePattern: '^_',
2073
- caughtErrors: 'none',
2074
- },
2075
- ],
2076
- '@babel/no-unused-expressions': 'off',
2077
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md
2078
- '@typescript-eslint/no-unused-expressions': [
2079
- 'error',
2080
- {
2081
- allowShortCircuit: true,
2082
- allowTernary: false,
2083
- allowTaggedTemplates: true,
2084
- },
2085
- ],
2086
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md
2087
- '@typescript-eslint/no-use-before-define': [
2088
- 'error',
2089
- {
2090
- functions: false,
2091
- classes: false,
2092
- variables: false,
2093
- },
2094
- ],
2095
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-useless-constructor.md
2096
- '@typescript-eslint/no-useless-constructor': 'error',
2097
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-var-requires.md
2098
- '@typescript-eslint/no-var-requires': 'error',
2099
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-as-const.md
2100
- '@typescript-eslint/prefer-as-const': 'error',
2101
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md
2102
- '@typescript-eslint/prefer-enum-initializers': 'off',
2103
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-for-of.md
2104
- '@typescript-eslint/prefer-for-of': 'error',
2105
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-function-type.md
2106
- '@typescript-eslint/prefer-function-type': 'error',
2107
- // https://github.com/typescript-eslint/typescript-eslint/pull/294
2108
- '@typescript-eslint/prefer-includes': 'error',
2109
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md
2110
- '@typescript-eslint/prefer-namespace-keyword': 'off',
2111
- // https://github.com/typescript-eslint/typescript-eslint/pull/289
2112
- '@typescript-eslint/prefer-string-starts-ends-with': 'error',
2113
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md
2114
- '@typescript-eslint/prefer-literal-enum-member': 'error',
2115
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-optional-chain.md
2116
- '@typescript-eslint/prefer-optional-chain': 'error',
2117
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md
2118
- '@typescript-eslint/prefer-nullish-coalescing': 'off',
2119
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md
2120
- '@typescript-eslint/prefer-readonly-parameter-types': 'off',
2121
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md
2122
- '@typescript-eslint/prefer-reduce-type-parameter': 'off',
2123
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md
2124
- '@typescript-eslint/prefer-ts-expect-error': 'error',
2125
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/promise-function-async.md
2126
- // @BUG
2127
- '@typescript-eslint/promise-function-async': 'off',
2128
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-array-sort-compare.md
2129
- '@typescript-eslint/require-array-sort-compare': 'off',
2130
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/restrict-plus-operands.md
2131
- '@typescript-eslint/restrict-plus-operands': 'off',
2132
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/restrict-template-expressions.md
2133
- '@typescript-eslint/restrict-template-expressions': [
2134
- 'error',
2135
- { allowNumber: true, allowAny: true },
2136
- ],
2137
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md
2138
- '@typescript-eslint/switch-exhaustiveness-check': 'error',
2139
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/triple-slash-reference.md
2140
- '@typescript-eslint/triple-slash-reference': 'off',
2141
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/type-annotation-spacing.md
2142
- '@typescript-eslint/type-annotation-spacing': [
2143
- 'error',
2144
- {
2145
- before: false,
2146
- after: true,
2147
- },
2148
- ],
2149
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/unbound-method.md
2150
- '@typescript-eslint/unbound-method': 'off',
2151
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/unified-signatures.md
2152
- '@typescript-eslint/unified-signatures': 'error',
2153
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/func-call-spacing.md
2154
- '@typescript-eslint/func-call-spacing': 'off',
2155
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.md
2156
- '@typescript-eslint/no-magic-numbers': 'off',
2157
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.md
2158
- '@typescript-eslint/semi': ['error', 'always'],
2159
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md
2160
- '@typescript-eslint/prefer-regexp-exec': 'error',
2161
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-function.md
2162
- '@typescript-eslint/no-empty-function': ['error', { allow: [] }],
2163
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-floating-promises.md
2164
- '@typescript-eslint/no-floating-promises': 'off',
2165
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md
2166
- '@typescript-eslint/strict-boolean-expressions': 'off',
2167
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-readonly.md
2168
- '@typescript-eslint/prefer-readonly': 'error',
2169
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-misused-promises.md
2170
- '@typescript-eslint/no-misused-promises': [
2171
- 'error',
2172
- { checksVoidReturn: false },
2173
- ],
2174
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md
2175
- '@typescript-eslint/require-await': 'off',
2176
- // https://github.com/typescript-eslint/typescript-eslint/blob/55eb0cfac20ccbc2e954083dd554dbcfcbed64fb/packages/eslint-plugin/docs/rules/return-await.md
2177
- 'no-return-await': 'off',
2178
- '@typescript-eslint/return-await': 'error',
2179
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/typedef.md
2180
- '@typescript-eslint/typedef': [
2181
- 'error',
2182
- {
2183
- arrayDestructuring: false,
2184
- arrowParameter: false,
2185
- memberVariableDeclaration: true,
2186
- objectDestructuring: false,
2187
- parameter: false,
2188
- propertyDeclaration: true,
2189
- variableDeclaration: false,
2190
- variableDeclarationIgnoreFunction: true,
2191
- },
2192
- ],
2193
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin//docs/rules/no-unnecessary-type-arguments.md
2194
- '@typescript-eslint/no-unnecessary-type-arguments': 'error',
2195
- 'brace-style': 'off',
2196
- '@typescript-eslint/brace-style': [
2197
- 'error',
2198
- '1tbs',
2199
- { allowSingleLine: true },
2200
- ],
2201
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-dangle.md
2202
- 'comma-dangle': 'off',
2203
- '@typescript-eslint/comma-dangle': 'off',
2204
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-spacing.md
2205
- 'comma-spacing': 'off',
2206
- '@typescript-eslint/comma-spacing': [
2207
- 'error',
2208
- {
2209
- before: false,
2210
- after: true,
2211
- },
2212
- ],
2213
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md
2214
- 'dot-notation': 'off',
2215
- '@typescript-eslint/dot-notation': ['error', { allowKeywords: true }],
2216
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/keyword-spacing.md
2217
- 'keyword-spacing': 'off',
2218
- '@typescript-eslint/keyword-spacing': [
2219
- 'error',
2220
- {
2221
- before: true,
2222
- after: true,
2223
- },
2224
- ],
2225
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/lines-between-class-members.md
2226
- 'lines-between-class-members': 'off',
2227
- '@typescript-eslint/lines-between-class-members': ['error', 'always'],
2228
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dupe-class-members.md
2229
- 'no-dupe-class-members': 'off',
2230
- '@typescript-eslint/no-dupe-class-members': 'error',
2231
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-parens.md
2232
- 'no-extra-parens': 'off',
2233
- '@typescript-eslint/no-extra-parens': [
2234
- 'error',
2235
- 'all',
2236
- { ignoreJSX: 'multi-line' },
2237
- ],
2238
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-semi.md
2239
- 'no-extra-semi': 'off',
2240
- '@typescript-eslint/no-extra-semi': 'error',
2241
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md
2242
- 'no-implied-eval': 'off',
2243
- '@typescript-eslint/no-implied-eval': 'error',
2244
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loop-func.md
2245
- 'no-loop-func': 'off',
2246
- '@typescript-eslint/no-loop-func': 'error',
2247
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-redeclare.md
2248
- 'no-redeclare': 'off',
2249
- '@typescript-eslint/no-redeclare': ['error', { builtinGlobals: true }],
2250
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md
2251
- 'no-shadow': 'off',
2252
- '@typescript-eslint/no-shadow': [
2253
- 'error',
2254
- {
2255
- builtinGlobals: false,
2256
- allow: [],
2257
- },
2258
- ],
2259
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md
2260
- 'no-throw-literal': 'off',
2261
- '@typescript-eslint/no-throw-literal': 'error',
2262
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-function-paren.md
2263
- 'space-before-function-paren': 'off',
2264
- '@typescript-eslint/space-before-function-paren': [
2265
- 'error',
2266
- {
2267
- anonymous: 'always',
2268
- named: 'never',
2269
- asyncArrow: 'always',
2270
- },
2271
- ],
2272
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-infix-ops.md
2273
- 'space-infix-ops': 'off',
2274
- '@typescript-eslint/space-infix-ops': 'error',
2275
- },
2276
- },
2277
1525
  {
2278
1526
  files: ['*.test.*', '*.spec.*', '**/__test__/**'],
2279
1527
  env: {
@@ -2293,7 +1541,6 @@ module.exports = {
2293
1541
  files: ['**/pages/**/_*', '**/pages/**/index.*', '**/pages/**/\\[**'],
2294
1542
  rules: {
2295
1543
  'filenames/match-regex': 'off',
2296
- 'filenames/match-exported': 'off',
2297
1544
  },
2298
1545
  },
2299
1546
  {
@@ -2304,6 +1551,13 @@ module.exports = {
2304
1551
  files: ['**/*.md'],
2305
1552
  processor: 'markdown/markdown',
2306
1553
  },
1554
+ // ignore auto-generated css module declarations
1555
+ {
1556
+ files: ['*.css.d.ts'],
1557
+ rules: {
1558
+ 'prettier/prettier': 'off',
1559
+ },
1560
+ },
2307
1561
  ],
2308
1562
  };
2309
1563
  /* eslint-enable max-lines, no-magic-numbers */