@ntnyq/eslint-config 3.7.1 → 3.7.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/dist/index.cjs CHANGED
@@ -1154,7 +1154,6 @@ var jsdoc = (options = {}) => [
1154
1154
  "jsdoc/check-line-alignment": "error",
1155
1155
  "jsdoc/check-param-names": "error",
1156
1156
  "jsdoc/check-property-names": "error",
1157
- "jsdoc/check-tag-names": "error",
1158
1157
  "jsdoc/check-types": "error",
1159
1158
  "jsdoc/empty-tags": "error",
1160
1159
  "jsdoc/multiline-blocks": "error",
@@ -1165,6 +1164,16 @@ var jsdoc = (options = {}) => [
1165
1164
  "jsdoc/no-multi-asterisks": "error",
1166
1165
  "jsdoc/require-asterisk-prefix": "error",
1167
1166
  "jsdoc/require-hyphen-before-param-description": "error",
1167
+ "jsdoc/check-tag-names": [
1168
+ "error",
1169
+ {
1170
+ definedTags: [
1171
+ // magic-comments
1172
+ "vite-ignore",
1173
+ "unocss-include"
1174
+ ]
1175
+ }
1176
+ ],
1168
1177
  // TODO: this after investigate
1169
1178
  // 'jsdoc/sort-tags': [
1170
1179
  // 'error',
@@ -2474,20 +2483,30 @@ var typescript = (options = {}) => {
2474
2483
  };
2475
2484
 
2476
2485
  // src/configs/githubAction.ts
2477
- var githubAction = (options = {}) => [
2478
- {
2486
+ var import_eslint_plugin_github_action2 = require("eslint-plugin-github-action");
2487
+ var githubAction = (options = {}) => {
2488
+ const {
2489
+ // Support common overrides rules
2490
+ overrides: overridesRules = {},
2491
+ // Flat config options
2492
+ ...restOptions
2493
+ } = options;
2494
+ const recommendedConfig = (0, import_eslint_plugin_github_action2.createRecommendedConfig)({
2479
2495
  name: "ntnyq/github-action",
2480
2496
  files: [GLOB_GITHUB_ACTION],
2481
- plugins: {
2482
- "github-action": import_eslint_plugin_github_action.default
2483
- },
2484
- rules: {
2485
- "github-action/require-action-name": "error",
2486
- // Overrides rules
2487
- ...options.overrides
2497
+ ...restOptions
2498
+ });
2499
+ return [
2500
+ {
2501
+ ...recommendedConfig,
2502
+ rules: {
2503
+ ...recommendedConfig.rules,
2504
+ // Overrides rules
2505
+ ...overridesRules
2506
+ }
2488
2507
  }
2489
- }
2490
- ];
2508
+ ];
2509
+ };
2491
2510
 
2492
2511
  // src/configs/perfectionist.ts
2493
2512
  var perfectionist = (options = {}) => {
@@ -2592,7 +2611,8 @@ var perfectionist = (options = {}) => {
2592
2611
  "error",
2593
2612
  {
2594
2613
  type: "alphabetical",
2595
- order: "asc"
2614
+ order: "asc",
2615
+ partitionByComment: true
2596
2616
  }
2597
2617
  ],
2598
2618
  "perfectionist/sort-modules": [
@@ -2628,6 +2648,7 @@ var perfectionist = (options = {}) => {
2628
2648
  // {
2629
2649
  // type: 'alphabetical',
2630
2650
  // order: 'asc',
2651
+ // partitionByComment: true,
2631
2652
  // },
2632
2653
  // ],
2633
2654
  "perfectionist/sort-intersection-types": [
@@ -2648,7 +2669,8 @@ var perfectionist = (options = {}) => {
2648
2669
  "tuple",
2649
2670
  "union",
2650
2671
  "nullish"
2651
- ]
2672
+ ],
2673
+ partitionByComment: true
2652
2674
  }
2653
2675
  ],
2654
2676
  "perfectionist/sort-modules": [
@@ -2663,14 +2685,16 @@ var perfectionist = (options = {}) => {
2663
2685
  "error",
2664
2686
  {
2665
2687
  type: "alphabetical",
2666
- order: "asc"
2688
+ order: "asc",
2689
+ partitionByComment: true
2667
2690
  }
2668
2691
  ],
2669
2692
  "perfectionist/sort-union-types": [
2670
2693
  "error",
2671
2694
  {
2672
2695
  type: "alphabetical",
2673
- order: "asc"
2696
+ order: "asc",
2697
+ partitionByComment: true
2674
2698
  }
2675
2699
  ],
2676
2700
  // Overrides rules
@@ -2690,21 +2714,24 @@ var perfectionist = (options = {}) => {
2690
2714
  "error",
2691
2715
  {
2692
2716
  type: "alphabetical",
2693
- order: "asc"
2717
+ order: "asc",
2718
+ partitionByComment: true
2694
2719
  }
2695
2720
  ],
2696
2721
  "perfectionist/sort-objects": [
2697
2722
  "error",
2698
2723
  {
2699
2724
  type: "alphabetical",
2700
- order: "asc"
2725
+ order: "asc",
2726
+ partitionByComment: true
2701
2727
  }
2702
2728
  ],
2703
2729
  "perfectionist/sort-sets": [
2704
2730
  "error",
2705
2731
  {
2706
2732
  type: "alphabetical",
2707
- order: "asc"
2733
+ order: "asc",
2734
+ partitionByComment: true
2708
2735
  }
2709
2736
  ],
2710
2737
  "perfectionist/sort-modules": [
package/dist/index.d.cts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { FlatConfigComposer } from 'eslint-flat-config-utils';
2
2
  import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
3
3
  import { ESLintPluginCommandOptions } from 'eslint-plugin-command/types';
4
+ import { RecommendedOptions } from 'eslint-plugin-github-action';
5
+ export { default as pluginGitHubAction } from 'eslint-plugin-github-action';
4
6
  import { Options } from 'eslint-processor-vue-blocks';
5
7
  export { default as processorVueBlocks } from 'eslint-processor-vue-blocks';
6
8
  import { Linter } from 'eslint';
@@ -26,7 +28,6 @@ export { default as pluginImport } from 'eslint-plugin-import-x';
26
28
  export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
27
29
  export { default as pluginPrettier } from 'eslint-plugin-prettier';
28
30
  export { default as pluginStylistic } from '@stylistic/eslint-plugin';
29
- export { default as pluginGitHubAction } from 'eslint-plugin-github-action';
30
31
  export { default as pluginPerfectionist } from 'eslint-plugin-perfectionist';
31
32
  export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
32
33
  export { default as pluginComments } from '@eslint-community/eslint-plugin-eslint-comments';
@@ -1541,6 +1542,16 @@ interface RuleOptions {
1541
1542
  * @see https://eslint-plugin-github-action.ntnyq.com/rules/max-jobs-per-action.html
1542
1543
  */
1543
1544
  'github-action/max-jobs-per-action'?: Linter.RuleEntry<GithubActionMaxJobsPerAction>;
1545
+ /**
1546
+ * disallow using external job.
1547
+ * @see https://eslint-plugin-github-action.ntnyq.com/rules/no-external-job.html
1548
+ */
1549
+ 'github-action/no-external-job'?: Linter.RuleEntry<[]>;
1550
+ /**
1551
+ * disallow using invalid key.
1552
+ * @see https://eslint-plugin-github-action.ntnyq.com/rules/no-invalid-key.html
1553
+ */
1554
+ 'github-action/no-invalid-key'?: Linter.RuleEntry<[]>;
1544
1555
  /**
1545
1556
  * disallow using top level env.
1546
1557
  * @see https://eslint-plugin-github-action.ntnyq.com/rules/no-top-level-env.html
@@ -1551,6 +1562,16 @@ interface RuleOptions {
1551
1562
  * @see https://eslint-plugin-github-action.ntnyq.com/rules/no-top-level-permissions.html
1552
1563
  */
1553
1564
  'github-action/no-top-level-permissions'?: Linter.RuleEntry<[]>;
1565
+ /**
1566
+ * enforce action file extension.
1567
+ * @see https://eslint-plugin-github-action.ntnyq.com/rules/prefer-file-extension.html
1568
+ */
1569
+ 'github-action/prefer-file-extension'?: Linter.RuleEntry<GithubActionPreferFileExtension>;
1570
+ /**
1571
+ * enforce the style of job step uses.
1572
+ * @see https://eslint-plugin-github-action.ntnyq.com/rules/prefer-step-uses-style.html
1573
+ */
1574
+ 'github-action/prefer-step-uses-style'?: Linter.RuleEntry<GithubActionPreferStepUsesStyle>;
1554
1575
  /**
1555
1576
  * require action name to be set.
1556
1577
  * @see https://eslint-plugin-github-action.ntnyq.com/rules/require-action-name.html
@@ -9417,6 +9438,22 @@ type GithubActionJobIdCasing = [] | [
9417
9438
  })
9418
9439
  ];
9419
9440
  type GithubActionMaxJobsPerAction = [] | [number];
9441
+ type GithubActionPreferFileExtension = [] | [
9442
+ (("yml" | "yaml") | {
9443
+ extension?: ("yml" | "yaml");
9444
+ caseSensitive?: boolean;
9445
+ })
9446
+ ];
9447
+ type GithubActionPreferStepUsesStyle = [] | [
9448
+ (("release" | "commit" | "branch") | {
9449
+ commit?: boolean;
9450
+ release?: boolean;
9451
+ branch?: boolean;
9452
+ allowRepository?: boolean;
9453
+ allowDocker?: boolean;
9454
+ ignores?: string[];
9455
+ })
9456
+ ];
9420
9457
  type GroupedAccessorPairs = [] | [("anyOrder" | "getBeforeSet" | "setBeforeGet")];
9421
9458
  type HandleCallbackErr = [] | [string];
9422
9459
  type IdBlacklist = string[];
@@ -14725,7 +14762,7 @@ interface ConfigAntfuOptions extends OptionsOverrides {
14725
14762
  }
14726
14763
  interface ConfigCommentsOptions extends OptionsOverrides {
14727
14764
  }
14728
- interface ConfigGitHubActionOptions extends OptionsOverrides {
14765
+ interface ConfigGitHubActionOptions extends RecommendedOptions, OptionsOverrides {
14729
14766
  }
14730
14767
  interface ConfigImportsOptions extends OptionsOverrides {
14731
14768
  }
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { FlatConfigComposer } from 'eslint-flat-config-utils';
2
2
  import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
3
3
  import { ESLintPluginCommandOptions } from 'eslint-plugin-command/types';
4
+ import { RecommendedOptions } from 'eslint-plugin-github-action';
5
+ export { default as pluginGitHubAction } from 'eslint-plugin-github-action';
4
6
  import { Options } from 'eslint-processor-vue-blocks';
5
7
  export { default as processorVueBlocks } from 'eslint-processor-vue-blocks';
6
8
  import { Linter } from 'eslint';
@@ -26,7 +28,6 @@ export { default as pluginImport } from 'eslint-plugin-import-x';
26
28
  export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
27
29
  export { default as pluginPrettier } from 'eslint-plugin-prettier';
28
30
  export { default as pluginStylistic } from '@stylistic/eslint-plugin';
29
- export { default as pluginGitHubAction } from 'eslint-plugin-github-action';
30
31
  export { default as pluginPerfectionist } from 'eslint-plugin-perfectionist';
31
32
  export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
32
33
  export { default as pluginComments } from '@eslint-community/eslint-plugin-eslint-comments';
@@ -1541,6 +1542,16 @@ interface RuleOptions {
1541
1542
  * @see https://eslint-plugin-github-action.ntnyq.com/rules/max-jobs-per-action.html
1542
1543
  */
1543
1544
  'github-action/max-jobs-per-action'?: Linter.RuleEntry<GithubActionMaxJobsPerAction>;
1545
+ /**
1546
+ * disallow using external job.
1547
+ * @see https://eslint-plugin-github-action.ntnyq.com/rules/no-external-job.html
1548
+ */
1549
+ 'github-action/no-external-job'?: Linter.RuleEntry<[]>;
1550
+ /**
1551
+ * disallow using invalid key.
1552
+ * @see https://eslint-plugin-github-action.ntnyq.com/rules/no-invalid-key.html
1553
+ */
1554
+ 'github-action/no-invalid-key'?: Linter.RuleEntry<[]>;
1544
1555
  /**
1545
1556
  * disallow using top level env.
1546
1557
  * @see https://eslint-plugin-github-action.ntnyq.com/rules/no-top-level-env.html
@@ -1551,6 +1562,16 @@ interface RuleOptions {
1551
1562
  * @see https://eslint-plugin-github-action.ntnyq.com/rules/no-top-level-permissions.html
1552
1563
  */
1553
1564
  'github-action/no-top-level-permissions'?: Linter.RuleEntry<[]>;
1565
+ /**
1566
+ * enforce action file extension.
1567
+ * @see https://eslint-plugin-github-action.ntnyq.com/rules/prefer-file-extension.html
1568
+ */
1569
+ 'github-action/prefer-file-extension'?: Linter.RuleEntry<GithubActionPreferFileExtension>;
1570
+ /**
1571
+ * enforce the style of job step uses.
1572
+ * @see https://eslint-plugin-github-action.ntnyq.com/rules/prefer-step-uses-style.html
1573
+ */
1574
+ 'github-action/prefer-step-uses-style'?: Linter.RuleEntry<GithubActionPreferStepUsesStyle>;
1554
1575
  /**
1555
1576
  * require action name to be set.
1556
1577
  * @see https://eslint-plugin-github-action.ntnyq.com/rules/require-action-name.html
@@ -9417,6 +9438,22 @@ type GithubActionJobIdCasing = [] | [
9417
9438
  })
9418
9439
  ];
9419
9440
  type GithubActionMaxJobsPerAction = [] | [number];
9441
+ type GithubActionPreferFileExtension = [] | [
9442
+ (("yml" | "yaml") | {
9443
+ extension?: ("yml" | "yaml");
9444
+ caseSensitive?: boolean;
9445
+ })
9446
+ ];
9447
+ type GithubActionPreferStepUsesStyle = [] | [
9448
+ (("release" | "commit" | "branch") | {
9449
+ commit?: boolean;
9450
+ release?: boolean;
9451
+ branch?: boolean;
9452
+ allowRepository?: boolean;
9453
+ allowDocker?: boolean;
9454
+ ignores?: string[];
9455
+ })
9456
+ ];
9420
9457
  type GroupedAccessorPairs = [] | [("anyOrder" | "getBeforeSet" | "setBeforeGet")];
9421
9458
  type HandleCallbackErr = [] | [string];
9422
9459
  type IdBlacklist = string[];
@@ -14725,7 +14762,7 @@ interface ConfigAntfuOptions extends OptionsOverrides {
14725
14762
  }
14726
14763
  interface ConfigCommentsOptions extends OptionsOverrides {
14727
14764
  }
14728
- interface ConfigGitHubActionOptions extends OptionsOverrides {
14765
+ interface ConfigGitHubActionOptions extends RecommendedOptions, OptionsOverrides {
14729
14766
  }
14730
14767
  interface ConfigImportsOptions extends OptionsOverrides {
14731
14768
  }
package/dist/index.js CHANGED
@@ -1012,7 +1012,6 @@ var jsdoc = (options = {}) => [
1012
1012
  "jsdoc/check-line-alignment": "error",
1013
1013
  "jsdoc/check-param-names": "error",
1014
1014
  "jsdoc/check-property-names": "error",
1015
- "jsdoc/check-tag-names": "error",
1016
1015
  "jsdoc/check-types": "error",
1017
1016
  "jsdoc/empty-tags": "error",
1018
1017
  "jsdoc/multiline-blocks": "error",
@@ -1023,6 +1022,16 @@ var jsdoc = (options = {}) => [
1023
1022
  "jsdoc/no-multi-asterisks": "error",
1024
1023
  "jsdoc/require-asterisk-prefix": "error",
1025
1024
  "jsdoc/require-hyphen-before-param-description": "error",
1025
+ "jsdoc/check-tag-names": [
1026
+ "error",
1027
+ {
1028
+ definedTags: [
1029
+ // magic-comments
1030
+ "vite-ignore",
1031
+ "unocss-include"
1032
+ ]
1033
+ }
1034
+ ],
1026
1035
  // TODO: this after investigate
1027
1036
  // 'jsdoc/sort-tags': [
1028
1037
  // 'error',
@@ -2332,20 +2341,30 @@ var typescript = (options = {}) => {
2332
2341
  };
2333
2342
 
2334
2343
  // src/configs/githubAction.ts
2335
- var githubAction = (options = {}) => [
2336
- {
2344
+ import { createRecommendedConfig } from "eslint-plugin-github-action";
2345
+ var githubAction = (options = {}) => {
2346
+ const {
2347
+ // Support common overrides rules
2348
+ overrides: overridesRules = {},
2349
+ // Flat config options
2350
+ ...restOptions
2351
+ } = options;
2352
+ const recommendedConfig = createRecommendedConfig({
2337
2353
  name: "ntnyq/github-action",
2338
2354
  files: [GLOB_GITHUB_ACTION],
2339
- plugins: {
2340
- "github-action": default18
2341
- },
2342
- rules: {
2343
- "github-action/require-action-name": "error",
2344
- // Overrides rules
2345
- ...options.overrides
2355
+ ...restOptions
2356
+ });
2357
+ return [
2358
+ {
2359
+ ...recommendedConfig,
2360
+ rules: {
2361
+ ...recommendedConfig.rules,
2362
+ // Overrides rules
2363
+ ...overridesRules
2364
+ }
2346
2365
  }
2347
- }
2348
- ];
2366
+ ];
2367
+ };
2349
2368
 
2350
2369
  // src/configs/perfectionist.ts
2351
2370
  var perfectionist = (options = {}) => {
@@ -2450,7 +2469,8 @@ var perfectionist = (options = {}) => {
2450
2469
  "error",
2451
2470
  {
2452
2471
  type: "alphabetical",
2453
- order: "asc"
2472
+ order: "asc",
2473
+ partitionByComment: true
2454
2474
  }
2455
2475
  ],
2456
2476
  "perfectionist/sort-modules": [
@@ -2486,6 +2506,7 @@ var perfectionist = (options = {}) => {
2486
2506
  // {
2487
2507
  // type: 'alphabetical',
2488
2508
  // order: 'asc',
2509
+ // partitionByComment: true,
2489
2510
  // },
2490
2511
  // ],
2491
2512
  "perfectionist/sort-intersection-types": [
@@ -2506,7 +2527,8 @@ var perfectionist = (options = {}) => {
2506
2527
  "tuple",
2507
2528
  "union",
2508
2529
  "nullish"
2509
- ]
2530
+ ],
2531
+ partitionByComment: true
2510
2532
  }
2511
2533
  ],
2512
2534
  "perfectionist/sort-modules": [
@@ -2521,14 +2543,16 @@ var perfectionist = (options = {}) => {
2521
2543
  "error",
2522
2544
  {
2523
2545
  type: "alphabetical",
2524
- order: "asc"
2546
+ order: "asc",
2547
+ partitionByComment: true
2525
2548
  }
2526
2549
  ],
2527
2550
  "perfectionist/sort-union-types": [
2528
2551
  "error",
2529
2552
  {
2530
2553
  type: "alphabetical",
2531
- order: "asc"
2554
+ order: "asc",
2555
+ partitionByComment: true
2532
2556
  }
2533
2557
  ],
2534
2558
  // Overrides rules
@@ -2548,21 +2572,24 @@ var perfectionist = (options = {}) => {
2548
2572
  "error",
2549
2573
  {
2550
2574
  type: "alphabetical",
2551
- order: "asc"
2575
+ order: "asc",
2576
+ partitionByComment: true
2552
2577
  }
2553
2578
  ],
2554
2579
  "perfectionist/sort-objects": [
2555
2580
  "error",
2556
2581
  {
2557
2582
  type: "alphabetical",
2558
- order: "asc"
2583
+ order: "asc",
2584
+ partitionByComment: true
2559
2585
  }
2560
2586
  ],
2561
2587
  "perfectionist/sort-sets": [
2562
2588
  "error",
2563
2589
  {
2564
2590
  type: "alphabetical",
2565
- order: "asc"
2591
+ order: "asc",
2592
+ partitionByComment: true
2566
2593
  }
2567
2594
  ],
2568
2595
  "perfectionist/sort-modules": [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ntnyq/eslint-config",
3
3
  "type": "module",
4
- "version": "3.7.1",
4
+ "version": "3.7.2",
5
5
  "packageManager": "pnpm@9.14.4",
6
6
  "description": "An opinionated ESLint config preset of ntnyq",
7
7
  "keywords": [
@@ -53,22 +53,22 @@
53
53
  "typecheck": "tsc --noEmit"
54
54
  },
55
55
  "peerDependencies": {
56
- "eslint": "^9.0.0"
56
+ "eslint": "^9.5.0"
57
57
  },
58
58
  "dependencies": {
59
59
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
60
60
  "@eslint/js": "^9.16.0",
61
61
  "@eslint/markdown": "^6.2.1",
62
62
  "@stylistic/eslint-plugin": "^2.11.0",
63
- "@unocss/eslint-plugin": "^0.64.1",
64
- "@vitest/eslint-plugin": "^1.1.12",
63
+ "@unocss/eslint-plugin": "^0.65.0",
64
+ "@vitest/eslint-plugin": "^1.1.13",
65
65
  "eslint-config-flat-gitignore": "^0.3.0",
66
66
  "eslint-flat-config-utils": "^0.4.0",
67
67
  "eslint-merge-processors": "^0.1.0",
68
68
  "eslint-plugin-antfu": "^2.7.0",
69
69
  "eslint-plugin-command": "^0.2.6",
70
70
  "eslint-plugin-format": "^0.1.3",
71
- "eslint-plugin-github-action": "^0.0.6",
71
+ "eslint-plugin-github-action": "^0.0.8",
72
72
  "eslint-plugin-import-x": "^4.4.3",
73
73
  "eslint-plugin-jsdoc": "^50.6.0",
74
74
  "eslint-plugin-jsonc": "^2.18.2",
@@ -77,13 +77,13 @@
77
77
  "eslint-plugin-perfectionist": "^4.1.2",
78
78
  "eslint-plugin-prettier": "^5.2.1",
79
79
  "eslint-plugin-regexp": "^2.7.0",
80
- "eslint-plugin-toml": "^0.11.1",
80
+ "eslint-plugin-toml": "^0.12.0",
81
81
  "eslint-plugin-unicorn": "^56.0.1",
82
82
  "eslint-plugin-unused-imports": "^4.1.4",
83
83
  "eslint-plugin-vue": "^9.32.0",
84
- "eslint-plugin-yml": "^1.15.0",
84
+ "eslint-plugin-yml": "^1.16.0",
85
85
  "eslint-processor-vue-blocks": "^0.1.2",
86
- "globals": "^15.12.0",
86
+ "globals": "^15.13.0",
87
87
  "jsonc-eslint-parser": "^2.4.0",
88
88
  "local-pkg": "^0.5.1",
89
89
  "prettier": "^3.4.1",
@@ -106,7 +106,7 @@
106
106
  "tsup": "^8.3.5",
107
107
  "tsx": "^4.19.2",
108
108
  "typescript": "^5.7.2",
109
- "vitest": "^2.1.6",
109
+ "vitest": "^2.1.7",
110
110
  "zx": "^8.2.4"
111
111
  },
112
112
  "engines": {