@shell-shock/eslint-plugin 0.0.85 → 0.0.87

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 (46) hide show
  1. package/README.md +16 -7
  2. package/dist/configs/base.cjs +1 -1
  3. package/dist/configs/base.d.cts +2 -2
  4. package/dist/configs/base.d.cts.map +1 -1
  5. package/dist/configs/base.d.mts +1 -2
  6. package/dist/configs/base.mjs +1 -1
  7. package/dist/configs/index.cjs +1 -1
  8. package/dist/configs/index.d.cts +0 -1
  9. package/dist/configs/index.d.cts.map +1 -1
  10. package/dist/configs/index.d.mts +0 -1
  11. package/dist/configs/index.mjs +1 -1
  12. package/dist/configs/recommended.cjs +1 -1
  13. package/dist/configs/recommended.d.cts +2 -2
  14. package/dist/configs/recommended.d.cts.map +1 -1
  15. package/dist/configs/recommended.d.mts +1 -2
  16. package/dist/configs/recommended.mjs +1 -1
  17. package/dist/helpers/create-rule.cjs +1 -1
  18. package/dist/helpers/create-rule.d.cts +1 -0
  19. package/dist/helpers/create-rule.d.cts.map +1 -1
  20. package/dist/helpers/create-rule.d.mts +1 -0
  21. package/dist/helpers/create-rule.mjs +1 -1
  22. package/dist/index.d.cts +2 -3
  23. package/dist/index.d.cts.map +1 -1
  24. package/dist/index.d.mts +2 -3
  25. package/dist/package.cjs +1 -1
  26. package/dist/package.mjs +1 -1
  27. package/dist/plugin.d.cts +0 -1
  28. package/dist/plugin.d.cts.map +1 -1
  29. package/dist/plugin.d.mts +0 -1
  30. package/dist/rules/duplicate-command-path.cjs +2 -2
  31. package/dist/rules/duplicate-command-path.d.cts +2 -3
  32. package/dist/rules/duplicate-command-path.d.cts.map +1 -1
  33. package/dist/rules/duplicate-command-path.d.mts +2 -3
  34. package/dist/rules/duplicate-command-path.mjs +2 -2
  35. package/dist/rules/invalid-command-export.cjs +1 -1
  36. package/dist/rules/invalid-command-export.d.cts +2 -3
  37. package/dist/rules/invalid-command-export.d.cts.map +1 -1
  38. package/dist/rules/invalid-command-export.d.mts +2 -3
  39. package/dist/rules/invalid-command-export.mjs +1 -1
  40. package/dist/rules/invalid-handler-params.cjs +2 -2
  41. package/dist/rules/invalid-handler-params.d.cts +2 -3
  42. package/dist/rules/invalid-handler-params.d.cts.map +1 -1
  43. package/dist/rules/invalid-handler-params.d.mts +2 -3
  44. package/dist/rules/invalid-handler-params.mjs +2 -2
  45. package/package.json +14 -14
  46. package/dist/_virtual/_rolldown/runtime.cjs +0 -1
package/README.md CHANGED
@@ -5,9 +5,9 @@
5
5
 
6
6
  <div align="center">
7
7
  <picture>
8
- <source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/shell-shock/banner-1280x640-dark.gif">
9
- <source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/shell-shock/banner-1280x640-light.gif">
10
- <img src="https://public.storm-cdn.com/shell-shock/banner-1280x640-dark.gif" width="100%" alt="Storm Software" />
8
+ <source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/shell-shock/media/banner-1280x640-dark.gif">
9
+ <source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/shell-shock/media/banner-1280x640-light.gif">
10
+ <img src="https://public.storm-cdn.com/shell-shock/media/banner-1280x640-dark.gif" width="100%" alt="Storm Software" />
11
11
  </picture>
12
12
  </div>
13
13
  <br />
@@ -243,9 +243,9 @@ specification. Contributions of any kind welcome!
243
243
 
244
244
  <div align="center">
245
245
  <picture>
246
- <source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/storm-software/banner-1280x320-dark.webp">
247
- <source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/storm-software/banner-1280x320-light.webp">
248
- <img src="https://public.storm-cdn.com/storm-software/banner-1280x320-dark.webp" width="100%" alt="Storm Software" />
246
+ <source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/storm-software/media/banner-1280x320-dark.webp">
247
+ <source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/storm-software/media/banner-1280x320-light.webp">
248
+ <img src="https://public.storm-cdn.com/storm-software/media/banner-1280x320-dark.webp" width="100%" alt="Storm Software" />
249
249
  </picture>
250
250
  </div>
251
251
  <br />
@@ -277,8 +277,17 @@ generation of development tools, please reach out on our
277
277
 
278
278
  <br />
279
279
 
280
- <div align="center"><a href="https://stormsoftware.com" target="_blank"><img src="https://public.storm-cdn.com/storm-software/icon-circle-fill-dark.png" alt="Storm Software" width="200px"/></a></div>
280
+ <div align="center">
281
+ <a href="https://stormsoftware.com" target="_blank">
282
+ <picture>
283
+ <source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/storm-software/icons/circle-dark.webp">
284
+ <source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/storm-software/icons/circle-light.webp">
285
+ <img src="https://public.storm-cdn.com/storm-software/icons/circle-dark.webp" width="200px" alt="Storm Software" />
286
+ </picture>
287
+ </a>
288
+ </div>
281
289
  <br />
290
+
282
291
  <div align="center"><a href="https://stormsoftware.com" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/misc/text/visit-us-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/misc/text/visit-us-light.png"><img src="https://public.storm-cdn.com/misc/text/visit-us-dark.png" height="90px" alt="Visit us at stormsoftware.com" /></picture></a></div>
283
292
 
284
293
  <br />
@@ -1 +1 @@
1
- const e={files:[`**/*.{,c,m}{j,t}s{,x}`],name:`shell-shock:base`,plugins:{"shell-shock":require("../plugin.cjs").plugin},ignores:[`.shell-shock`],rules:{"shell-shock/duplicate-command-path":`warn`,"shell-shock/invalid-command-export":`error`,"shell-shock/invalid-handler-params":`error`}};module.exports=e;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e={files:[`**/*.{,c,m}{j,t}s{,x}`],name:`shell-shock:base`,plugins:{"shell-shock":require("../plugin.cjs").plugin},ignores:[`.shell-shock`],rules:{"shell-shock/duplicate-command-path":`warn`,"shell-shock/invalid-command-export":`error`,"shell-shock/invalid-handler-params":`error`}};exports.config=e,exports.default=e;
@@ -1,6 +1,6 @@
1
1
  import { Linter } from "eslint";
2
-
3
2
  //#region src/configs/base.d.ts
4
3
  declare const config: Linter.Config;
5
- export = config;
4
+ //#endregion
5
+ export { config, config as default };
6
6
  //# sourceMappingURL=base.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.cts","names":[],"sources":["../../src/configs/base.ts"],"mappings":";;;cAqBM,MAAA,EAAQ,MAAA,CAAO,MAYpB;AAAA"}
1
+ {"version":3,"file":"base.d.cts","names":[],"sources":["../../src/configs/base.ts"],"mappings":";;cAqBa,QAAQ,OAAO"}
@@ -1,7 +1,6 @@
1
1
  import { Linter } from "eslint";
2
-
3
2
  //#region src/configs/base.d.ts
4
3
  declare const config: Linter.Config;
5
4
  //#endregion
6
- export { config as default };
5
+ export { config, config as default };
7
6
  //# sourceMappingURL=base.d.mts.map
@@ -1,2 +1,2 @@
1
- import{plugin as e}from"../plugin.mjs";const t={files:[`**/*.{,c,m}{j,t}s{,x}`],name:`shell-shock:base`,plugins:{"shell-shock":e},ignores:[`.shell-shock`],rules:{"shell-shock/duplicate-command-path":`warn`,"shell-shock/invalid-command-export":`error`,"shell-shock/invalid-handler-params":`error`}};export{t as default};
1
+ import{plugin as e}from"../plugin.mjs";const t={files:[`**/*.{,c,m}{j,t}s{,x}`],name:`shell-shock:base`,plugins:{"shell-shock":e},ignores:[`.shell-shock`],rules:{"shell-shock/duplicate-command-path":`warn`,"shell-shock/invalid-command-export":`error`,"shell-shock/invalid-handler-params":`error`}};export{t as config,t as default};
2
2
  //# sourceMappingURL=base.mjs.map
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e={base:require("./base.cjs"),recommended:require("./recommended.cjs")};exports.configs=e;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./base.cjs"),t=require("./recommended.cjs"),n={base:e.config,recommended:t.config};exports.configs=n;
@@ -1,5 +1,4 @@
1
1
  import { Linter } from "eslint";
2
-
3
2
  //#region src/configs/index.d.ts
4
3
  declare const configs: Record<string, Linter.Config>;
5
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/configs/index.ts"],"mappings":";;;cAsBa,OAAA,EAAS,MAAM,SAAS,MAAA,CAAO,MAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/configs/index.ts"],"mappings":";;cAsBa,SAAS,eAAe,OAAO"}
@@ -1,5 +1,4 @@
1
1
  import { Linter } from "eslint";
2
-
3
2
  //#region src/configs/index.d.ts
4
3
  declare const configs: Record<string, Linter.Config>;
5
4
  //#endregion
@@ -1,2 +1,2 @@
1
- import e from"./base.mjs";import t from"./recommended.mjs";const n={base:e,recommended:t};export{n as configs};
1
+ import{config as e}from"./base.mjs";import{config as t}from"./recommended.mjs";const n={base:e,recommended:t};export{n as configs};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- const e={files:[`**/*.{,c,m}{j,t}s{,x}`],name:`shell-shock:recommended`,plugins:{"shell-shock":require("../plugin.cjs").plugin},ignores:[`.shell-shock`],rules:{"shell-shock/duplicate-command-path":`warn`,"shell-shock/invalid-command-export":`error`,"shell-shock/invalid-handler-params":`error`}};module.exports=e;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e={files:[`**/*.{,c,m}{j,t}s{,x}`],name:`shell-shock:recommended`,plugins:{"shell-shock":require("../plugin.cjs").plugin},ignores:[`.shell-shock`],rules:{"shell-shock/duplicate-command-path":`warn`,"shell-shock/invalid-command-export":`error`,"shell-shock/invalid-handler-params":`error`}};exports.config=e,exports.default=e;
@@ -1,6 +1,6 @@
1
1
  import { Linter } from "eslint";
2
-
3
2
  //#region src/configs/recommended.d.ts
4
3
  declare const config: Linter.Config;
5
- export = config;
4
+ //#endregion
5
+ export { config, config as default };
6
6
  //# sourceMappingURL=recommended.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recommended.d.cts","names":[],"sources":["../../src/configs/recommended.ts"],"mappings":";;;cAqBM,MAAA,EAAQ,MAAA,CAAO,MAYpB;AAAA"}
1
+ {"version":3,"file":"recommended.d.cts","names":[],"sources":["../../src/configs/recommended.ts"],"mappings":";;cAqBa,QAAQ,OAAO"}
@@ -1,7 +1,6 @@
1
1
  import { Linter } from "eslint";
2
-
3
2
  //#region src/configs/recommended.d.ts
4
3
  declare const config: Linter.Config;
5
4
  //#endregion
6
- export { config as default };
5
+ export { config, config as default };
7
6
  //# sourceMappingURL=recommended.d.mts.map
@@ -1,2 +1,2 @@
1
- import{plugin as e}from"../plugin.mjs";const t={files:[`**/*.{,c,m}{j,t}s{,x}`],name:`shell-shock:recommended`,plugins:{"shell-shock":e},ignores:[`.shell-shock`],rules:{"shell-shock/duplicate-command-path":`warn`,"shell-shock/invalid-command-export":`error`,"shell-shock/invalid-handler-params":`error`}};export{t as default};
1
+ import{plugin as e}from"../plugin.mjs";const t={files:[`**/*.{,c,m}{j,t}s{,x}`],name:`shell-shock:recommended`,plugins:{"shell-shock":e},ignores:[`.shell-shock`],rules:{"shell-shock/duplicate-command-path":`warn`,"shell-shock/invalid-command-export":`error`,"shell-shock/invalid-handler-params":`error`}};export{t as config,t as default};
2
2
  //# sourceMappingURL=recommended.mjs.map
@@ -1 +1 @@
1
- const e=require("../_virtual/_rolldown/runtime.cjs");let t=require("defu");t=e.__toESM(t,1);function n(e){return function({name:t,meta:n,...i}){return r({meta:{...n,docs:{...n.docs,url:e(t)}},...i})}}function r({create:e,defaultOptions:n,meta:r}){return{create:(r=>e(r,r.options.map((e,r)=>(0,t.default)(n?.[r]??{},e)))),defaultOptions:n??{},meta:r}}const i=n(e=>`https://docs.stormsoftware.com/projects/shell-shock/eslint/rules/${e}.md`);exports.createRule=i;
1
+ let e=require("defu");function t(e){return function({name:t,meta:r,...i}){return n({meta:{...r,docs:{...r.docs,url:e(t)}},...i})}}function n({create:t,defaultOptions:n,meta:r}){return{create:(r=>t(r,r.options.map((t,r)=>(0,e.defu)(n?.[r]??{},t)))),defaultOptions:n??{},meta:r}}const r=t(e=>`https://docs.stormsoftware.com/projects/shell-shock/eslint/rules/${e}.md`);exports.createRule=r;
@@ -1,4 +1,5 @@
1
1
  import { Rule } from "eslint";
2
+ import "@typescript-eslint/utils/eslint-utils";
2
3
  //#region src/helpers/create-rule.d.ts
3
4
  type RuleModule<T extends readonly unknown[]> = Rule.RuleModule & {
4
5
  defaultOptions: T;
@@ -1 +1 @@
1
- {"version":3,"file":"create-rule.d.cts","names":[],"sources":["../../src/helpers/create-rule.ts"],"mappings":";;KA2BY,UAAA,iCAA2C,IAAA,CAAK,UAAA;EAC1D,cAAA,EAAgB,CAAC;AAAA"}
1
+ {"version":3,"file":"create-rule.d.cts","names":[],"sources":["../../src/helpers/create-rule.ts"],"mappings":";;;KA2BY,WAAW,gCAAgC,KAAK;EAC1D,gBAAgB"}
@@ -1,4 +1,5 @@
1
1
  import { Rule } from "eslint";
2
+ import "@typescript-eslint/utils/eslint-utils";
2
3
  //#region src/helpers/create-rule.d.ts
3
4
  type RuleModule<T extends readonly unknown[]> = Rule.RuleModule & {
4
5
  defaultOptions: T;
@@ -1,2 +1,2 @@
1
- import e from"defu";function t(e){return function({name:t,meta:r,...i}){return n({meta:{...r,docs:{...r.docs,url:e(t)}},...i})}}function n({create:t,defaultOptions:n,meta:r}){return{create:(r=>t(r,r.options.map((t,r)=>e(n?.[r]??{},t)))),defaultOptions:n??{},meta:r}}const r=t(e=>`https://docs.stormsoftware.com/projects/shell-shock/eslint/rules/${e}.md`);export{r as createRule};
1
+ import{defu as e}from"defu";function t(e){return function({name:t,meta:r,...i}){return n({meta:{...r,docs:{...r.docs,url:e(t)}},...i})}}function n({create:t,defaultOptions:n,meta:r}){return{create:(r=>t(r,r.options.map((t,r)=>e(n?.[r]??{},t)))),defaultOptions:n??{},meta:r}}const r=t(e=>`https://docs.stormsoftware.com/projects/shell-shock/eslint/rules/${e}.md`);export{r as createRule};
2
2
  //# sourceMappingURL=create-rule.mjs.map
package/dist/index.d.cts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { configs } from "./configs/index.cjs";
2
2
  import { plugin } from "./plugin.cjs";
3
3
  import { ESLint, Linter } from "eslint";
4
-
5
4
  //#region src/index.d.ts
6
5
  /**
7
6
  * A shared ESLint configuration containing globals used in Storm Stack projects
@@ -18,8 +17,8 @@ import { ESLint, Linter } from "eslint";
18
17
  */
19
18
  declare const eslintPlugin: ESLint.Plugin;
20
19
  type RuleDefinitions = (typeof plugin)["rules"];
21
- type RuleOptions = { [K in keyof RuleDefinitions]: RuleDefinitions[K]["defaultOptions"] };
22
- type Rules = { [K in keyof RuleOptions]: Linter.RuleEntry<RuleOptions[K]> };
20
+ type RuleOptions = { [K in keyof RuleDefinitions]: RuleDefinitions[K]["defaultOptions"]; };
21
+ type Rules = { [K in keyof RuleOptions]: Linter.RuleEntry<RuleOptions[K]>; };
23
22
  //#endregion
24
23
  export { RuleOptions, Rules, configs, eslintPlugin as default };
25
24
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;AAoBkC;;;;AAmBjC;AAIkB;;;;AAEkB;AAErC;cAXM,YAAA,EAAc,MAAA,CAAO,MAG1B;AAAA,KAMI,eAAA,WAA0B,MAAM;AAAA,KAEzB,WAAA,iBACE,eAAA,GAAkB,eAAA,CAAgB,CAAA;AAAA,KAGpC,KAAA,iBACE,WAAA,GAAc,MAAA,CAAO,SAAA,CAAU,WAAA,CAAY,CAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;cAoCM,cAAc,OAAO;KAStB,0BAA0B;KAEnB,iBACT,WAAW,kBAAkB,gBAAgB;KAGpC,WACT,WAAW,cAAc,OAAO,UAAU,YAAY"}
package/dist/index.d.mts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { configs } from "./configs/index.mjs";
2
2
  import { plugin } from "./plugin.mjs";
3
3
  import { ESLint, Linter } from "eslint";
4
-
5
4
  //#region src/index.d.ts
6
5
  /**
7
6
  * A shared ESLint configuration containing globals used in Storm Stack projects
@@ -18,8 +17,8 @@ import { ESLint, Linter } from "eslint";
18
17
  */
19
18
  declare const eslintPlugin: ESLint.Plugin;
20
19
  type RuleDefinitions = (typeof plugin)["rules"];
21
- type RuleOptions = { [K in keyof RuleDefinitions]: RuleDefinitions[K]["defaultOptions"] };
22
- type Rules = { [K in keyof RuleOptions]: Linter.RuleEntry<RuleOptions[K]> };
20
+ type RuleOptions = { [K in keyof RuleDefinitions]: RuleDefinitions[K]["defaultOptions"]; };
21
+ type Rules = { [K in keyof RuleOptions]: Linter.RuleEntry<RuleOptions[K]>; };
23
22
  //#endregion
24
23
  export { RuleOptions, Rules, configs, eslintPlugin as default };
25
24
  //# sourceMappingURL=index.d.mts.map
package/dist/package.cjs CHANGED
@@ -1 +1 @@
1
- var e=`0.0.84`;Object.defineProperty(exports,"version",{enumerable:!0,get:function(){return e}});
1
+ Object.defineProperty(exports,"version",{enumerable:!0,get:function(){return`0.0.86`}});
package/dist/package.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var e=`0.0.84`;export{e as version};
1
+ var e=`0.0.86`;export{e as version};
2
2
  //# sourceMappingURL=package.mjs.map
package/dist/plugin.d.cts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { RuleModule } from "./helpers/create-rule.cjs";
2
-
3
2
  //#region src/plugin.d.ts
4
3
  declare const plugin: {
5
4
  meta: {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;cAwBa,MAAA;;;;;;8BAUY,UAAA"}
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../src/plugin.ts"],"mappings":";;cAwBa;;;;;;8BAAA"}
package/dist/plugin.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { RuleModule } from "./helpers/create-rule.mjs";
2
-
3
2
  //#region src/plugin.d.ts
4
3
  declare const plugin: {
5
4
  meta: {
@@ -1,2 +1,2 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../helpers/create-rule.cjs");let t=require("@stryke/fs/is-file"),n=require("@stryke/fs/list-files"),r=require("@stryke/path/file-path-fns"),i=require("@stryke/path/join"),a=require("@stryke/path/resolve-parent-path"),o=require("node:fs");const s=`duplicate-command-path`;var c=e.createRule({name:s,meta:{type:`problem`,docs:{description:`Multiple command files found in the same directory. This can lead to unexpected behavior. Please ensure that there is only one command file per directory.`},schema:[],messages:{duplicateCommandPath:`Multiple command files found in the same directory. This can lead to unexpected behavior. Please ensure that there is only one command file per directory: {{#duplicates}}
2
- - {{.}}{{/duplicates}}`}},defaultOptions:[],create:e=>({Program(s){let c=e.filename??e.getFilename();if((0,r.findFileName)(c,{withExtension:!1})!==`command`)return;let l=(0,r.findFilePath)(c);if(!l)return;let u=(0,n.listSync)(l).filter(e=>(0,t.isDirectory)(e)&&((0,r.findFileName)(e).startsWith(`(`)&&(0,r.findFileName)(e).startsWith(`(`)||(0,r.findFileName)(e).startsWith(`_`))&&(0,o.existsSync)((0,i.joinPaths)(e,`command.ts`)));u.length>1&&e.report({node:s,messageId:`duplicateCommandPath`,data:{duplicates:u}});let d=(0,a.resolveParentPath)(c);((0,r.findFolderName)(d).startsWith(`(`)&&(0,r.findFolderName)(d).startsWith(`(`)||(0,r.findFolderName)(d).startsWith(`_`))&&(0,o.existsSync)((0,i.joinPaths)(d,`command.ts`))&&e.report({node:s,messageId:`duplicateCommandPath`,data:{duplicates:[d]}})}})});exports.RULE_NAME=s,exports.default=c;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../helpers/create-rule.cjs");let t=require("@stryke/fs/is-file"),n=require("@stryke/fs/list-files"),r=require("@stryke/path/file-path-fns"),i=require("@stryke/path/join"),a=require("@stryke/path/resolve-parent-path"),o=require("node:fs");const s=`duplicate-command-path`,c=e.createRule({name:s,meta:{type:`problem`,docs:{description:`Multiple command files found in the same directory. This can lead to unexpected behavior. Please ensure that there is only one command file per directory.`},schema:[],messages:{duplicateCommandPath:`Multiple command files found in the same directory. This can lead to unexpected behavior. Please ensure that there is only one command file per directory: {{#duplicates}}
2
+ - {{.}}{{/duplicates}}`}},defaultOptions:[],create:e=>({Program(s){let c=e.filename??e.getFilename();if((0,r.findFileName)(c,{withExtension:!1})!==`command`)return;let l=(0,r.findFilePath)(c);if(!l)return;let u=(0,n.listSync)(l).filter(e=>(0,t.isDirectory)(e)&&((0,r.findFileName)(e).startsWith(`(`)&&(0,r.findFileName)(e).startsWith(`(`)||(0,r.findFileName)(e).startsWith(`_`))&&(0,o.existsSync)((0,i.joinPaths)(e,`command.ts`)));u.length>1&&e.report({node:s,messageId:`duplicateCommandPath`,data:{duplicates:u}});let d=(0,a.resolveParentPath)(c);((0,r.findFolderName)(d).startsWith(`(`)&&(0,r.findFolderName)(d).startsWith(`(`)||(0,r.findFolderName)(d).startsWith(`_`))&&(0,o.existsSync)((0,i.joinPaths)(d,`command.ts`))&&e.report({node:s,messageId:`duplicateCommandPath`,data:{duplicates:[d]}})}})});exports.RULE_NAME=s,exports.default=c,exports.rule=c;
@@ -1,10 +1,9 @@
1
1
  import { RuleModule } from "../helpers/create-rule.cjs";
2
-
3
2
  //#region src/rules/duplicate-command-path.d.ts
4
3
  declare const RULE_NAME = "duplicate-command-path";
5
4
  type MessageIds = "duplicateCommandPath";
6
5
  type Options = [];
7
- declare const _default: RuleModule<[]>;
6
+ declare const rule: RuleModule<[]>;
8
7
  //#endregion
9
- export { MessageIds, Options, RULE_NAME, _default as default };
8
+ export { MessageIds, Options, RULE_NAME, rule as default, rule };
10
9
  //# sourceMappingURL=duplicate-command-path.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"duplicate-command-path.d.cts","names":[],"sources":["../../src/rules/duplicate-command-path.ts"],"mappings":";;;cA8Ba,SAAA;AAAA,KACD,UAAA;AAAA,KACA,OAAA;AAAA,cAAa,QAAA"}
1
+ {"version":3,"file":"duplicate-command-path.d.cts","names":[],"sources":["../../src/rules/duplicate-command-path.ts"],"mappings":";;cA8Ba;KACD;KACA;cAEC,MAAA"}
@@ -1,10 +1,9 @@
1
1
  import { RuleModule } from "../helpers/create-rule.mjs";
2
-
3
2
  //#region src/rules/duplicate-command-path.d.ts
4
3
  declare const RULE_NAME = "duplicate-command-path";
5
4
  type MessageIds = "duplicateCommandPath";
6
5
  type Options = [];
7
- declare const _default: RuleModule<[]>;
6
+ declare const rule: RuleModule<[]>;
8
7
  //#endregion
9
- export { MessageIds, Options, RULE_NAME, _default as default };
8
+ export { MessageIds, Options, RULE_NAME, rule as default, rule };
10
9
  //# sourceMappingURL=duplicate-command-path.d.mts.map
@@ -1,3 +1,3 @@
1
- import{createRule as e}from"../helpers/create-rule.mjs";import{isDirectory as t}from"@stryke/fs/is-file";import{listSync as n}from"@stryke/fs/list-files";import{findFileName as r,findFilePath as i,findFolderName as a}from"@stryke/path/file-path-fns";import{joinPaths as o}from"@stryke/path/join";import{resolveParentPath as s}from"@stryke/path/resolve-parent-path";import{existsSync as c}from"node:fs";const l=`duplicate-command-path`;var u=e({name:l,meta:{type:`problem`,docs:{description:`Multiple command files found in the same directory. This can lead to unexpected behavior. Please ensure that there is only one command file per directory.`},schema:[],messages:{duplicateCommandPath:`Multiple command files found in the same directory. This can lead to unexpected behavior. Please ensure that there is only one command file per directory: {{#duplicates}}
2
- - {{.}}{{/duplicates}}`}},defaultOptions:[],create:e=>({Program(l){let u=e.filename??e.getFilename();if(r(u,{withExtension:!1})!==`command`)return;let d=i(u);if(!d)return;let f=n(d).filter(e=>t(e)&&(r(e).startsWith(`(`)&&r(e).startsWith(`(`)||r(e).startsWith(`_`))&&c(o(e,`command.ts`)));f.length>1&&e.report({node:l,messageId:`duplicateCommandPath`,data:{duplicates:f}});let p=s(u);(a(p).startsWith(`(`)&&a(p).startsWith(`(`)||a(p).startsWith(`_`))&&c(o(p,`command.ts`))&&e.report({node:l,messageId:`duplicateCommandPath`,data:{duplicates:[p]}})}})});export{l as RULE_NAME,u as default};
1
+ import{createRule as e}from"../helpers/create-rule.mjs";import{isDirectory as t}from"@stryke/fs/is-file";import{listSync as n}from"@stryke/fs/list-files";import{findFileName as r,findFilePath as i,findFolderName as a}from"@stryke/path/file-path-fns";import{joinPaths as o}from"@stryke/path/join";import{resolveParentPath as s}from"@stryke/path/resolve-parent-path";import{existsSync as c}from"node:fs";const l=`duplicate-command-path`,u=e({name:l,meta:{type:`problem`,docs:{description:`Multiple command files found in the same directory. This can lead to unexpected behavior. Please ensure that there is only one command file per directory.`},schema:[],messages:{duplicateCommandPath:`Multiple command files found in the same directory. This can lead to unexpected behavior. Please ensure that there is only one command file per directory: {{#duplicates}}
2
+ - {{.}}{{/duplicates}}`}},defaultOptions:[],create:e=>({Program(l){let u=e.filename??e.getFilename();if(r(u,{withExtension:!1})!==`command`)return;let d=i(u);if(!d)return;let f=n(d).filter(e=>t(e)&&(r(e).startsWith(`(`)&&r(e).startsWith(`(`)||r(e).startsWith(`_`))&&c(o(e,`command.ts`)));f.length>1&&e.report({node:l,messageId:`duplicateCommandPath`,data:{duplicates:f}});let p=s(u);(a(p).startsWith(`(`)&&a(p).startsWith(`(`)||a(p).startsWith(`_`))&&c(o(p,`command.ts`))&&e.report({node:l,messageId:`duplicateCommandPath`,data:{duplicates:[p]}})}})});export{l as RULE_NAME,u as default,u as rule};
3
3
  //# sourceMappingURL=duplicate-command-path.mjs.map
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../helpers/create-rule.cjs");let t=require("@stryke/path/file-path-fns");const n=`invalid-command-export`;var r=e.createRule({name:n,meta:{type:`problem`,docs:{description:`A command module must have a handler function as it's default export.`},schema:[],messages:{invalidExport:`A command module must have a handler function as it's default export.`}},defaultOptions:[],create:e=>({Program(n){if((0,t.findFileName)(e.filename??e.getFilename(),{withExtension:!1})===`command`){for(let t of n.body)if(t.type===`ExportDefaultDeclaration`){if(t.declaration.type===`FunctionDeclaration`)return;if(t.declaration.type===`Identifier`){let e=t.declaration.name;if(n.body.some(t=>t.type===`FunctionDeclaration`&&t.id.name===e||t.type===`VariableDeclaration`&&t.declarations.find(t=>t.id?.type===`Identifier`&&t.id.name===e)))return}e.report({node:t,messageId:`invalidExport`})}}}})});exports.RULE_NAME=n,exports.default=r;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../helpers/create-rule.cjs");let t=require("@stryke/path/file-path-fns");const n=`invalid-command-export`,r=e.createRule({name:n,meta:{type:`problem`,docs:{description:`A command module must have a handler function as it's default export.`},schema:[],messages:{invalidExport:`A command module must have a handler function as it's default export.`}},defaultOptions:[],create:e=>({Program(n){let r=e.filename??e.getFilename();if((0,t.findFileName)(r,{withExtension:!1})===`command`){for(let t of n.body)if(t.type===`ExportDefaultDeclaration`){if(t.declaration.type===`FunctionDeclaration`)return;if(t.declaration.type===`Identifier`){let e=t.declaration.name;if(n.body.some(t=>t.type===`FunctionDeclaration`&&t.id.name===e||t.type===`VariableDeclaration`&&t.declarations.find(t=>t.id?.type===`Identifier`&&t.id.name===e)))return}e.report({node:t,messageId:`invalidExport`})}}}})});exports.RULE_NAME=n,exports.default=r,exports.rule=r;
@@ -1,10 +1,9 @@
1
1
  import { RuleModule } from "../helpers/create-rule.cjs";
2
-
3
2
  //#region src/rules/invalid-command-export.d.ts
4
3
  declare const RULE_NAME = "invalid-command-export";
5
4
  type MessageIds = "invalidExport";
6
5
  type Options = [];
7
- declare const _default: RuleModule<[]>;
6
+ declare const rule: RuleModule<[]>;
8
7
  //#endregion
9
- export { MessageIds, Options, RULE_NAME, _default as default };
8
+ export { MessageIds, Options, RULE_NAME, rule as default, rule };
10
9
  //# sourceMappingURL=invalid-command-export.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"invalid-command-export.d.cts","names":[],"sources":["../../src/rules/invalid-command-export.ts"],"mappings":";;;cAqBa,SAAA;AAAA,KACD,UAAA;AAAA,KACA,OAAA;AAAA,cAAa,QAAA"}
1
+ {"version":3,"file":"invalid-command-export.d.cts","names":[],"sources":["../../src/rules/invalid-command-export.ts"],"mappings":";;cAqBa;KACD;KACA;cAEC,MAAA"}
@@ -1,10 +1,9 @@
1
1
  import { RuleModule } from "../helpers/create-rule.mjs";
2
-
3
2
  //#region src/rules/invalid-command-export.d.ts
4
3
  declare const RULE_NAME = "invalid-command-export";
5
4
  type MessageIds = "invalidExport";
6
5
  type Options = [];
7
- declare const _default: RuleModule<[]>;
6
+ declare const rule: RuleModule<[]>;
8
7
  //#endregion
9
- export { MessageIds, Options, RULE_NAME, _default as default };
8
+ export { MessageIds, Options, RULE_NAME, rule as default, rule };
10
9
  //# sourceMappingURL=invalid-command-export.d.mts.map
@@ -1,2 +1,2 @@
1
- import{createRule as e}from"../helpers/create-rule.mjs";import{findFileName as t}from"@stryke/path/file-path-fns";const n=`invalid-command-export`;var r=e({name:n,meta:{type:`problem`,docs:{description:`A command module must have a handler function as it's default export.`},schema:[],messages:{invalidExport:`A command module must have a handler function as it's default export.`}},defaultOptions:[],create:e=>({Program(n){if(t(e.filename??e.getFilename(),{withExtension:!1})===`command`){for(let t of n.body)if(t.type===`ExportDefaultDeclaration`){if(t.declaration.type===`FunctionDeclaration`)return;if(t.declaration.type===`Identifier`){let e=t.declaration.name;if(n.body.some(t=>t.type===`FunctionDeclaration`&&t.id.name===e||t.type===`VariableDeclaration`&&t.declarations.find(t=>t.id?.type===`Identifier`&&t.id.name===e)))return}e.report({node:t,messageId:`invalidExport`})}}}})});export{n as RULE_NAME,r as default};
1
+ import{createRule as e}from"../helpers/create-rule.mjs";import{findFileName as t}from"@stryke/path/file-path-fns";const n=`invalid-command-export`,r=e({name:n,meta:{type:`problem`,docs:{description:`A command module must have a handler function as it's default export.`},schema:[],messages:{invalidExport:`A command module must have a handler function as it's default export.`}},defaultOptions:[],create:e=>({Program(n){let r=e.filename??e.getFilename();if(t(r,{withExtension:!1})===`command`){for(let t of n.body)if(t.type===`ExportDefaultDeclaration`){if(t.declaration.type===`FunctionDeclaration`)return;if(t.declaration.type===`Identifier`){let e=t.declaration.name;if(n.body.some(t=>t.type===`FunctionDeclaration`&&t.id.name===e||t.type===`VariableDeclaration`&&t.declarations.find(t=>t.id?.type===`Identifier`&&t.id.name===e)))return}e.report({node:t,messageId:`invalidExport`})}}}})});export{n as RULE_NAME,r as default,r as rule};
2
2
  //# sourceMappingURL=invalid-command-export.mjs.map
@@ -1,4 +1,4 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../helpers/create-rule.cjs");let t=require("@stryke/path/file-path-fns"),n=require("@typescript-eslint/utils");const r=`invalid-handler-params`;function i(e){switch(e.type){case n.AST_NODE_TYPES.Identifier:return e.typeAnnotation?e.typeAnnotation.typeAnnotation:null;case n.AST_NODE_TYPES.AssignmentPattern:{let t=e.left;return t.type===n.AST_NODE_TYPES.Identifier&&t.typeAnnotation?t.typeAnnotation.typeAnnotation:null}case n.AST_NODE_TYPES.RestElement:{let t=e.argument;return t.type===n.AST_NODE_TYPES.Identifier&&t.typeAnnotation?t.typeAnnotation.typeAnnotation:null}case n.AST_NODE_TYPES.ArrayPattern:case n.AST_NODE_TYPES.ObjectPattern:case n.AST_NODE_TYPES.TSParameterProperty:default:return null}}function a(e,t){if(t.params.length>0&&t.params[0]){let r=i(t.params[0]);if(!r)return!1;if(r.type===n.AST_NODE_TYPES.TSTypeLiteral&&r.members.some(e=>e.type===n.AST_NODE_TYPES.TSPropertySignature)||r.type===n.AST_NODE_TYPES.TSIntersectionType&&r.types.some(e=>e.type===n.AST_NODE_TYPES.TSTypeLiteral&&e.members.some(e=>e.type===n.AST_NODE_TYPES.TSPropertySignature)))return!0;if(r.type===n.AST_NODE_TYPES.TSTypeReference&&r.typeName.type===n.AST_NODE_TYPES.Identifier){let t=r.typeName.name;if(!e.some(e=>e.type===n.AST_NODE_TYPES.TSInterfaceDeclaration&&e.id.name===t||e.type===n.AST_NODE_TYPES.TSTypeAliasDeclaration&&e.id.name===t&&(e.typeAnnotation.type===n.AST_NODE_TYPES.TSTypeLiteral&&e.typeAnnotation.members.some(e=>e.type===n.AST_NODE_TYPES.TSPropertySignature)||e.typeAnnotation.type===n.AST_NODE_TYPES.TSIntersectionType&&e.typeAnnotation.types.some(e=>e.type===n.AST_NODE_TYPES.TSTypeLiteral&&e.members.some(e=>e.type===n.AST_NODE_TYPES.TSPropertySignature)))))return!0}}return!1}function o(e,t,r){(t.params.length>1||!a(e,t))&&(a(e,t)?t.params.slice(1):t.params).forEach(t=>{let a=i(t);a?.type!==n.AST_NODE_TYPES.TSStringKeyword&&a?.type!==n.AST_NODE_TYPES.TSNumberKeyword&&a?.type!==n.AST_NODE_TYPES.TSBooleanKeyword&&!(a?.type===n.AST_NODE_TYPES.TSUnionType&&a.types.every(e=>e.type===n.AST_NODE_TYPES.TSLiteralType&&e.literal.type===n.AST_NODE_TYPES.Literal&&(typeof e.literal.value==`string`||typeof e.literal.value==`number`||typeof e.literal.value==`boolean`)))&&!(a?.type===n.AST_NODE_TYPES.TSTypeReference&&a.typeName.type===n.AST_NODE_TYPES.Identifier&&e.some(e=>e.type===n.AST_NODE_TYPES.TSTypeAliasDeclaration&&e.id.name===a.typeName.name&&(e.typeAnnotation.type===n.AST_NODE_TYPES.TSStringKeyword||e.typeAnnotation.type===n.AST_NODE_TYPES.TSNumberKeyword||e.typeAnnotation.type===n.AST_NODE_TYPES.TSBooleanKeyword||e.typeAnnotation.type===n.AST_NODE_TYPES.TSUnionType&&e.typeAnnotation.types.every(e=>e.type===n.AST_NODE_TYPES.TSLiteralType&&e.literal.type===n.AST_NODE_TYPES.Literal&&(typeof e.literal.value==`string`||typeof e.literal.value==`number`||typeof e.literal.value==`boolean`)))))&&!(a?.type===n.AST_NODE_TYPES.TSArrayType&&(a.elementType.type===n.AST_NODE_TYPES.TSStringKeyword||a.elementType.type===n.AST_NODE_TYPES.TSNumberKeyword||a.elementType.type===n.AST_NODE_TYPES.TSBooleanKeyword||a.elementType.type===n.AST_NODE_TYPES.TSUnionType&&a.elementType.types.every(e=>e.type===n.AST_NODE_TYPES.TSLiteralType&&e.literal.type===n.AST_NODE_TYPES.Literal&&(typeof e.literal.value==`string`||typeof e.literal.value==`number`||typeof e.literal.value==`boolean`))||a.elementType.type===n.AST_NODE_TYPES.TSTypeReference&&a.elementType.typeName.type===n.AST_NODE_TYPES.Identifier&&e.some(e=>e.type===n.AST_NODE_TYPES.TSTypeAliasDeclaration&&e.id.name===a.elementType.typeName.name&&(e.typeAnnotation.type===n.AST_NODE_TYPES.TSStringKeyword||e.typeAnnotation.type===n.AST_NODE_TYPES.TSNumberKeyword||e.typeAnnotation.type===n.AST_NODE_TYPES.TSBooleanKeyword||e.typeAnnotation.type===n.AST_NODE_TYPES.TSUnionType&&e.typeAnnotation.types.every(e=>e.type===n.AST_NODE_TYPES.TSLiteralType&&e.literal.type===n.AST_NODE_TYPES.Literal&&(typeof e.literal.value==`string`||typeof e.literal.value==`number`||typeof e.literal.value==`boolean`))))))&&r.report({node:a,messageId:`invalidArgsParam`})})}var s=e.createRule({name:r,meta:{type:`problem`,docs:{description:`The command handler function must have a valid parameter types.`},schema:[],messages:{invalidArgsParam:`All command handler function parameters, with the potential exception of the first (which can represent the command's options), should represent the command's positional arguments. As a result, these parameters' types must be included in the following list:
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../helpers/create-rule.cjs");let t=require("@stryke/path/file-path-fns"),n=require("@typescript-eslint/utils");const r=`invalid-handler-params`;function i(e){switch(e.type){case n.AST_NODE_TYPES.Identifier:return e.typeAnnotation?e.typeAnnotation.typeAnnotation:null;case n.AST_NODE_TYPES.AssignmentPattern:{let t=e.left;return t.type===n.AST_NODE_TYPES.Identifier&&t.typeAnnotation?t.typeAnnotation.typeAnnotation:null}case n.AST_NODE_TYPES.RestElement:{let t=e.argument;return t.type===n.AST_NODE_TYPES.Identifier&&t.typeAnnotation?t.typeAnnotation.typeAnnotation:null}case n.AST_NODE_TYPES.ArrayPattern:case n.AST_NODE_TYPES.ObjectPattern:case n.AST_NODE_TYPES.TSParameterProperty:default:return null}}function a(e,t){if(t.params.length>0&&t.params[0]){let r=i(t.params[0]);if(!r)return!1;if(r.type===n.AST_NODE_TYPES.TSTypeLiteral&&r.members.some(e=>e.type===n.AST_NODE_TYPES.TSPropertySignature)||r.type===n.AST_NODE_TYPES.TSIntersectionType&&r.types.some(e=>e.type===n.AST_NODE_TYPES.TSTypeLiteral&&e.members.some(e=>e.type===n.AST_NODE_TYPES.TSPropertySignature)))return!0;if(r.type===n.AST_NODE_TYPES.TSTypeReference&&r.typeName.type===n.AST_NODE_TYPES.Identifier){let t=r.typeName.name;if(!e.some(e=>e.type===n.AST_NODE_TYPES.TSInterfaceDeclaration&&e.id.name===t||e.type===n.AST_NODE_TYPES.TSTypeAliasDeclaration&&e.id.name===t&&(e.typeAnnotation.type===n.AST_NODE_TYPES.TSTypeLiteral&&e.typeAnnotation.members.some(e=>e.type===n.AST_NODE_TYPES.TSPropertySignature)||e.typeAnnotation.type===n.AST_NODE_TYPES.TSIntersectionType&&e.typeAnnotation.types.some(e=>e.type===n.AST_NODE_TYPES.TSTypeLiteral&&e.members.some(e=>e.type===n.AST_NODE_TYPES.TSPropertySignature)))))return!0}}return!1}function o(e,t,r){(t.params.length>1||!a(e,t))&&(a(e,t)?t.params.slice(1):t.params).forEach(t=>{let a=i(t);a?.type!==n.AST_NODE_TYPES.TSStringKeyword&&a?.type!==n.AST_NODE_TYPES.TSNumberKeyword&&a?.type!==n.AST_NODE_TYPES.TSBooleanKeyword&&!(a?.type===n.AST_NODE_TYPES.TSUnionType&&a.types.every(e=>e.type===n.AST_NODE_TYPES.TSLiteralType&&e.literal.type===n.AST_NODE_TYPES.Literal&&(typeof e.literal.value==`string`||typeof e.literal.value==`number`||typeof e.literal.value==`boolean`)))&&!(a?.type===n.AST_NODE_TYPES.TSTypeReference&&a.typeName.type===n.AST_NODE_TYPES.Identifier&&e.some(e=>e.type===n.AST_NODE_TYPES.TSTypeAliasDeclaration&&e.id.name===a.typeName.name&&(e.typeAnnotation.type===n.AST_NODE_TYPES.TSStringKeyword||e.typeAnnotation.type===n.AST_NODE_TYPES.TSNumberKeyword||e.typeAnnotation.type===n.AST_NODE_TYPES.TSBooleanKeyword||e.typeAnnotation.type===n.AST_NODE_TYPES.TSUnionType&&e.typeAnnotation.types.every(e=>e.type===n.AST_NODE_TYPES.TSLiteralType&&e.literal.type===n.AST_NODE_TYPES.Literal&&(typeof e.literal.value==`string`||typeof e.literal.value==`number`||typeof e.literal.value==`boolean`)))))&&!(a?.type===n.AST_NODE_TYPES.TSArrayType&&(a.elementType.type===n.AST_NODE_TYPES.TSStringKeyword||a.elementType.type===n.AST_NODE_TYPES.TSNumberKeyword||a.elementType.type===n.AST_NODE_TYPES.TSBooleanKeyword||a.elementType.type===n.AST_NODE_TYPES.TSUnionType&&a.elementType.types.every(e=>e.type===n.AST_NODE_TYPES.TSLiteralType&&e.literal.type===n.AST_NODE_TYPES.Literal&&(typeof e.literal.value==`string`||typeof e.literal.value==`number`||typeof e.literal.value==`boolean`))||a.elementType.type===n.AST_NODE_TYPES.TSTypeReference&&a.elementType.typeName.type===n.AST_NODE_TYPES.Identifier&&e.some(e=>e.type===n.AST_NODE_TYPES.TSTypeAliasDeclaration&&e.id.name===a.elementType.typeName.name&&(e.typeAnnotation.type===n.AST_NODE_TYPES.TSStringKeyword||e.typeAnnotation.type===n.AST_NODE_TYPES.TSNumberKeyword||e.typeAnnotation.type===n.AST_NODE_TYPES.TSBooleanKeyword||e.typeAnnotation.type===n.AST_NODE_TYPES.TSUnionType&&e.typeAnnotation.types.every(e=>e.type===n.AST_NODE_TYPES.TSLiteralType&&e.literal.type===n.AST_NODE_TYPES.Literal&&(typeof e.literal.value==`string`||typeof e.literal.value==`number`||typeof e.literal.value==`boolean`))))))&&r.report({node:a,messageId:`invalidArgsParam`})})}const s=e.createRule({name:r,meta:{type:`problem`,docs:{description:`The command handler function must have a valid parameter types.`},schema:[],messages:{invalidArgsParam:`All command handler function parameters, with the potential exception of the first (which can represent the command's options), should represent the command's positional arguments. As a result, these parameters' types must be included in the following list:
2
2
  - string
3
3
  - number
4
4
  - boolean
@@ -6,4 +6,4 @@ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{val
6
6
  - string array
7
7
  - number array
8
8
  - boolean array
9
- - string or number or boolean literal array `}},defaultOptions:[],create:e=>({Program(n){if((0,t.findFileName)(e.filename??e.getFilename(),{withExtension:!1})===`command`){for(let t of n.body)if(t.type===`ExportDefaultDeclaration`){if(t.declaration?.type===`FunctionDeclaration`)t.declaration.params.length>0&&o(n.body,t.declaration,e);else if(t.declaration?.type===`Identifier`){let r=t.declaration.name,i=n.body.find(e=>e.type===`FunctionDeclaration`&&e.id.name===r||e.type===`VariableDeclaration`&&e.declarations.find(e=>e.id?.type===`Identifier`&&e.id.name===r));if(i?.type===`FunctionDeclaration`)o(n.body,i,e);else if(i?.type===`VariableDeclaration`){let t=i.declarations.find(e=>e.id?.type===`Identifier`&&e.id.name===r);t?.init?.type===`ArrowFunctionExpression`&&o(n.body,t.init,e)}}}}}})});exports.RULE_NAME=r,exports.default=s;
9
+ - string or number or boolean literal array `}},defaultOptions:[],create:e=>({Program(n){let r=e.filename??e.getFilename();if((0,t.findFileName)(r,{withExtension:!1})===`command`){for(let t of n.body)if(t.type===`ExportDefaultDeclaration`){if(t.declaration?.type===`FunctionDeclaration`)t.declaration.params.length>0&&o(n.body,t.declaration,e);else if(t.declaration?.type===`Identifier`){let r=t.declaration.name,i=n.body.find(e=>e.type===`FunctionDeclaration`&&e.id.name===r||e.type===`VariableDeclaration`&&e.declarations.find(e=>e.id?.type===`Identifier`&&e.id.name===r));if(i?.type===`FunctionDeclaration`)o(n.body,i,e);else if(i?.type===`VariableDeclaration`){let t=i.declarations.find(e=>e.id?.type===`Identifier`&&e.id.name===r);t?.init?.type===`ArrowFunctionExpression`&&o(n.body,t.init,e)}}}}}})});exports.RULE_NAME=r,exports.default=s,exports.rule=s;
@@ -1,10 +1,9 @@
1
1
  import { RuleModule } from "../helpers/create-rule.cjs";
2
-
3
2
  //#region src/rules/invalid-handler-params.d.ts
4
3
  declare const RULE_NAME = "invalid-handler-params";
5
4
  type MessageIds = "invalidArgsParam";
6
5
  type Options = [];
7
- declare const _default: RuleModule<[]>;
6
+ declare const rule: RuleModule<[]>;
8
7
  //#endregion
9
- export { MessageIds, Options, RULE_NAME, _default as default };
8
+ export { MessageIds, Options, RULE_NAME, rule as default, rule };
10
9
  //# sourceMappingURL=invalid-handler-params.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"invalid-handler-params.d.cts","names":[],"sources":["../../src/rules/invalid-handler-params.ts"],"mappings":";;;cAwBa,SAAA;AAAA,KACD,UAAA;AAAA,KACA,OAAA;AAAA,cAAa,QAAA"}
1
+ {"version":3,"file":"invalid-handler-params.d.cts","names":[],"sources":["../../src/rules/invalid-handler-params.ts"],"mappings":";;cAwBa;KACD;KACA;cAqOC,MAAA"}
@@ -1,10 +1,9 @@
1
1
  import { RuleModule } from "../helpers/create-rule.mjs";
2
-
3
2
  //#region src/rules/invalid-handler-params.d.ts
4
3
  declare const RULE_NAME = "invalid-handler-params";
5
4
  type MessageIds = "invalidArgsParam";
6
5
  type Options = [];
7
- declare const _default: RuleModule<[]>;
6
+ declare const rule: RuleModule<[]>;
8
7
  //#endregion
9
- export { MessageIds, Options, RULE_NAME, _default as default };
8
+ export { MessageIds, Options, RULE_NAME, rule as default, rule };
10
9
  //# sourceMappingURL=invalid-handler-params.d.mts.map
@@ -1,4 +1,4 @@
1
- import{createRule as e}from"../helpers/create-rule.mjs";import{findFileName as t}from"@stryke/path/file-path-fns";import{AST_NODE_TYPES as n}from"@typescript-eslint/utils";const r=`invalid-handler-params`;function i(e){switch(e.type){case n.Identifier:return e.typeAnnotation?e.typeAnnotation.typeAnnotation:null;case n.AssignmentPattern:{let t=e.left;return t.type===n.Identifier&&t.typeAnnotation?t.typeAnnotation.typeAnnotation:null}case n.RestElement:{let t=e.argument;return t.type===n.Identifier&&t.typeAnnotation?t.typeAnnotation.typeAnnotation:null}case n.ArrayPattern:case n.ObjectPattern:case n.TSParameterProperty:default:return null}}function a(e,t){if(t.params.length>0&&t.params[0]){let r=i(t.params[0]);if(!r)return!1;if(r.type===n.TSTypeLiteral&&r.members.some(e=>e.type===n.TSPropertySignature)||r.type===n.TSIntersectionType&&r.types.some(e=>e.type===n.TSTypeLiteral&&e.members.some(e=>e.type===n.TSPropertySignature)))return!0;if(r.type===n.TSTypeReference&&r.typeName.type===n.Identifier){let t=r.typeName.name;if(!e.some(e=>e.type===n.TSInterfaceDeclaration&&e.id.name===t||e.type===n.TSTypeAliasDeclaration&&e.id.name===t&&(e.typeAnnotation.type===n.TSTypeLiteral&&e.typeAnnotation.members.some(e=>e.type===n.TSPropertySignature)||e.typeAnnotation.type===n.TSIntersectionType&&e.typeAnnotation.types.some(e=>e.type===n.TSTypeLiteral&&e.members.some(e=>e.type===n.TSPropertySignature)))))return!0}}return!1}function o(e,t,r){(t.params.length>1||!a(e,t))&&(a(e,t)?t.params.slice(1):t.params).forEach(t=>{let a=i(t);a?.type!==n.TSStringKeyword&&a?.type!==n.TSNumberKeyword&&a?.type!==n.TSBooleanKeyword&&!(a?.type===n.TSUnionType&&a.types.every(e=>e.type===n.TSLiteralType&&e.literal.type===n.Literal&&(typeof e.literal.value==`string`||typeof e.literal.value==`number`||typeof e.literal.value==`boolean`)))&&!(a?.type===n.TSTypeReference&&a.typeName.type===n.Identifier&&e.some(e=>e.type===n.TSTypeAliasDeclaration&&e.id.name===a.typeName.name&&(e.typeAnnotation.type===n.TSStringKeyword||e.typeAnnotation.type===n.TSNumberKeyword||e.typeAnnotation.type===n.TSBooleanKeyword||e.typeAnnotation.type===n.TSUnionType&&e.typeAnnotation.types.every(e=>e.type===n.TSLiteralType&&e.literal.type===n.Literal&&(typeof e.literal.value==`string`||typeof e.literal.value==`number`||typeof e.literal.value==`boolean`)))))&&!(a?.type===n.TSArrayType&&(a.elementType.type===n.TSStringKeyword||a.elementType.type===n.TSNumberKeyword||a.elementType.type===n.TSBooleanKeyword||a.elementType.type===n.TSUnionType&&a.elementType.types.every(e=>e.type===n.TSLiteralType&&e.literal.type===n.Literal&&(typeof e.literal.value==`string`||typeof e.literal.value==`number`||typeof e.literal.value==`boolean`))||a.elementType.type===n.TSTypeReference&&a.elementType.typeName.type===n.Identifier&&e.some(e=>e.type===n.TSTypeAliasDeclaration&&e.id.name===a.elementType.typeName.name&&(e.typeAnnotation.type===n.TSStringKeyword||e.typeAnnotation.type===n.TSNumberKeyword||e.typeAnnotation.type===n.TSBooleanKeyword||e.typeAnnotation.type===n.TSUnionType&&e.typeAnnotation.types.every(e=>e.type===n.TSLiteralType&&e.literal.type===n.Literal&&(typeof e.literal.value==`string`||typeof e.literal.value==`number`||typeof e.literal.value==`boolean`))))))&&r.report({node:a,messageId:`invalidArgsParam`})})}var s=e({name:r,meta:{type:`problem`,docs:{description:`The command handler function must have a valid parameter types.`},schema:[],messages:{invalidArgsParam:`All command handler function parameters, with the potential exception of the first (which can represent the command's options), should represent the command's positional arguments. As a result, these parameters' types must be included in the following list:
1
+ import{createRule as e}from"../helpers/create-rule.mjs";import{findFileName as t}from"@stryke/path/file-path-fns";import{AST_NODE_TYPES as n}from"@typescript-eslint/utils";const r=`invalid-handler-params`;function i(e){switch(e.type){case n.Identifier:return e.typeAnnotation?e.typeAnnotation.typeAnnotation:null;case n.AssignmentPattern:{let t=e.left;return t.type===n.Identifier&&t.typeAnnotation?t.typeAnnotation.typeAnnotation:null}case n.RestElement:{let t=e.argument;return t.type===n.Identifier&&t.typeAnnotation?t.typeAnnotation.typeAnnotation:null}case n.ArrayPattern:case n.ObjectPattern:case n.TSParameterProperty:default:return null}}function a(e,t){if(t.params.length>0&&t.params[0]){let r=i(t.params[0]);if(!r)return!1;if(r.type===n.TSTypeLiteral&&r.members.some(e=>e.type===n.TSPropertySignature)||r.type===n.TSIntersectionType&&r.types.some(e=>e.type===n.TSTypeLiteral&&e.members.some(e=>e.type===n.TSPropertySignature)))return!0;if(r.type===n.TSTypeReference&&r.typeName.type===n.Identifier){let t=r.typeName.name;if(!e.some(e=>e.type===n.TSInterfaceDeclaration&&e.id.name===t||e.type===n.TSTypeAliasDeclaration&&e.id.name===t&&(e.typeAnnotation.type===n.TSTypeLiteral&&e.typeAnnotation.members.some(e=>e.type===n.TSPropertySignature)||e.typeAnnotation.type===n.TSIntersectionType&&e.typeAnnotation.types.some(e=>e.type===n.TSTypeLiteral&&e.members.some(e=>e.type===n.TSPropertySignature)))))return!0}}return!1}function o(e,t,r){(t.params.length>1||!a(e,t))&&(a(e,t)?t.params.slice(1):t.params).forEach(t=>{let a=i(t);a?.type!==n.TSStringKeyword&&a?.type!==n.TSNumberKeyword&&a?.type!==n.TSBooleanKeyword&&!(a?.type===n.TSUnionType&&a.types.every(e=>e.type===n.TSLiteralType&&e.literal.type===n.Literal&&(typeof e.literal.value==`string`||typeof e.literal.value==`number`||typeof e.literal.value==`boolean`)))&&!(a?.type===n.TSTypeReference&&a.typeName.type===n.Identifier&&e.some(e=>e.type===n.TSTypeAliasDeclaration&&e.id.name===a.typeName.name&&(e.typeAnnotation.type===n.TSStringKeyword||e.typeAnnotation.type===n.TSNumberKeyword||e.typeAnnotation.type===n.TSBooleanKeyword||e.typeAnnotation.type===n.TSUnionType&&e.typeAnnotation.types.every(e=>e.type===n.TSLiteralType&&e.literal.type===n.Literal&&(typeof e.literal.value==`string`||typeof e.literal.value==`number`||typeof e.literal.value==`boolean`)))))&&!(a?.type===n.TSArrayType&&(a.elementType.type===n.TSStringKeyword||a.elementType.type===n.TSNumberKeyword||a.elementType.type===n.TSBooleanKeyword||a.elementType.type===n.TSUnionType&&a.elementType.types.every(e=>e.type===n.TSLiteralType&&e.literal.type===n.Literal&&(typeof e.literal.value==`string`||typeof e.literal.value==`number`||typeof e.literal.value==`boolean`))||a.elementType.type===n.TSTypeReference&&a.elementType.typeName.type===n.Identifier&&e.some(e=>e.type===n.TSTypeAliasDeclaration&&e.id.name===a.elementType.typeName.name&&(e.typeAnnotation.type===n.TSStringKeyword||e.typeAnnotation.type===n.TSNumberKeyword||e.typeAnnotation.type===n.TSBooleanKeyword||e.typeAnnotation.type===n.TSUnionType&&e.typeAnnotation.types.every(e=>e.type===n.TSLiteralType&&e.literal.type===n.Literal&&(typeof e.literal.value==`string`||typeof e.literal.value==`number`||typeof e.literal.value==`boolean`))))))&&r.report({node:a,messageId:`invalidArgsParam`})})}const s=e({name:r,meta:{type:`problem`,docs:{description:`The command handler function must have a valid parameter types.`},schema:[],messages:{invalidArgsParam:`All command handler function parameters, with the potential exception of the first (which can represent the command's options), should represent the command's positional arguments. As a result, these parameters' types must be included in the following list:
2
2
  - string
3
3
  - number
4
4
  - boolean
@@ -6,5 +6,5 @@ import{createRule as e}from"../helpers/create-rule.mjs";import{findFileName as t
6
6
  - string array
7
7
  - number array
8
8
  - boolean array
9
- - string or number or boolean literal array `}},defaultOptions:[],create:e=>({Program(n){if(t(e.filename??e.getFilename(),{withExtension:!1})===`command`){for(let t of n.body)if(t.type===`ExportDefaultDeclaration`){if(t.declaration?.type===`FunctionDeclaration`)t.declaration.params.length>0&&o(n.body,t.declaration,e);else if(t.declaration?.type===`Identifier`){let r=t.declaration.name,i=n.body.find(e=>e.type===`FunctionDeclaration`&&e.id.name===r||e.type===`VariableDeclaration`&&e.declarations.find(e=>e.id?.type===`Identifier`&&e.id.name===r));if(i?.type===`FunctionDeclaration`)o(n.body,i,e);else if(i?.type===`VariableDeclaration`){let t=i.declarations.find(e=>e.id?.type===`Identifier`&&e.id.name===r);t?.init?.type===`ArrowFunctionExpression`&&o(n.body,t.init,e)}}}}}})});export{r as RULE_NAME,s as default};
9
+ - string or number or boolean literal array `}},defaultOptions:[],create:e=>({Program(n){let r=e.filename??e.getFilename();if(t(r,{withExtension:!1})===`command`){for(let t of n.body)if(t.type===`ExportDefaultDeclaration`){if(t.declaration?.type===`FunctionDeclaration`)t.declaration.params.length>0&&o(n.body,t.declaration,e);else if(t.declaration?.type===`Identifier`){let r=t.declaration.name,i=n.body.find(e=>e.type===`FunctionDeclaration`&&e.id.name===r||e.type===`VariableDeclaration`&&e.declarations.find(e=>e.id?.type===`Identifier`&&e.id.name===r));if(i?.type===`FunctionDeclaration`)o(n.body,i,e);else if(i?.type===`VariableDeclaration`){let t=i.declarations.find(e=>e.id?.type===`Identifier`&&e.id.name===r);t?.init?.type===`ArrowFunctionExpression`&&o(n.body,t.init,e)}}}}}})});export{r as RULE_NAME,s as default,s as rule};
10
10
  //# sourceMappingURL=invalid-handler-params.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/eslint-plugin",
3
- "version": "0.0.85",
3
+ "version": "0.0.87",
4
4
  "private": false,
5
5
  "description": "An ESLint Plugin with linting rules that ensure a Shell Shock project is following the best practices.",
6
6
  "keywords": ["eslint", "eslint-plugin", "shell-shock", "storm-software"],
@@ -77,32 +77,32 @@
77
77
  "typings": "dist/index.d.mts",
78
78
  "files": ["dist/**/*"],
79
79
  "dependencies": {
80
- "@stryke/fs": "^0.33.85",
81
- "@stryke/path": "^0.29.11",
82
- "@typescript-eslint/utils": "^8.61.0",
80
+ "@storm-software/testing-tools": "^1.119.285",
81
+ "@stryke/fs": "^0.33.110",
82
+ "@stryke/path": "^0.29.35",
83
+ "@typescript-eslint/utils": "^8.67.0",
83
84
  "defu": "^6.1.7",
84
- "@storm-software/testing-tools": "^1.119.207",
85
- "powerlines": "^0.47.134"
85
+ "powerlines": "^0.47.210"
86
86
  },
87
87
  "devDependencies": {
88
88
  "@eslint/compat": "^2.1.0",
89
89
  "@eslint/config-inspector": "^1.5.0",
90
- "@powerlines/plugin-tsdown": "^0.1.535",
91
- "@storm-software/testing-tools": "^1.119.207",
90
+ "@powerlines/plugin-tsdown": "^0.1.611",
91
+ "@storm-software/testing-tools": "^1.119.285",
92
92
  "@types/eslint": "^9.6.1",
93
93
  "@types/eslint__js": "^9.14.0",
94
- "@types/node": "^25.9.3",
95
- "eslint": "^10.4.1",
96
- "eslint-doc-generator": "^3.6.0",
94
+ "@types/node": "^25.9.5",
95
+ "eslint": "^10.8.1",
96
+ "eslint-doc-generator": "^3.7.0",
97
97
  "eslint-flat-config-utils": "^2.1.4",
98
- "eslint-plugin-eslint-plugin": "^7.4.0",
98
+ "eslint-plugin-eslint-plugin": "^7.6.1",
99
99
  "eslint-plugin-i18n-text": "^1.0.1",
100
100
  "eslint-rule-documentation": "^1.0.23",
101
101
  "eslint-typegen": "^2.3.1",
102
- "powerlines": "^0.47.134"
102
+ "powerlines": "^0.47.210"
103
103
  },
104
104
  "peerDependencies": { "eslint": ">=9.39.3" },
105
105
  "peerDependenciesMeta": { "eslint": { "optional": false } },
106
106
  "publishConfig": { "access": "public" },
107
- "gitHead": "0876468f621d3b455f99de7dc3ebdd3af8883842"
107
+ "gitHead": "3227e8ed7b3e816987d4d4f270dfdfceb963c022"
108
108
  }
@@ -1 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;