eslint-config-heck 0.0.3 → 0.1.2
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/node.js +154 -46
- package/package.json +6 -5
package/node.js
CHANGED
|
@@ -20,7 +20,7 @@ const env = {
|
|
|
20
20
|
|
|
21
21
|
const globals = {};
|
|
22
22
|
|
|
23
|
-
const plugins = ["react"];
|
|
23
|
+
const plugins = ["react", "unicorn"];
|
|
24
24
|
const settings = {
|
|
25
25
|
react: {
|
|
26
26
|
version: "detect",
|
|
@@ -148,7 +148,7 @@ const rules = {
|
|
|
148
148
|
"no-floating-decimal": "error",
|
|
149
149
|
"no-global-assign": "error",
|
|
150
150
|
"no-implicit-coercion": "error",
|
|
151
|
-
"no-implicit-globals": "
|
|
151
|
+
"no-implicit-globals": "off",
|
|
152
152
|
"no-implied-eval": "error",
|
|
153
153
|
"no-invalid-this": "error",
|
|
154
154
|
"no-iterator": "error",
|
|
@@ -244,7 +244,7 @@ const rules = {
|
|
|
244
244
|
caughtErrors: "all",
|
|
245
245
|
},
|
|
246
246
|
],
|
|
247
|
-
"no-use-before-define": "error",
|
|
247
|
+
"no-use-before-define": ["error", "nofunc"],
|
|
248
248
|
|
|
249
249
|
// Stylistic issues
|
|
250
250
|
"array-bracket-newline": [
|
|
@@ -268,7 +268,7 @@ const rules = {
|
|
|
268
268
|
"func-call-spacing": "error",
|
|
269
269
|
"func-name-matching": "off",
|
|
270
270
|
"func-names": "off",
|
|
271
|
-
"func-style": "error",
|
|
271
|
+
"func-style": ["error", "declaration", { allowArrowFunctions: true }],
|
|
272
272
|
"function-call-argument-newline": ["error", "consistent"],
|
|
273
273
|
"function-paren-newline": ["error", "multiline-arguments"],
|
|
274
274
|
"id-denylist": "off",
|
|
@@ -292,22 +292,7 @@ const rules = {
|
|
|
292
292
|
"keyword-spacing": "error",
|
|
293
293
|
"line-comment-position": "error",
|
|
294
294
|
"linebreak-style": ["error"],
|
|
295
|
-
"lines-around-comment":
|
|
296
|
-
"error",
|
|
297
|
-
{
|
|
298
|
-
beforeBlockComment: true,
|
|
299
|
-
beforeLineComment: true,
|
|
300
|
-
allowBlockStart: true,
|
|
301
|
-
allowBlockEnd: false,
|
|
302
|
-
allowObjectStart: true,
|
|
303
|
-
allowObjectEnd: false,
|
|
304
|
-
allowArrayStart: true,
|
|
305
|
-
allowArrayEnd: false,
|
|
306
|
-
allowClassStart: true,
|
|
307
|
-
allowClassEnd: false,
|
|
308
|
-
applyDefaultIgnorePatterns: true,
|
|
309
|
-
},
|
|
310
|
-
],
|
|
295
|
+
"lines-around-comment": "off",
|
|
311
296
|
"lines-between-class-members": [
|
|
312
297
|
"error",
|
|
313
298
|
"always",
|
|
@@ -350,6 +335,7 @@ const rules = {
|
|
|
350
335
|
},
|
|
351
336
|
],
|
|
352
337
|
"no-negated-condition": "off",
|
|
338
|
+
|
|
353
339
|
"no-nested-ternary": "error",
|
|
354
340
|
"no-new-object": "error",
|
|
355
341
|
"no-plusplus": "off",
|
|
@@ -372,14 +358,7 @@ const rules = {
|
|
|
372
358
|
consistent: true,
|
|
373
359
|
},
|
|
374
360
|
],
|
|
375
|
-
"object-curly-spacing": [
|
|
376
|
-
"error",
|
|
377
|
-
"always",
|
|
378
|
-
{
|
|
379
|
-
arraysInObjects: false,
|
|
380
|
-
objectsInObjects: false,
|
|
381
|
-
},
|
|
382
|
-
],
|
|
361
|
+
"object-curly-spacing": ["error", "always"],
|
|
383
362
|
"object-property-newline": [
|
|
384
363
|
"error",
|
|
385
364
|
{
|
|
@@ -523,8 +502,8 @@ const rules = {
|
|
|
523
502
|
"react/function-component-definition": [
|
|
524
503
|
"error",
|
|
525
504
|
{
|
|
526
|
-
namedComponents: "function-
|
|
527
|
-
unnamedComponents: "function
|
|
505
|
+
namedComponents: "function-declaration",
|
|
506
|
+
unnamedComponents: "arrow-function",
|
|
528
507
|
},
|
|
529
508
|
],
|
|
530
509
|
"react/no-access-state-in-setstate": "error",
|
|
@@ -632,7 +611,7 @@ const rules = {
|
|
|
632
611
|
"react/jsx-max-depth": "off",
|
|
633
612
|
"react/jsx-max-props-per-line": "error",
|
|
634
613
|
"react/jsx-newline": "off",
|
|
635
|
-
"react/jsx-no-bind": "error",
|
|
614
|
+
"react/jsx-no-bind": ["error", { allowArrowFunctions: true }],
|
|
636
615
|
"react/jsx-no-comment-textnodes": "error",
|
|
637
616
|
"react/jsx-no-constructed-context-values": "error",
|
|
638
617
|
"react/jsx-no-duplicate-props": "error",
|
|
@@ -676,6 +655,127 @@ const rules = {
|
|
|
676
655
|
arrow: "parens-new-line",
|
|
677
656
|
},
|
|
678
657
|
],
|
|
658
|
+
|
|
659
|
+
// eslint-plugin-unicorn
|
|
660
|
+
"unicorn/better-regex": "error",
|
|
661
|
+
"unicorn/catch-error-name": [
|
|
662
|
+
"error", {
|
|
663
|
+
name: "ex",
|
|
664
|
+
ignore: ["^ex([A-Z0-9].*)?$"],
|
|
665
|
+
},
|
|
666
|
+
],
|
|
667
|
+
"unicorn/consistent-destructuring": "error",
|
|
668
|
+
"unicorn/consistent-function-scoping": [
|
|
669
|
+
"error", {
|
|
670
|
+
checkArrowFunctions: false,
|
|
671
|
+
},
|
|
672
|
+
],
|
|
673
|
+
"unicorn/custom-error-definition": "off",
|
|
674
|
+
"unicorn/empty-brace-spaces": "off",
|
|
675
|
+
"unicorn/error-message": "error",
|
|
676
|
+
"unicorn/escape-case": "error",
|
|
677
|
+
"unicorn/expiring-todo-comments": "error",
|
|
678
|
+
"unicorn/explicit-length-check": "error",
|
|
679
|
+
"unicorn/filename-case": [
|
|
680
|
+
"error", {
|
|
681
|
+
cases: {
|
|
682
|
+
camelCase: true,
|
|
683
|
+
pascalCase: true,
|
|
684
|
+
kebabCase: false,
|
|
685
|
+
snakeCase: false,
|
|
686
|
+
},
|
|
687
|
+
},
|
|
688
|
+
],
|
|
689
|
+
"unicorn/import-index": "error",
|
|
690
|
+
"unicorn/import-style": "error",
|
|
691
|
+
"unicorn/new-for-builtins": "error",
|
|
692
|
+
"unicorn/no-abusive-eslint-disable": "error",
|
|
693
|
+
"unicorn/no-array-callback-reference": "off",
|
|
694
|
+
"unicorn/no-array-for-each": "off",
|
|
695
|
+
"unicorn/no-array-method-this-argument": "error",
|
|
696
|
+
"unicorn/no-array-push-push": "error",
|
|
697
|
+
"unicorn/no-array-reduce": "off",
|
|
698
|
+
"unicorn/no-console-spaces": "error",
|
|
699
|
+
"unicorn/no-document-cookie": "error",
|
|
700
|
+
"unicorn/no-empty-file": "error",
|
|
701
|
+
"unicorn/no-for-loop": "error",
|
|
702
|
+
"unicorn/no-hex-escape": "error",
|
|
703
|
+
"unicorn/no-instanceof-array": "error",
|
|
704
|
+
"unicorn/no-invalid-remove-event-listener": "error",
|
|
705
|
+
"unicorn/no-keyword-prefix": "off",
|
|
706
|
+
"unicorn/no-lonely-if": "error",
|
|
707
|
+
"unicorn/no-nested-ternary": "off",
|
|
708
|
+
"unicorn/no-new-array": "error",
|
|
709
|
+
"unicorn/no-new-buffer": "error",
|
|
710
|
+
"unicorn/no-null": "off",
|
|
711
|
+
"unicorn/no-object-as-default-parameter": "error",
|
|
712
|
+
"unicorn/no-process-exit": "error",
|
|
713
|
+
"unicorn/no-static-only-class": "error",
|
|
714
|
+
"unicorn/no-this-assignment": "error",
|
|
715
|
+
"unicorn/no-unreadable-array-destructuring": "error",
|
|
716
|
+
"unicorn/no-unsafe-regex": "off",
|
|
717
|
+
"unicorn/no-unused-properties": "error",
|
|
718
|
+
"unicorn/no-useless-fallback-in-spread": "error",
|
|
719
|
+
"unicorn/no-useless-length-check": "error",
|
|
720
|
+
"unicorn/no-useless-spread": "error",
|
|
721
|
+
"unicorn/no-useless-undefined": "error",
|
|
722
|
+
"unicorn/no-zero-fractions": "error",
|
|
723
|
+
"unicorn/number-literal-case": "error",
|
|
724
|
+
"unicorn/numeric-separators-style": [
|
|
725
|
+
"error", {
|
|
726
|
+
number: { minimumDigits: 0, groupLength: 3 },
|
|
727
|
+
},
|
|
728
|
+
],
|
|
729
|
+
"unicorn/prefer-add-event-listener": "error",
|
|
730
|
+
"unicorn/prefer-array-find": "error",
|
|
731
|
+
"unicorn/prefer-array-flat": "error",
|
|
732
|
+
"unicorn/prefer-array-flat-map": "error",
|
|
733
|
+
"unicorn/prefer-array-index-of": "error",
|
|
734
|
+
"unicorn/prefer-array-some": "error",
|
|
735
|
+
"unicorn/prefer-at": "error",
|
|
736
|
+
"unicorn/prefer-date-now": "error",
|
|
737
|
+
"unicorn/prefer-default-parameters": "error",
|
|
738
|
+
"unicorn/prefer-dom-node-append": "error",
|
|
739
|
+
"unicorn/prefer-dom-node-dataset": "error",
|
|
740
|
+
"unicorn/prefer-dom-node-remove": "error",
|
|
741
|
+
"unicorn/prefer-dom-node-text-content": "error",
|
|
742
|
+
"unicorn/prefer-export-from": "off",
|
|
743
|
+
"unicorn/prefer-includes": "error",
|
|
744
|
+
"unicorn/prefer-keyboard-event-key": "error",
|
|
745
|
+
"unicorn/prefer-math-trunc": "error",
|
|
746
|
+
"unicorn/prefer-modern-dom-apis": "error",
|
|
747
|
+
"unicorn/prefer-module": "off",
|
|
748
|
+
"unicorn/prefer-negative-index": "error",
|
|
749
|
+
"unicorn/prefer-node-protocol": "error",
|
|
750
|
+
"unicorn/prefer-number-properties": "error",
|
|
751
|
+
"unicorn/prefer-object-from-entries": "error",
|
|
752
|
+
"unicorn/prefer-object-has-own": "error",
|
|
753
|
+
"unicorn/prefer-optional-catch-binding": "error",
|
|
754
|
+
"unicorn/prefer-prototype-methods": "error",
|
|
755
|
+
"unicorn/prefer-query-selector": "off",
|
|
756
|
+
"unicorn/prefer-reflect-apply": "error",
|
|
757
|
+
"unicorn/prefer-regexp-test": "error",
|
|
758
|
+
"unicorn/prefer-set-has": "error",
|
|
759
|
+
"unicorn/prefer-spread": "error",
|
|
760
|
+
|
|
761
|
+
// TODO: only available in Node.js 15+, so enable it later
|
|
762
|
+
"unicorn/prefer-string-replace-all": "off",
|
|
763
|
+
"unicorn/prefer-string-slice": "error",
|
|
764
|
+
"unicorn/prefer-string-starts-ends-with": "error",
|
|
765
|
+
"unicorn/prefer-string-trim-start-end": "error",
|
|
766
|
+
"unicorn/prefer-switch": "error",
|
|
767
|
+
|
|
768
|
+
// TODO: off until there is a solution to this: https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1079
|
|
769
|
+
"unicorn/prefer-ternary": "off",
|
|
770
|
+
"unicorn/prefer-top-level-await": "off",
|
|
771
|
+
"unicorn/prefer-type-error": "error",
|
|
772
|
+
"unicorn/prevent-abbreviations": "off",
|
|
773
|
+
"unicorn/require-array-join-separator": "error",
|
|
774
|
+
"unicorn/require-number-to-fixed-digits-argument": "error",
|
|
775
|
+
"unicorn/require-post-message-target-origin": "error",
|
|
776
|
+
"unicorn/string-content": "off",
|
|
777
|
+
"unicorn/template-indent": "off",
|
|
778
|
+
"unicorn/throw-new-error": "error",
|
|
679
779
|
};
|
|
680
780
|
|
|
681
781
|
const overrides = [
|
|
@@ -716,7 +816,7 @@ const overrides = [
|
|
|
716
816
|
"@typescript-eslint/class-literal-property-style": "error",
|
|
717
817
|
"@typescript-eslint/consistent-indexed-object-style": "error",
|
|
718
818
|
"@typescript-eslint/consistent-type-assertions": "error",
|
|
719
|
-
"@typescript-eslint/consistent-type-definitions": "
|
|
819
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
|
|
720
820
|
"@typescript-eslint/consistent-type-imports": [
|
|
721
821
|
"error",
|
|
722
822
|
{
|
|
@@ -761,6 +861,12 @@ const overrides = [
|
|
|
761
861
|
regex: "^__html$", match: false,
|
|
762
862
|
},
|
|
763
863
|
},
|
|
864
|
+
{
|
|
865
|
+
selector: ["parameter"],
|
|
866
|
+
modifiers: ["unused"],
|
|
867
|
+
format: ["strictCamelCase"],
|
|
868
|
+
leadingUnderscore: "require",
|
|
869
|
+
},
|
|
764
870
|
{
|
|
765
871
|
selector: ["typeLike"],
|
|
766
872
|
format: ["StrictPascalCase"],
|
|
@@ -960,12 +1066,7 @@ const overrides = [
|
|
|
960
1066
|
"no-useless-constructor": "off",
|
|
961
1067
|
"@typescript-eslint/no-useless-constructor": "error",
|
|
962
1068
|
"object-curly-spacing": "off",
|
|
963
|
-
"@typescript-eslint/object-curly-spacing": [
|
|
964
|
-
"error", "always", {
|
|
965
|
-
arraysInObjects: false,
|
|
966
|
-
objectsInObjects: false,
|
|
967
|
-
},
|
|
968
|
-
],
|
|
1069
|
+
"@typescript-eslint/object-curly-spacing": ["error", "always"],
|
|
969
1070
|
"padding-line-between-statements": "off",
|
|
970
1071
|
"@typescript-eslint/padding-line-between-statements": [
|
|
971
1072
|
"error",
|
|
@@ -1034,12 +1135,12 @@ const overrides = [
|
|
|
1034
1135
|
rules: {
|
|
1035
1136
|
// eslint-plugin-jest
|
|
1036
1137
|
"jest/consistent-test-it": "error",
|
|
1037
|
-
"jest/expect-expect":
|
|
1038
|
-
"jest/lowercase-name": [
|
|
1138
|
+
"jest/expect-expect": [
|
|
1039
1139
|
"error", {
|
|
1040
|
-
|
|
1140
|
+
assertFunctionNames: ["expect*"],
|
|
1041
1141
|
},
|
|
1042
1142
|
],
|
|
1143
|
+
"jest/max-nested-describe": "off",
|
|
1043
1144
|
"jest/no-alias-methods": "error",
|
|
1044
1145
|
"jest/no-commented-out-tests": "error",
|
|
1045
1146
|
"jest/no-conditional-expect": "error",
|
|
@@ -1047,6 +1148,7 @@ const overrides = [
|
|
|
1047
1148
|
"jest/no-disabled-tests": "warn",
|
|
1048
1149
|
"jest/no-done-callback": "error",
|
|
1049
1150
|
"jest/no-duplicate-hooks": "error",
|
|
1151
|
+
"jest/no-export": "error",
|
|
1050
1152
|
"jest/no-focused-tests": "warn",
|
|
1051
1153
|
"jest/no-hooks": "off",
|
|
1052
1154
|
"jest/no-identical-title": "error",
|
|
@@ -1062,22 +1164,28 @@ const overrides = [
|
|
|
1062
1164
|
"jest/no-test-return-statement": "error",
|
|
1063
1165
|
"jest/prefer-called-with": "error",
|
|
1064
1166
|
"jest/prefer-expect-assertions": "off",
|
|
1167
|
+
"jest/prefer-expect-resolves": "error",
|
|
1065
1168
|
"jest/prefer-hooks-on-top": "error",
|
|
1169
|
+
"jest/prefer-lowercase-title": [
|
|
1170
|
+
"error", {
|
|
1171
|
+
ignore: ["describe"],
|
|
1172
|
+
},
|
|
1173
|
+
],
|
|
1066
1174
|
"jest/prefer-spy-on": "error",
|
|
1067
1175
|
"jest/prefer-strict-equal": "error",
|
|
1068
|
-
"jest/prefer-to-be
|
|
1069
|
-
"jest/prefer-to-be-undefined": "error",
|
|
1176
|
+
"jest/prefer-to-be": "error",
|
|
1070
1177
|
"jest/prefer-to-contain": "error",
|
|
1071
1178
|
"jest/prefer-to-have-length": "error",
|
|
1072
1179
|
"jest/prefer-todo": "warn",
|
|
1180
|
+
"jest/require-hook": "error",
|
|
1073
1181
|
"jest/require-to-throw-message": "error",
|
|
1074
1182
|
"jest/require-top-level-describe": "error",
|
|
1075
|
-
"
|
|
1076
|
-
"jest/unbound-method": "error",
|
|
1077
|
-
"jest/valid-describe": "error",
|
|
1183
|
+
"jest/valid-describe-callback": "error",
|
|
1078
1184
|
"jest/valid-expect": "error",
|
|
1079
1185
|
"jest/valid-expect-in-promise": "error",
|
|
1080
1186
|
"jest/valid-title": "error",
|
|
1187
|
+
"@typescript-eslint/unbound-method": "off",
|
|
1188
|
+
"jest/unbound-method": "error",
|
|
1081
1189
|
},
|
|
1082
1190
|
},
|
|
1083
1191
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-heck",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Contains an ESLint configuration for ES2015+, TypeScript, and React.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,18 +15,19 @@
|
|
|
15
15
|
"author": "atheck",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
19
|
-
"@typescript-eslint/parser": "5.
|
|
18
|
+
"@typescript-eslint/eslint-plugin": "5.4.0",
|
|
19
|
+
"@typescript-eslint/parser": "5.4.0",
|
|
20
20
|
"eslint": "8.2.0",
|
|
21
21
|
"eslint-plugin-deprecation": "1.2.1",
|
|
22
22
|
"eslint-plugin-jest": "25.2.4",
|
|
23
23
|
"eslint-plugin-react": "7.27.0",
|
|
24
|
+
"eslint-plugin-unicorn": "38.0.1",
|
|
24
25
|
"react": "17.0.2",
|
|
25
|
-
"typescript": "4.
|
|
26
|
+
"typescript": "4.5.2"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
29
|
"@types/jest": "27.0.2",
|
|
29
|
-
"@types/react": "17.0.
|
|
30
|
+
"@types/react": "17.0.35",
|
|
30
31
|
"jest": "27.3.1"
|
|
31
32
|
}
|
|
32
33
|
}
|