@component-hook/eslint-plugin 0.1.5 → 0.1.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.
package/README.md CHANGED
@@ -79,21 +79,21 @@ export default vuePreset;
79
79
 
80
80
  ## Configs
81
81
 
82
- | Name | Type | Reference |
83
- | ----------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------- |
84
- | basic | `Linter.Config[]` | `eslint-recommended`, `typescript-eslint`, `eslint-plugin-eslint-comments`, `eslint-plugin-import`, `eslint-plugin-regexp` |
85
- | vue | `Linter.Config[]` | `eslint-plugin-vue`, `typescript-eslint` |
86
- | react | `Linter.Config[]` | `eslint-plugin-react/recommended`, `eslint-plugin-react-hooks/recommended`, `eslint-plugin-jsx-a11y/recommended` |
87
- | markdown | `Linter.Config[]` | `eslint-plugin-markdown/recommended` |
88
- | prettier | `Linter.Config` | `eslint-plugin-prettier/recommended`, `eslint-config-prettier` |
89
- | sonarjs | `Linter.Config[]` | `eslint-plugin-sonarjs/recommended` |
90
- | security | `Linter.Config` | `eslint-plugin-security/recommended` |
91
- | playwright | `Linter.Config` | `eslint-plugin-playwright/flat/recommended` |
92
- | testing-library/dom | `Linter.Config` | `eslint-plugin-testing-library/dom` |
93
- | testing-library/vue | `Linter.Config` | `eslint-plugin-testing-library/vue` |
94
- | testing-library/react | `Linter.Config` | `eslint-plugin-testing-library/react` |
95
- | testing-library/angular | `Linter.Config` | `eslint-plugin-testing-library/angular` |
96
- | testing-library/marko | `Linter.Config` | `eslint-plugin-testing-library/marko` |
82
+ | Name | Type | Reference |
83
+ | ----------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
84
+ | basic | `Linter.Config[]` | `eslint-recommended`, `typescript-eslint`, `eslint-plugin-eslint-comments`, `eslint-plugin-import`, `eslint-plugin-unicorn`, `eslint-plugin-regexp` |
85
+ | vue | `Linter.Config[]` | `eslint-plugin-vue`, `typescript-eslint` |
86
+ | react | `Linter.Config[]` | `eslint-plugin-react/recommended`, `eslint-plugin-react-hooks/recommended`, `eslint-plugin-jsx-a11y/recommended` |
87
+ | markdown | `Linter.Config[]` | `eslint-plugin-markdown/recommended` |
88
+ | prettier | `Linter.Config` | `eslint-plugin-prettier/recommended`, `eslint-config-prettier` |
89
+ | sonarjs | `Linter.Config[]` | `eslint-plugin-sonarjs/recommended` |
90
+ | security | `Linter.Config` | `eslint-plugin-security/recommended` |
91
+ | playwright | `Linter.Config` | `eslint-plugin-playwright/flat/recommended` |
92
+ | testing-library/dom | `Linter.Config` | `eslint-plugin-testing-library/dom` |
93
+ | testing-library/vue | `Linter.Config` | `eslint-plugin-testing-library/vue` |
94
+ | testing-library/react | `Linter.Config` | `eslint-plugin-testing-library/react` |
95
+ | testing-library/angular | `Linter.Config` | `eslint-plugin-testing-library/angular` |
96
+ | testing-library/marko | `Linter.Config` | `eslint-plugin-testing-library/marko` |
97
97
 
98
98
  ## Reference eslint plugin
99
99
 
@@ -101,6 +101,7 @@ export default vuePreset;
101
101
  - [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint)
102
102
  - [eslint-plugin-eslint-comments](https://github.com/eslint-community/eslint-plugin-eslint-comments/blob/main/lib/configs/recommended.js)
103
103
  - [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import)
104
+ - [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
104
105
  - [eslint-plugin-regexp/flat/recommended](https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/lib/configs/flat/recommended.ts)
105
106
  - [eslint-plugin-prettier/recommended](https://github.com/prettier/eslint-plugin-prettier/blob/master/recommended.js)
106
107
  - [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier/blob/main/index.js)
package/dist/index.d.ts CHANGED
@@ -18,6 +18,86 @@ declare const _default: {
18
18
  eqeqeq: string;
19
19
  };
20
20
  } | eslint.Linter.Config<eslint.Linter.RulesRecord> | {
21
+ name: string;
22
+ plugins: {
23
+ unicorn: eslint.ESLint.Plugin & {
24
+ configs: {
25
+ recommended: eslint.Linter.Config;
26
+ all: eslint.Linter.Config;
27
+ "flat/all": eslint.Linter.FlatConfig;
28
+ "flat/recommended": eslint.Linter.FlatConfig;
29
+ };
30
+ };
31
+ };
32
+ rules: {
33
+ 'unicorn/catch-error-name': string;
34
+ 'unicorn/consistent-empty-array-spread': string;
35
+ 'unicorn/consistent-existence-index-check': string;
36
+ 'unicorn/consistent-function-scoping': (string | {
37
+ checkArrowFunctions: boolean;
38
+ })[];
39
+ 'unicorn/custom-error-definition': string;
40
+ 'unicorn/error-message': string;
41
+ 'unicorn/escape-case': string;
42
+ 'unicorn/filename-case': (string | {
43
+ cases: {
44
+ kebabCase: boolean;
45
+ pascalCase: boolean;
46
+ };
47
+ ignore: RegExp[];
48
+ })[];
49
+ 'unicorn/new-for-builtins': string;
50
+ 'unicorn/no-array-method-this-argument': string;
51
+ 'unicorn/no-array-push-push': string;
52
+ 'unicorn/no-await-in-promise-methods': string;
53
+ 'unicorn/no-console-spaces': string;
54
+ 'unicorn/no-for-loop': string;
55
+ 'unicorn/no-hex-escape': string;
56
+ 'unicorn/no-instanceof-array': string;
57
+ 'unicorn/no-invalid-remove-event-listener': string;
58
+ 'unicorn/no-lonely-if': string;
59
+ 'unicorn/no-negation-in-equality-check': string;
60
+ 'unicorn/no-new-array': string;
61
+ 'unicorn/no-new-buffer': string;
62
+ 'unicorn/no-single-promise-in-promise-methods': string;
63
+ 'unicorn/no-static-only-class': string;
64
+ 'unicorn/no-unnecessary-await': string;
65
+ 'unicorn/no-zero-fractions': string;
66
+ 'unicorn/prefer-add-event-listener': string;
67
+ 'unicorn/prefer-array-find': string;
68
+ 'unicorn/prefer-array-flat-map': string;
69
+ 'unicorn/prefer-array-index-of': string;
70
+ 'unicorn/prefer-array-some': string;
71
+ 'unicorn/prefer-at': string;
72
+ 'unicorn/prefer-blob-reading-methods': string;
73
+ 'unicorn/prefer-date-now': string;
74
+ 'unicorn/prefer-dom-node-append': string;
75
+ 'unicorn/prefer-dom-node-dataset': string;
76
+ 'unicorn/prefer-dom-node-remove': string;
77
+ 'unicorn/prefer-dom-node-text-content': string;
78
+ 'unicorn/prefer-includes': string;
79
+ 'unicorn/prefer-keyboard-event-key': string;
80
+ 'unicorn/prefer-math-min-max': string;
81
+ 'unicorn/prefer-math-trunc': string;
82
+ 'unicorn/prefer-modern-dom-apis': string;
83
+ 'unicorn/prefer-modern-math-apis': string;
84
+ 'unicorn/prefer-negative-index': string;
85
+ 'unicorn/prefer-node-protocol': string;
86
+ 'unicorn/prefer-number-properties': string;
87
+ 'unicorn/prefer-optional-catch-binding': string;
88
+ 'unicorn/prefer-prototype-methods': string;
89
+ 'unicorn/prefer-query-selector': string;
90
+ 'unicorn/prefer-reflect-apply': string;
91
+ 'unicorn/prefer-regexp-test': string;
92
+ 'unicorn/prefer-string-raw': string;
93
+ 'unicorn/prefer-string-replace-all': string;
94
+ 'unicorn/prefer-string-slice': string;
95
+ 'unicorn/prefer-string-starts-ends-with': string;
96
+ 'unicorn/prefer-string-trim-start-end': string;
97
+ 'unicorn/prefer-type-error': string;
98
+ 'unicorn/throw-new-error': string;
99
+ };
100
+ } | {
21
101
  name: string;
22
102
  ignores: string[];
23
103
  } | {
@@ -1208,7 +1288,9 @@ declare const _default: {
1208
1288
  "prefer-equality-matcher": eslint.Rule.RuleModule;
1209
1289
  "prefer-hooks-in-order": eslint.Rule.RuleModule;
1210
1290
  "prefer-hooks-on-top": eslint.Rule.RuleModule;
1291
+ "prefer-locator": eslint.Rule.RuleModule;
1211
1292
  "prefer-lowercase-title": eslint.Rule.RuleModule;
1293
+ "prefer-native-locators": eslint.Rule.RuleModule;
1212
1294
  "prefer-strict-equal": eslint.Rule.RuleModule;
1213
1295
  "prefer-to-be": eslint.Rule.RuleModule;
1214
1296
  "prefer-to-contain": eslint.Rule.RuleModule;
@@ -1278,6 +1360,86 @@ declare const reactPreset: ({
1278
1360
  eqeqeq: string;
1279
1361
  };
1280
1362
  } | eslint.Linter.Config<eslint.Linter.RulesRecord> | {
1363
+ name: string;
1364
+ plugins: {
1365
+ unicorn: eslint.ESLint.Plugin & {
1366
+ configs: {
1367
+ recommended: eslint.Linter.Config;
1368
+ all: eslint.Linter.Config;
1369
+ "flat/all": eslint.Linter.FlatConfig;
1370
+ "flat/recommended": eslint.Linter.FlatConfig;
1371
+ };
1372
+ };
1373
+ };
1374
+ rules: {
1375
+ 'unicorn/catch-error-name': string;
1376
+ 'unicorn/consistent-empty-array-spread': string;
1377
+ 'unicorn/consistent-existence-index-check': string;
1378
+ 'unicorn/consistent-function-scoping': (string | {
1379
+ checkArrowFunctions: boolean;
1380
+ })[];
1381
+ 'unicorn/custom-error-definition': string;
1382
+ 'unicorn/error-message': string;
1383
+ 'unicorn/escape-case': string;
1384
+ 'unicorn/filename-case': (string | {
1385
+ cases: {
1386
+ kebabCase: boolean;
1387
+ pascalCase: boolean;
1388
+ };
1389
+ ignore: RegExp[];
1390
+ })[];
1391
+ 'unicorn/new-for-builtins': string;
1392
+ 'unicorn/no-array-method-this-argument': string;
1393
+ 'unicorn/no-array-push-push': string;
1394
+ 'unicorn/no-await-in-promise-methods': string;
1395
+ 'unicorn/no-console-spaces': string;
1396
+ 'unicorn/no-for-loop': string;
1397
+ 'unicorn/no-hex-escape': string;
1398
+ 'unicorn/no-instanceof-array': string;
1399
+ 'unicorn/no-invalid-remove-event-listener': string;
1400
+ 'unicorn/no-lonely-if': string;
1401
+ 'unicorn/no-negation-in-equality-check': string;
1402
+ 'unicorn/no-new-array': string;
1403
+ 'unicorn/no-new-buffer': string;
1404
+ 'unicorn/no-single-promise-in-promise-methods': string;
1405
+ 'unicorn/no-static-only-class': string;
1406
+ 'unicorn/no-unnecessary-await': string;
1407
+ 'unicorn/no-zero-fractions': string;
1408
+ 'unicorn/prefer-add-event-listener': string;
1409
+ 'unicorn/prefer-array-find': string;
1410
+ 'unicorn/prefer-array-flat-map': string;
1411
+ 'unicorn/prefer-array-index-of': string;
1412
+ 'unicorn/prefer-array-some': string;
1413
+ 'unicorn/prefer-at': string;
1414
+ 'unicorn/prefer-blob-reading-methods': string;
1415
+ 'unicorn/prefer-date-now': string;
1416
+ 'unicorn/prefer-dom-node-append': string;
1417
+ 'unicorn/prefer-dom-node-dataset': string;
1418
+ 'unicorn/prefer-dom-node-remove': string;
1419
+ 'unicorn/prefer-dom-node-text-content': string;
1420
+ 'unicorn/prefer-includes': string;
1421
+ 'unicorn/prefer-keyboard-event-key': string;
1422
+ 'unicorn/prefer-math-min-max': string;
1423
+ 'unicorn/prefer-math-trunc': string;
1424
+ 'unicorn/prefer-modern-dom-apis': string;
1425
+ 'unicorn/prefer-modern-math-apis': string;
1426
+ 'unicorn/prefer-negative-index': string;
1427
+ 'unicorn/prefer-node-protocol': string;
1428
+ 'unicorn/prefer-number-properties': string;
1429
+ 'unicorn/prefer-optional-catch-binding': string;
1430
+ 'unicorn/prefer-prototype-methods': string;
1431
+ 'unicorn/prefer-query-selector': string;
1432
+ 'unicorn/prefer-reflect-apply': string;
1433
+ 'unicorn/prefer-regexp-test': string;
1434
+ 'unicorn/prefer-string-raw': string;
1435
+ 'unicorn/prefer-string-replace-all': string;
1436
+ 'unicorn/prefer-string-slice': string;
1437
+ 'unicorn/prefer-string-starts-ends-with': string;
1438
+ 'unicorn/prefer-string-trim-start-end': string;
1439
+ 'unicorn/prefer-type-error': string;
1440
+ 'unicorn/throw-new-error': string;
1441
+ };
1442
+ } | {
1281
1443
  name: string;
1282
1444
  ignores: string[];
1283
1445
  } | {
@@ -2438,6 +2600,86 @@ declare const vuePreset: ({
2438
2600
  eqeqeq: string;
2439
2601
  };
2440
2602
  } | eslint.Linter.Config<eslint.Linter.RulesRecord> | {
2603
+ name: string;
2604
+ plugins: {
2605
+ unicorn: eslint.ESLint.Plugin & {
2606
+ configs: {
2607
+ recommended: eslint.Linter.Config;
2608
+ all: eslint.Linter.Config;
2609
+ "flat/all": eslint.Linter.FlatConfig;
2610
+ "flat/recommended": eslint.Linter.FlatConfig;
2611
+ };
2612
+ };
2613
+ };
2614
+ rules: {
2615
+ 'unicorn/catch-error-name': string;
2616
+ 'unicorn/consistent-empty-array-spread': string;
2617
+ 'unicorn/consistent-existence-index-check': string;
2618
+ 'unicorn/consistent-function-scoping': (string | {
2619
+ checkArrowFunctions: boolean;
2620
+ })[];
2621
+ 'unicorn/custom-error-definition': string;
2622
+ 'unicorn/error-message': string;
2623
+ 'unicorn/escape-case': string;
2624
+ 'unicorn/filename-case': (string | {
2625
+ cases: {
2626
+ kebabCase: boolean;
2627
+ pascalCase: boolean;
2628
+ };
2629
+ ignore: RegExp[];
2630
+ })[];
2631
+ 'unicorn/new-for-builtins': string;
2632
+ 'unicorn/no-array-method-this-argument': string;
2633
+ 'unicorn/no-array-push-push': string;
2634
+ 'unicorn/no-await-in-promise-methods': string;
2635
+ 'unicorn/no-console-spaces': string;
2636
+ 'unicorn/no-for-loop': string;
2637
+ 'unicorn/no-hex-escape': string;
2638
+ 'unicorn/no-instanceof-array': string;
2639
+ 'unicorn/no-invalid-remove-event-listener': string;
2640
+ 'unicorn/no-lonely-if': string;
2641
+ 'unicorn/no-negation-in-equality-check': string;
2642
+ 'unicorn/no-new-array': string;
2643
+ 'unicorn/no-new-buffer': string;
2644
+ 'unicorn/no-single-promise-in-promise-methods': string;
2645
+ 'unicorn/no-static-only-class': string;
2646
+ 'unicorn/no-unnecessary-await': string;
2647
+ 'unicorn/no-zero-fractions': string;
2648
+ 'unicorn/prefer-add-event-listener': string;
2649
+ 'unicorn/prefer-array-find': string;
2650
+ 'unicorn/prefer-array-flat-map': string;
2651
+ 'unicorn/prefer-array-index-of': string;
2652
+ 'unicorn/prefer-array-some': string;
2653
+ 'unicorn/prefer-at': string;
2654
+ 'unicorn/prefer-blob-reading-methods': string;
2655
+ 'unicorn/prefer-date-now': string;
2656
+ 'unicorn/prefer-dom-node-append': string;
2657
+ 'unicorn/prefer-dom-node-dataset': string;
2658
+ 'unicorn/prefer-dom-node-remove': string;
2659
+ 'unicorn/prefer-dom-node-text-content': string;
2660
+ 'unicorn/prefer-includes': string;
2661
+ 'unicorn/prefer-keyboard-event-key': string;
2662
+ 'unicorn/prefer-math-min-max': string;
2663
+ 'unicorn/prefer-math-trunc': string;
2664
+ 'unicorn/prefer-modern-dom-apis': string;
2665
+ 'unicorn/prefer-modern-math-apis': string;
2666
+ 'unicorn/prefer-negative-index': string;
2667
+ 'unicorn/prefer-node-protocol': string;
2668
+ 'unicorn/prefer-number-properties': string;
2669
+ 'unicorn/prefer-optional-catch-binding': string;
2670
+ 'unicorn/prefer-prototype-methods': string;
2671
+ 'unicorn/prefer-query-selector': string;
2672
+ 'unicorn/prefer-reflect-apply': string;
2673
+ 'unicorn/prefer-regexp-test': string;
2674
+ 'unicorn/prefer-string-raw': string;
2675
+ 'unicorn/prefer-string-replace-all': string;
2676
+ 'unicorn/prefer-string-slice': string;
2677
+ 'unicorn/prefer-string-starts-ends-with': string;
2678
+ 'unicorn/prefer-string-trim-start-end': string;
2679
+ 'unicorn/prefer-type-error': string;
2680
+ 'unicorn/throw-new-error': string;
2681
+ };
2682
+ } | {
2441
2683
  name: string;
2442
2684
  ignores: string[];
2443
2685
  } | {
@@ -3598,6 +3840,86 @@ declare const vueSkyline: ({
3598
3840
  eqeqeq: string;
3599
3841
  };
3600
3842
  } | eslint.Linter.Config<eslint.Linter.RulesRecord> | {
3843
+ name: string;
3844
+ plugins: {
3845
+ unicorn: eslint.ESLint.Plugin & {
3846
+ configs: {
3847
+ recommended: eslint.Linter.Config;
3848
+ all: eslint.Linter.Config;
3849
+ "flat/all": eslint.Linter.FlatConfig;
3850
+ "flat/recommended": eslint.Linter.FlatConfig;
3851
+ };
3852
+ };
3853
+ };
3854
+ rules: {
3855
+ 'unicorn/catch-error-name': string;
3856
+ 'unicorn/consistent-empty-array-spread': string;
3857
+ 'unicorn/consistent-existence-index-check': string;
3858
+ 'unicorn/consistent-function-scoping': (string | {
3859
+ checkArrowFunctions: boolean;
3860
+ })[];
3861
+ 'unicorn/custom-error-definition': string;
3862
+ 'unicorn/error-message': string;
3863
+ 'unicorn/escape-case': string;
3864
+ 'unicorn/filename-case': (string | {
3865
+ cases: {
3866
+ kebabCase: boolean;
3867
+ pascalCase: boolean;
3868
+ };
3869
+ ignore: RegExp[];
3870
+ })[];
3871
+ 'unicorn/new-for-builtins': string;
3872
+ 'unicorn/no-array-method-this-argument': string;
3873
+ 'unicorn/no-array-push-push': string;
3874
+ 'unicorn/no-await-in-promise-methods': string;
3875
+ 'unicorn/no-console-spaces': string;
3876
+ 'unicorn/no-for-loop': string;
3877
+ 'unicorn/no-hex-escape': string;
3878
+ 'unicorn/no-instanceof-array': string;
3879
+ 'unicorn/no-invalid-remove-event-listener': string;
3880
+ 'unicorn/no-lonely-if': string;
3881
+ 'unicorn/no-negation-in-equality-check': string;
3882
+ 'unicorn/no-new-array': string;
3883
+ 'unicorn/no-new-buffer': string;
3884
+ 'unicorn/no-single-promise-in-promise-methods': string;
3885
+ 'unicorn/no-static-only-class': string;
3886
+ 'unicorn/no-unnecessary-await': string;
3887
+ 'unicorn/no-zero-fractions': string;
3888
+ 'unicorn/prefer-add-event-listener': string;
3889
+ 'unicorn/prefer-array-find': string;
3890
+ 'unicorn/prefer-array-flat-map': string;
3891
+ 'unicorn/prefer-array-index-of': string;
3892
+ 'unicorn/prefer-array-some': string;
3893
+ 'unicorn/prefer-at': string;
3894
+ 'unicorn/prefer-blob-reading-methods': string;
3895
+ 'unicorn/prefer-date-now': string;
3896
+ 'unicorn/prefer-dom-node-append': string;
3897
+ 'unicorn/prefer-dom-node-dataset': string;
3898
+ 'unicorn/prefer-dom-node-remove': string;
3899
+ 'unicorn/prefer-dom-node-text-content': string;
3900
+ 'unicorn/prefer-includes': string;
3901
+ 'unicorn/prefer-keyboard-event-key': string;
3902
+ 'unicorn/prefer-math-min-max': string;
3903
+ 'unicorn/prefer-math-trunc': string;
3904
+ 'unicorn/prefer-modern-dom-apis': string;
3905
+ 'unicorn/prefer-modern-math-apis': string;
3906
+ 'unicorn/prefer-negative-index': string;
3907
+ 'unicorn/prefer-node-protocol': string;
3908
+ 'unicorn/prefer-number-properties': string;
3909
+ 'unicorn/prefer-optional-catch-binding': string;
3910
+ 'unicorn/prefer-prototype-methods': string;
3911
+ 'unicorn/prefer-query-selector': string;
3912
+ 'unicorn/prefer-reflect-apply': string;
3913
+ 'unicorn/prefer-regexp-test': string;
3914
+ 'unicorn/prefer-string-raw': string;
3915
+ 'unicorn/prefer-string-replace-all': string;
3916
+ 'unicorn/prefer-string-slice': string;
3917
+ 'unicorn/prefer-string-starts-ends-with': string;
3918
+ 'unicorn/prefer-string-trim-start-end': string;
3919
+ 'unicorn/prefer-type-error': string;
3920
+ 'unicorn/throw-new-error': string;
3921
+ };
3922
+ } | {
3601
3923
  name: string;
3602
3924
  ignores: string[];
3603
3925
  } | {
@@ -4788,7 +5110,9 @@ declare const vueSkyline: ({
4788
5110
  "prefer-equality-matcher": eslint.Rule.RuleModule;
4789
5111
  "prefer-hooks-in-order": eslint.Rule.RuleModule;
4790
5112
  "prefer-hooks-on-top": eslint.Rule.RuleModule;
5113
+ "prefer-locator": eslint.Rule.RuleModule;
4791
5114
  "prefer-lowercase-title": eslint.Rule.RuleModule;
5115
+ "prefer-native-locators": eslint.Rule.RuleModule;
4792
5116
  "prefer-strict-equal": eslint.Rule.RuleModule;
4793
5117
  "prefer-to-be": eslint.Rule.RuleModule;
4794
5118
  "prefer-to-contain": eslint.Rule.RuleModule;
package/dist/index.js CHANGED
@@ -337,6 +337,7 @@ import { default as default16 } from "eslint-plugin-regexp";
337
337
  import { default as default17 } from "eslint-plugin-import";
338
338
  import { default as default18 } from "eslint-plugin-markdown";
339
339
  import { default as default19 } from "@eslint-community/eslint-plugin-eslint-comments/configs";
340
+ import { default as default20 } from "eslint-plugin-unicorn";
340
341
 
341
342
  // configs/javascript.ts
342
343
  var isProduction = process.env.NODE_ENV === "production";
@@ -437,38 +438,110 @@ var importConfigs = [
437
438
  }
438
439
  ];
439
440
 
441
+ // configs/unicorn.ts
442
+ var unicornConfig = {
443
+ name: "component-hook/unicorn",
444
+ plugins: {
445
+ unicorn: default20
446
+ },
447
+ rules: {
448
+ "unicorn/catch-error-name": "error",
449
+ "unicorn/consistent-empty-array-spread": "error",
450
+ "unicorn/consistent-existence-index-check": "error",
451
+ "unicorn/consistent-function-scoping": ["error", { checkArrowFunctions: false }],
452
+ "unicorn/custom-error-definition": "error",
453
+ "unicorn/error-message": "error",
454
+ "unicorn/escape-case": "error",
455
+ "unicorn/filename-case": [
456
+ "error",
457
+ {
458
+ cases: { kebabCase: true, pascalCase: true },
459
+ ignore: [/^[A-Z]+\..*$/, /import_map\.json/]
460
+ }
461
+ ],
462
+ "unicorn/new-for-builtins": "error",
463
+ "unicorn/no-array-method-this-argument": "error",
464
+ "unicorn/no-array-push-push": "error",
465
+ "unicorn/no-await-in-promise-methods": "error",
466
+ "unicorn/no-console-spaces": "error",
467
+ "unicorn/no-for-loop": "error",
468
+ "unicorn/no-hex-escape": "error",
469
+ "unicorn/no-instanceof-array": "error",
470
+ "unicorn/no-invalid-remove-event-listener": "error",
471
+ "unicorn/no-lonely-if": "error",
472
+ "unicorn/no-negation-in-equality-check": "error",
473
+ "unicorn/no-new-array": "error",
474
+ "unicorn/no-new-buffer": "error",
475
+ "unicorn/no-single-promise-in-promise-methods": "error",
476
+ "unicorn/no-static-only-class": "error",
477
+ "unicorn/no-unnecessary-await": "error",
478
+ "unicorn/no-zero-fractions": `error`,
479
+ "unicorn/prefer-add-event-listener": "error",
480
+ "unicorn/prefer-array-find": "error",
481
+ "unicorn/prefer-array-flat-map": "error",
482
+ "unicorn/prefer-array-index-of": "error",
483
+ "unicorn/prefer-array-some": "error",
484
+ "unicorn/prefer-at": "error",
485
+ "unicorn/prefer-blob-reading-methods": "error",
486
+ "unicorn/prefer-date-now": "error",
487
+ "unicorn/prefer-dom-node-append": "error",
488
+ "unicorn/prefer-dom-node-dataset": "error",
489
+ "unicorn/prefer-dom-node-remove": "error",
490
+ "unicorn/prefer-dom-node-text-content": "error",
491
+ "unicorn/prefer-includes": "error",
492
+ "unicorn/prefer-keyboard-event-key": "error",
493
+ "unicorn/prefer-math-min-max": "error",
494
+ "unicorn/prefer-math-trunc": "error",
495
+ "unicorn/prefer-modern-dom-apis": "error",
496
+ "unicorn/prefer-modern-math-apis": "error",
497
+ "unicorn/prefer-negative-index": "error",
498
+ "unicorn/prefer-node-protocol": "error",
499
+ "unicorn/prefer-number-properties": "error",
500
+ "unicorn/prefer-optional-catch-binding": "error",
501
+ "unicorn/prefer-prototype-methods": "error",
502
+ "unicorn/prefer-query-selector": "error",
503
+ "unicorn/prefer-reflect-apply": "error",
504
+ "unicorn/prefer-regexp-test": "error",
505
+ "unicorn/prefer-string-raw": "error",
506
+ "unicorn/prefer-string-replace-all": "error",
507
+ "unicorn/prefer-string-slice": "error",
508
+ "unicorn/prefer-string-starts-ends-with": "error",
509
+ "unicorn/prefer-string-trim-start-end": "error",
510
+ "unicorn/prefer-type-error": "error",
511
+ "unicorn/throw-new-error": "error"
512
+ }
513
+ };
514
+
440
515
  // configs/markdown.ts
441
- var markdownConfigs = [
442
- ...default18.configs.recommended.map((config) => {
443
- const { name, rules: rules5 } = config;
444
- const baseConfig = {
445
- ...config,
446
- name: `component-hook/${name}`
516
+ var markdownConfigs = default18.configs.recommended.map((config) => {
517
+ const { name, rules: rules5 } = config;
518
+ const baseConfig = {
519
+ ...config,
520
+ name: `component-hook/${name}`
521
+ };
522
+ if (rules5) {
523
+ baseConfig.rules = {
524
+ ...rules5,
525
+ "no-alert": "off",
526
+ "no-console": "off",
527
+ "no-restricted-imports": "off",
528
+ "no-undef": "off",
529
+ "no-unused-expressions": "off",
530
+ "no-unused-vars": "off",
531
+ "@typescript-eslint/comma-dangle": "off",
532
+ "@typescript-eslint/consistent-type-imports": "off",
533
+ "@typescript-eslint/no-extraneous-class": "off",
534
+ "@typescript-eslint/no-namespace": "off",
535
+ "@typescript-eslint/no-redeclare": "off",
536
+ "@typescript-eslint/no-require-imports": "off",
537
+ "@typescript-eslint/no-unused-expressions": "off",
538
+ "@typescript-eslint/no-unused-vars": "off",
539
+ "@typescript-eslint/no-use-before-define": "off",
540
+ "import/no-default-export": "off"
447
541
  };
448
- if (rules5) {
449
- baseConfig.rules = {
450
- ...rules5,
451
- "no-alert": "off",
452
- "no-console": "off",
453
- "no-restricted-imports": "off",
454
- "no-undef": "off",
455
- "no-unused-expressions": "off",
456
- "no-unused-vars": "off",
457
- "@typescript-eslint/comma-dangle": "off",
458
- "@typescript-eslint/consistent-type-imports": "off",
459
- "@typescript-eslint/no-extraneous-class": "off",
460
- "@typescript-eslint/no-namespace": "off",
461
- "@typescript-eslint/no-redeclare": "off",
462
- "@typescript-eslint/no-require-imports": "off",
463
- "@typescript-eslint/no-unused-expressions": "off",
464
- "@typescript-eslint/no-unused-vars": "off",
465
- "@typescript-eslint/no-use-before-define": "off",
466
- "import/no-default-export": "off"
467
- };
468
- }
469
- return baseConfig;
470
- })
471
- ];
542
+ }
543
+ return baseConfig;
544
+ });
472
545
 
473
546
  // configs/regexp.ts
474
547
  var regexpConfig = {
@@ -533,8 +606,14 @@ var sonarjsConfigs = [
533
606
 
534
607
  // configs/security.ts
535
608
  var securityConfig = {
536
- ...default13.configs.recommended,
537
- name: "component-hook/security"
609
+ name: "component-hook/security",
610
+ plugins: {
611
+ security: default13
612
+ },
613
+ rules: {
614
+ ...default13.configs.recommended.rules,
615
+ "security/detect-object-injection": "off"
616
+ }
538
617
  };
539
618
 
540
619
  // configs/react.ts
@@ -549,14 +628,9 @@ var reactConfigs = [
549
628
  }
550
629
  },
551
630
  {
631
+ ...default6.configs.recommended,
552
632
  name: "component-hook/react-hooks",
553
- files: ["**/*.[jt]s?(x)"],
554
- plugins: {
555
- "react-hooks": fixupPluginRules({ rules: default6.rules })
556
- },
557
- rules: {
558
- ...default6.configs.recommended.rules
559
- }
633
+ files: ["**/*.[jt]s?(x)"]
560
634
  },
561
635
  {
562
636
  ...default7.flatConfigs.recommended,
@@ -761,6 +835,7 @@ var basicConfigs = [
761
835
  ...typescriptConfigs,
762
836
  ...commentsConfigs,
763
837
  ...importConfigs,
838
+ unicornConfig,
764
839
  regexpConfig,
765
840
  {
766
841
  name: "component-hook/globals",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@component-hook/eslint-plugin",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "ESLint config for component hook",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -34,22 +34,23 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
37
- "@eslint/compat": "^1.1.1",
37
+ "@eslint/compat": "^1.2.0",
38
38
  "eslint-config-prettier": "^9.1.0",
39
39
  "eslint-plugin-import": "^2.31.0",
40
40
  "eslint-plugin-jsx-a11y": "^6.10.0",
41
41
  "eslint-plugin-markdown": "^5.1.0",
42
- "eslint-plugin-playwright": "^1.6.2",
42
+ "eslint-plugin-playwright": "^1.7.0",
43
43
  "eslint-plugin-prettier": "^5.2.1",
44
44
  "eslint-plugin-react": "^7.37.1",
45
- "eslint-plugin-react-hooks": "^4.6.2",
45
+ "eslint-plugin-react-hooks": "^5.0.0",
46
46
  "eslint-plugin-regexp": "^2.6.0",
47
47
  "eslint-plugin-security": "^3.0.1",
48
48
  "eslint-plugin-sonarjs": "^2.0.3",
49
49
  "eslint-plugin-testing-library": "^6.3.0",
50
- "eslint-plugin-vue": "^9.28.0",
51
- "globals": "^15.10.0",
52
- "typescript-eslint": "^8.8.0",
50
+ "eslint-plugin-unicorn": "^56.0.0",
51
+ "eslint-plugin-vue": "^9.29.0",
52
+ "globals": "^15.11.0",
53
+ "typescript-eslint": "^8.8.1",
53
54
  "vue-eslint-parser": "^9.4.3"
54
55
  },
55
56
  "devDependencies": {