@robinblomberg/eslint-config-robinblomberg 0.13.0 → 0.15.0-beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +102 -94
  2. package/package.json +17 -17
package/index.js CHANGED
@@ -26,12 +26,7 @@ module.exports = {
26
26
  plugins: ['@typescript-eslint'],
27
27
  rules: {
28
28
  '@typescript-eslint/adjacent-overload-signatures': warn,
29
- '@typescript-eslint/array-type': [
30
- warn,
31
- {
32
- default: 'array',
33
- },
34
- ],
29
+ '@typescript-eslint/array-type': [warn, { default: 'array' }],
35
30
  '@typescript-eslint/await-thenable': warn,
36
31
  '@typescript-eslint/ban-ts-comment': warn,
37
32
  '@typescript-eslint/ban-tslint-comment': warn,
@@ -75,15 +70,11 @@ module.exports = {
75
70
  '@typescript-eslint/dot-notation': warn,
76
71
  '@typescript-eslint/explicit-function-return-type': [
77
72
  off,
78
- {
79
- allowTypedFunctionExpressions: true,
80
- },
73
+ { allowTypedFunctionExpressions: true },
81
74
  ],
82
75
  '@typescript-eslint/explicit-member-accessibility': [
83
76
  warn,
84
- {
85
- accessibility: 'no-public',
86
- },
77
+ { accessibility: 'no-public' },
87
78
  ],
88
79
  '@typescript-eslint/explicit-module-boundary-types': off,
89
80
  '@typescript-eslint/func-call-spacing': warn,
@@ -178,7 +169,7 @@ module.exports = {
178
169
  ],
179
170
  },
180
171
  ],
181
- '@typescript-eslint/method-signature-style': [warn, 'method'],
172
+ '@typescript-eslint/method-signature-style': [warn, 'property'],
182
173
  '@typescript-eslint/naming-convention': [
183
174
  off,
184
175
  {
@@ -225,7 +216,7 @@ module.exports = {
225
216
  ],
226
217
  '@typescript-eslint/no-array-constructor': warn,
227
218
  '@typescript-eslint/no-base-to-string': warn,
228
- '@typescript-eslint/no-confusing-non-null-assertion': warn,
219
+ '@typescript-eslint/no-confusing-non-null-assertion': off,
229
220
  '@typescript-eslint/no-dupe-class-members': warn,
230
221
  '@typescript-eslint/no-dynamic-delete': off,
231
222
  '@typescript-eslint/no-empty-function': off,
@@ -268,16 +259,11 @@ module.exports = {
268
259
  ],
269
260
  '@typescript-eslint/no-misused-new': warn,
270
261
  '@typescript-eslint/no-misused-promises': off,
271
- '@typescript-eslint/no-namespace': [
272
- off,
273
- {
274
- allowDeclarations: true,
275
- },
276
- ],
262
+ '@typescript-eslint/no-namespace': [off, { allowDeclarations: true }],
277
263
  '@typescript-eslint/no-non-null-asserted-optional-chain': warn,
278
264
  '@typescript-eslint/no-non-null-assertion': off,
279
265
  '@typescript-eslint/no-parameter-properties': off,
280
- '@typescript-eslint/no-redeclare': warn,
266
+ '@typescript-eslint/no-redeclare': off,
281
267
  '@typescript-eslint/no-require-imports': warn,
282
268
  '@typescript-eslint/no-shadow': warn,
283
269
  '@typescript-eslint/no-this-alias': warn,
@@ -326,7 +312,8 @@ module.exports = {
326
312
  '@typescript-eslint/prefer-includes': warn,
327
313
  '@typescript-eslint/prefer-literal-enum-member': warn,
328
314
  '@typescript-eslint/prefer-namespace-keyword': warn,
329
- '@typescript-eslint/prefer-nullish-coalescing': warn,
315
+ // Warns about correct uses of `||`:
316
+ '@typescript-eslint/prefer-nullish-coalescing': off,
330
317
  '@typescript-eslint/prefer-optional-chain': warn,
331
318
  '@typescript-eslint/prefer-readonly': warn,
332
319
  // Disabled due to error:
@@ -340,12 +327,16 @@ module.exports = {
340
327
  '@typescript-eslint/quotes': [warn, 'single'],
341
328
  '@typescript-eslint/require-array-sort-compare': [
342
329
  warn,
330
+ { ignoreStringArrays: true },
331
+ ],
332
+ '@typescript-eslint/require-await': warn,
333
+ '@typescript-eslint/restrict-plus-operands': [
334
+ error,
343
335
  {
344
- ignoreStringArrays: true,
336
+ allowAny: false,
337
+ checkCompoundAssignments: true,
345
338
  },
346
339
  ],
347
- '@typescript-eslint/require-await': warn,
348
- '@typescript-eslint/restrict-plus-operands': warn,
349
340
  // Disabled due to false positives:
350
341
  '@typescript-eslint/restrict-template-expressions': off,
351
342
  '@typescript-eslint/return-await': [warn, 'always'],
@@ -360,15 +351,15 @@ module.exports = {
360
351
  '@typescript-eslint/unified-signatures': warn,
361
352
  'default-case': off,
362
353
  'func-call-spacing': off,
354
+ 'import/exports-last': off,
363
355
  'import/extensions': off,
356
+ 'import/no-internal-modules': [
357
+ warn,
358
+ { allow: ['[@a-z][@a-z]***', '**/*.svg'] },
359
+ ],
364
360
  'import/no-unassigned-import': off,
365
361
  // Disabled due to false positives:
366
- 'import/no-unresolved': [
367
- off,
368
- {
369
- ignore: ['\\.types$'],
370
- },
371
- ],
362
+ 'import/no-unresolved': [off, { ignore: ['\\.types$'] }],
372
363
  indent: off,
373
364
  'init-declarations': off,
374
365
  'jsdoc/check-examples': off,
@@ -555,20 +546,12 @@ module.exports = {
555
546
  'react/jsx-equals-spacing': warn,
556
547
  'react/jsx-filename-extension': [
557
548
  warn,
558
- {
559
- extensions: ['.jsx', '.tsx'],
560
- },
549
+ { extensions: ['.jsx', '.tsx'] },
561
550
  ],
562
551
  'react/jsx-first-prop-new-line': warn,
563
552
  'react/jsx-fragments': warn,
564
553
  'react/jsx-handler-names': warn,
565
- 'react/jsx-indent': [
566
- warn,
567
- 2,
568
- {
569
- indentLogicalExpressions: true,
570
- },
571
- ],
554
+ 'react/jsx-indent': [warn, 2, { indentLogicalExpressions: true }],
572
555
  'react/jsx-indent-props': [warn, 2],
573
556
  'react/jsx-key': warn,
574
557
  'react/jsx-max-depth': off,
@@ -805,7 +788,7 @@ module.exports = {
805
788
  'import/default': warn,
806
789
  'import/dynamic-import-chunkname': off,
807
790
  'import/export': warn,
808
- 'import/exports-last': warn,
791
+ 'import/exports-last': off,
809
792
  'import/extensions': [
810
793
  warn,
811
794
  {
@@ -832,12 +815,6 @@ module.exports = {
832
815
  'import/no-duplicates': warn,
833
816
  'import/no-dynamic-require': warn,
834
817
  'import/no-extraneous-dependencies': warn,
835
- 'import/no-internal-modules': [
836
- warn,
837
- {
838
- allow: ['[@a-z][@a-z]*/**', '**/*.svg'],
839
- },
840
- ],
841
818
  'import/no-mutable-exports': warn,
842
819
  'import/no-named-as-default': warn,
843
820
  'import/no-named-as-default-member': warn,
@@ -873,34 +850,18 @@ module.exports = {
873
850
  }], */
874
851
  'import/prefer-default-export': off,
875
852
  'import/unambiguous': off,
876
- indent: [
877
- warn,
878
- 2,
879
- {
880
- SwitchCase: 1,
881
- },
882
- ],
853
+ indent: [warn, 2, { SwitchCase: 1 }],
883
854
  'init-declarations': off,
884
855
  'jsdoc/check-access': warn,
885
856
  'jsdoc/check-alignment': warn,
886
857
  'jsdoc/check-examples': off,
887
- 'jsdoc/check-indentation': [
888
- off,
889
- {
890
- excludeTags: ['example'],
891
- },
892
- ],
858
+ 'jsdoc/check-indentation': [off, { excludeTags: ['example'] }],
893
859
  'jsdoc/check-line-alignment': warn,
894
860
  'jsdoc/check-param-names': warn,
895
861
  'jsdoc/check-property-names': warn,
896
862
  'jsdoc/check-syntax': warn,
897
863
  'jsdoc/check-tag-names': warn,
898
- 'jsdoc/check-types': [
899
- warn,
900
- {
901
- noDefaults: true,
902
- },
903
- ],
864
+ 'jsdoc/check-types': [warn, { noDefaults: true }],
904
865
  'jsdoc/check-values': warn,
905
866
  'jsdoc/empty-tags': warn,
906
867
  'jsdoc/implements-on-classes': warn,
@@ -1024,12 +985,7 @@ module.exports = {
1024
985
  ],
1025
986
  'jsdoc/require-param-description': off,
1026
987
  'jsdoc/require-param-name': warn,
1027
- 'jsdoc/require-param-type': [
1028
- warn,
1029
- {
1030
- contexts: ['any'],
1031
- },
1032
- ],
988
+ 'jsdoc/require-param-type': [warn, { contexts: ['any'] }],
1033
989
  'jsdoc/require-property': warn,
1034
990
  'jsdoc/require-property-description': warn,
1035
991
  'jsdoc/require-property-name': warn,
@@ -1082,11 +1038,11 @@ module.exports = {
1082
1038
  'no-class-assign': warn,
1083
1039
  'no-compare-neg-zero': warn,
1084
1040
  'no-cond-assign': warn,
1085
- 'no-confusing-arrow': warn,
1041
+ 'no-confusing-arrow': off,
1086
1042
  'no-console': [off, { allow: ['debug', 'error', 'info', 'warn'] }],
1087
1043
  'no-const-assign': warn,
1088
1044
  'no-constant-condition': [warn, { checkLoops: false }],
1089
- 'no-continue': warn,
1045
+ 'no-continue': off,
1090
1046
  'no-control-regex': off,
1091
1047
  'no-debugger': warn,
1092
1048
  'no-delete-var': warn,
@@ -1097,7 +1053,7 @@ module.exports = {
1097
1053
  'no-duplicate-case': warn,
1098
1054
  'no-duplicate-imports': warn,
1099
1055
  'no-else-return': warn,
1100
- 'no-empty': [warn, { allowEmptyCatch: true }],
1056
+ 'no-empty': [off, { allowEmptyCatch: true }],
1101
1057
  'no-empty-character-class': warn,
1102
1058
  'no-empty-function': off,
1103
1059
  'no-empty-pattern': off,
@@ -1114,12 +1070,7 @@ module.exports = {
1114
1070
  'no-floating-decimal': warn,
1115
1071
  'no-func-assign': warn,
1116
1072
  'no-global-assign': warn,
1117
- 'no-implicit-coercion': [
1118
- warn,
1119
- {
1120
- boolean: false,
1121
- },
1122
- ],
1073
+ 'no-implicit-coercion': [warn, { boolean: false }],
1123
1074
  'no-implicit-globals': warn,
1124
1075
  'no-implied-eval': warn,
1125
1076
  'no-inline-comments': off,
@@ -1136,9 +1087,7 @@ module.exports = {
1136
1087
  'no-loss-of-precision': warn,
1137
1088
  'no-magic-numbers': [
1138
1089
  off,
1139
- {
1140
- ignore: [-1, 0, 1, 2, 3, '-1n', '0n', '1n', '2n', '3n'],
1141
- },
1090
+ { ignore: [-1, 0, 1, 2, 3, '-1n', '0n', '1n', '2n', '3n'] },
1142
1091
  ],
1143
1092
  'no-misleading-character-class': warn,
1144
1093
  'no-mixed-operators': [
@@ -1160,7 +1109,7 @@ module.exports = {
1160
1109
  'no-multiple-empty-lines': [warn, { max: 1, maxEOF: 0 }],
1161
1110
  'no-negated-condition': warn,
1162
1111
  'no-negated-in-lhs': warn,
1163
- 'no-nested-ternary': warn,
1112
+ 'no-nested-ternary': off,
1164
1113
  'no-new': warn,
1165
1114
  'no-new-func': warn,
1166
1115
  'no-new-object': warn,
@@ -1179,7 +1128,71 @@ module.exports = {
1179
1128
  'no-prototype-builtins': warn,
1180
1129
  'no-redeclare': [warn, { builtinGlobals: false }],
1181
1130
  'no-regex-spaces': warn,
1182
- 'no-restricted-globals': warn,
1131
+ 'no-restricted-globals': [
1132
+ error,
1133
+ 'isNaN',
1134
+ /*
1135
+ * https://github.com/sidoshi/eslint-restricted-globals/blob/master/index.js
1136
+ */
1137
+ 'addEventListener',
1138
+ 'blur',
1139
+ 'close',
1140
+ 'closed',
1141
+ 'confirm',
1142
+ 'defaultStatus',
1143
+ 'event',
1144
+ 'external',
1145
+ 'defaultstatus',
1146
+ 'find',
1147
+ 'focus',
1148
+ 'frameElement',
1149
+ 'frames',
1150
+ 'history',
1151
+ 'innerHeight',
1152
+ 'innerWidth',
1153
+ 'length',
1154
+ 'location',
1155
+ 'locationbar',
1156
+ 'menubar',
1157
+ 'moveBy',
1158
+ 'moveTo',
1159
+ 'name',
1160
+ 'onblur',
1161
+ 'onerror',
1162
+ 'onfocus',
1163
+ 'onload',
1164
+ 'onresize',
1165
+ 'onunload',
1166
+ 'open',
1167
+ 'opener',
1168
+ 'opera',
1169
+ 'outerHeight',
1170
+ 'outerWidth',
1171
+ 'pageXOffset',
1172
+ 'pageYOffset',
1173
+ 'parent',
1174
+ 'print',
1175
+ 'removeEventListener',
1176
+ 'resizeBy',
1177
+ 'resizeTo',
1178
+ 'screen',
1179
+ 'screenLeft',
1180
+ 'screenTop',
1181
+ 'screenX',
1182
+ 'screenY',
1183
+ 'scroll',
1184
+ 'scrollbars',
1185
+ 'scrollBy',
1186
+ 'scrollTo',
1187
+ 'scrollX',
1188
+ 'scrollY',
1189
+ 'self',
1190
+ 'status',
1191
+ 'statusbar',
1192
+ 'stop',
1193
+ 'toolbar',
1194
+ 'top',
1195
+ ],
1183
1196
  'no-restricted-imports': warn,
1184
1197
  'no-restricted-modules': warn,
1185
1198
  'no-restricted-properties': warn,
@@ -1200,7 +1213,7 @@ module.exports = {
1200
1213
  'no-sparse-arrays': warn,
1201
1214
  'no-sync': off,
1202
1215
  'no-tabs': warn,
1203
- 'no-template-curly-in-string': warn,
1216
+ 'no-template-curly-in-string': off,
1204
1217
  'no-ternary': off,
1205
1218
  'no-this-before-super': warn,
1206
1219
  'no-throw-literal': warn,
@@ -1257,12 +1270,7 @@ module.exports = {
1257
1270
  'nonblock-statement-body-position': warn,
1258
1271
  'object-curly-newline': [warn, { consistent: true, multiline: true }],
1259
1272
  'object-curly-spacing': [warn, 'always'],
1260
- 'object-property-newline': [
1261
- warn,
1262
- {
1263
- allowMultiplePropertiesPerLine: true,
1264
- },
1265
- ],
1273
+ 'object-property-newline': [warn, { allowMultiplePropertiesPerLine: true }],
1266
1274
  'object-shorthand': [warn, 'always'],
1267
1275
  'one-var': [warn, 'never'],
1268
1276
  'one-var-declaration-per-line': warn,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinblomberg/eslint-config-robinblomberg",
3
- "version": "0.13.0",
3
+ "version": "0.15.0-beta1",
4
4
  "author": "Robin Blomberg",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -11,25 +11,25 @@
11
11
  "url": "https://github.com/RobinBlomberg/eslint-config/issues"
12
12
  },
13
13
  "homepage": "https://github.com/RobinBlomberg/eslint-config#readme",
14
- "scripts": {
15
- "lint": "eslint **/*.{js,ts}",
16
- "lint:fix": "eslint **/*.{js,ts} --fix"
17
- },
18
14
  "dependencies": {
19
- "@babel/core": "^7.20.5",
20
- "@babel/eslint-parser": "^7.19.1",
21
- "@typescript-eslint/eslint-plugin": "^5.46.1",
22
- "@typescript-eslint/parser": "^5.46.1",
23
- "eslint": "^8.29.0",
24
- "eslint-plugin-import": "^2.26.0",
25
- "eslint-plugin-jsdoc": "^39.6.4",
26
- "eslint-plugin-jsx-a11y": "^6.6.1",
27
- "eslint-plugin-react": "^7.31.11",
15
+ "@babel/core": "^7.22.5",
16
+ "@babel/eslint-parser": "^7.22.5",
17
+ "@typescript-eslint/eslint-plugin": "^5.60.0",
18
+ "@typescript-eslint/parser": "^5.60.0",
19
+ "eslint": "^8.43.0",
20
+ "eslint-plugin-import": "^2.27.5",
21
+ "eslint-plugin-jsdoc": "^46.2.6",
22
+ "eslint-plugin-jsx-a11y": "^6.7.1",
23
+ "eslint-plugin-react": "^7.32.2",
28
24
  "eslint-plugin-sort-keys": "^2.3.5",
29
- "typescript": "^4.9.4"
25
+ "typescript": "^5.1.3"
30
26
  },
31
27
  "devDependencies": {
32
- "@robinblomberg/eslint-config-robinblomberg": "0.13.0-beta1",
28
+ "@robinblomberg/eslint-config-robinblomberg": "0.14.0",
33
29
  "@types/node": "*"
30
+ },
31
+ "scripts": {
32
+ "lint": "eslint **/*.{js,ts}",
33
+ "lint:fix": "eslint **/*.{js,ts} --fix"
34
34
  }
35
- }
35
+ }