@shell-shock/eslint-plugin 0.0.75 → 0.0.77

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 (36) hide show
  1. package/dist/configs/base.cjs +1 -1
  2. package/dist/configs/base.d.cts.map +1 -1
  3. package/dist/configs/base.d.mts.map +1 -1
  4. package/dist/configs/base.mjs.map +1 -1
  5. package/dist/configs/index.cjs +1 -1
  6. package/dist/configs/index.d.cts.map +1 -1
  7. package/dist/configs/index.d.mts.map +1 -1
  8. package/dist/configs/index.mjs.map +1 -1
  9. package/dist/configs/recommended.cjs +1 -1
  10. package/dist/configs/recommended.d.cts.map +1 -1
  11. package/dist/configs/recommended.d.mts.map +1 -1
  12. package/dist/configs/recommended.mjs.map +1 -1
  13. package/dist/helpers/create-rule.cjs +1 -1
  14. package/dist/helpers/create-rule.d.cts.map +1 -1
  15. package/dist/helpers/create-rule.d.mts.map +1 -1
  16. package/dist/helpers/create-rule.mjs.map +1 -1
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.d.cts.map +1 -1
  19. package/dist/index.d.mts.map +1 -1
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/package.cjs +1 -1
  22. package/dist/package.mjs +1 -1
  23. package/dist/package.mjs.map +1 -1
  24. package/dist/plugin.cjs +1 -1
  25. package/dist/plugin.d.mts.map +1 -1
  26. package/dist/plugin.mjs.map +1 -1
  27. package/dist/rules/duplicate-command-path.cjs +1 -1
  28. package/dist/rules/duplicate-command-path.d.mts.map +1 -1
  29. package/dist/rules/duplicate-command-path.mjs.map +1 -1
  30. package/dist/rules/invalid-command-export.cjs +1 -1
  31. package/dist/rules/invalid-command-export.d.mts.map +1 -1
  32. package/dist/rules/invalid-command-export.mjs.map +1 -1
  33. package/dist/rules/invalid-handler-params.cjs +1 -1
  34. package/dist/rules/invalid-handler-params.d.mts.map +1 -1
  35. package/dist/rules/invalid-handler-params.mjs.map +1 -1
  36. package/package.json +31 -114
@@ -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
+ 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 +1 @@
1
- {"version":3,"file":"base.d.cts","names":[],"sources":["../../src/configs/base.ts"],"mappings":";;;cAqBM,MAAA,EAAQ,MAAA,CAAO,MAAA;AAAA"}
1
+ {"version":3,"file":"base.d.cts","names":[],"sources":["../../src/configs/base.ts"],"mappings":";;;cAqBM,MAAA,EAAQ,MAAA,CAAO,MAYpB;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.mts","names":[],"sources":["../../src/configs/base.ts"],"mappings":";;;cAqBM,MAAA,EAAQ,MAAA,CAAO,MAAA"}
1
+ {"version":3,"file":"base.d.mts","names":[],"sources":["../../src/configs/base.ts"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"base.mjs","names":[],"sources":["../../src/configs/base.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Linter } from \"eslint\";\nimport { plugin } from \"../plugin\";\n\nconst config: Linter.Config = {\n files: [\"**/*.{,c,m}{j,t}s{,x}\"],\n name: \"shell-shock:base\",\n plugins: {\n \"shell-shock\": plugin\n },\n ignores: [\".shell-shock\"],\n rules: {\n \"shell-shock/duplicate-command-path\": \"warn\",\n \"shell-shock/invalid-command-export\": \"error\",\n \"shell-shock/invalid-handler-params\": \"error\"\n }\n};\n\nexport default config;\n"],"mappings":"uCAqBA,MAAM,EAAwB,CAC5B,MAAO,CAAC,wBAAwB,CAChC,KAAM,mBACN,QAAS,CACP,cAAe,EAChB,CACD,QAAS,CAAC,eAAe,CACzB,MAAO,CACL,qCAAsC,OACtC,qCAAsC,QACtC,qCAAsC,QACvC,CACF"}
1
+ {"version":3,"file":"base.mjs","names":[],"sources":[],"mappings":""}
@@ -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={base:require("./base.cjs"),recommended:require("./recommended.cjs")};exports.configs=e;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/configs/index.ts"],"mappings":";;;cAsBa,OAAA,EAAS,MAAA,SAAe,MAAA,CAAO,MAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/configs/index.ts"],"mappings":";;;cAsBa,OAAA,EAAS,MAAM,SAAS,MAAA,CAAO,MAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/configs/index.ts"],"mappings":";;;cAsBa,OAAA,EAAS,MAAA,SAAe,MAAA,CAAO,MAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/configs/index.ts"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/configs/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Linter } from \"eslint\";\nimport base from \"./base\";\nimport recommended from \"./recommended\";\n\nexport const configs: Record<string, Linter.Config> = {\n base,\n recommended\n};\n"],"mappings":"2DAsBA,MAAa,EAAyC,CACpD,KAAA,EACA,YAAA,EACD"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":[],"mappings":""}
@@ -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
+ 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 +1 @@
1
- {"version":3,"file":"recommended.d.cts","names":[],"sources":["../../src/configs/recommended.ts"],"mappings":";;;cAqBM,MAAA,EAAQ,MAAA,CAAO,MAAA;AAAA"}
1
+ {"version":3,"file":"recommended.d.cts","names":[],"sources":["../../src/configs/recommended.ts"],"mappings":";;;cAqBM,MAAA,EAAQ,MAAA,CAAO,MAYpB;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"recommended.d.mts","names":[],"sources":["../../src/configs/recommended.ts"],"mappings":";;;cAqBM,MAAA,EAAQ,MAAA,CAAO,MAAA"}
1
+ {"version":3,"file":"recommended.d.mts","names":[],"sources":["../../src/configs/recommended.ts"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"recommended.mjs","names":[],"sources":["../../src/configs/recommended.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Linter } from \"eslint\";\nimport { plugin } from \"../plugin\";\n\nconst config: Linter.Config = {\n files: [\"**/*.{,c,m}{j,t}s{,x}\"],\n name: \"shell-shock:recommended\",\n plugins: {\n \"shell-shock\": plugin\n },\n ignores: [\".shell-shock\"],\n rules: {\n \"shell-shock/duplicate-command-path\": \"warn\",\n \"shell-shock/invalid-command-export\": \"error\",\n \"shell-shock/invalid-handler-params\": \"error\"\n }\n};\n\nexport default config;\n"],"mappings":"uCAqBA,MAAM,EAAwB,CAC5B,MAAO,CAAC,wBAAwB,CAChC,KAAM,0BACN,QAAS,CACP,cAAe,EAChB,CACD,QAAS,CAAC,eAAe,CACzB,MAAO,CACL,qCAAsC,OACtC,qCAAsC,QACtC,qCAAsC,QACvC,CACF"}
1
+ {"version":3,"file":"recommended.mjs","names":[],"sources":[],"mappings":""}
@@ -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
+ 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 +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,CAAA;AAAA"}
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 +1 @@
1
- {"version":3,"file":"create-rule.d.mts","names":[],"sources":["../../src/helpers/create-rule.ts"],"mappings":";;KA2BY,UAAA,iCAA2C,IAAA,CAAK,UAAA;EAC1D,cAAA,EAAgB,CAAA;AAAA"}
1
+ {"version":3,"file":"create-rule.d.mts","names":[],"sources":["../../src/helpers/create-rule.ts"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"create-rule.mjs","names":[],"sources":["../../src/helpers/create-rule.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type {\n RuleListener,\n RuleWithMeta,\n RuleWithMetaAndName\n} from \"@typescript-eslint/utils/eslint-utils\";\nimport type { RuleContext } from \"@typescript-eslint/utils/ts-eslint\";\nimport defu from \"defu\";\nimport type { Rule } from \"eslint\";\n\nexport type RuleModule<T extends readonly unknown[]> = Rule.RuleModule & {\n defaultOptions: T;\n};\n\n/**\n * Creates reusable function to create rules with default options and docs URLs.\n *\n * @param urlCreator - Creates a documentation URL for a given rule name.\n * @returns Function to create a rule with the docs URL format.\n */\nfunction RuleCreator(urlCreator: (name: string) => string) {\n // This function will get much easier to call when this is merged https://github.com/Microsoft/TypeScript/pull/26349\n // TODO - when the above PR lands; add type checking for the context.report `data` property\n return function createNamedRule<\n TOptions extends readonly any[],\n TMessageIds extends string\n >({\n name,\n meta,\n ...rule\n }: Readonly<\n RuleWithMetaAndName<TOptions, TMessageIds>\n >): RuleModule<TOptions> {\n return createRuleInfo<TOptions, TMessageIds>({\n meta: {\n ...meta,\n docs: {\n ...meta.docs,\n url: urlCreator(name)\n }\n },\n ...rule\n });\n };\n}\n\n/**\n * Creates a well-typed TSESLint custom ESLint rule without a docs URL.\n *\n * @returns Well-typed TSESLint custom ESLint rule.\n * @remarks It is generally better to provide a docs URL function to RuleCreator.\n */\nfunction createRuleInfo<\n TOptions extends readonly any[],\n TMessageIds extends string\n>({\n create,\n defaultOptions,\n meta\n}: Readonly<RuleWithMeta<TOptions, TMessageIds>>): RuleModule<TOptions> {\n return {\n create: ((\n context: Readonly<RuleContext<TMessageIds, TOptions>>\n ): RuleListener => {\n const optionsWithDefault = context.options.map((options, index) => {\n return defu(defaultOptions?.[index] ?? {}, options);\n }) as unknown as TOptions;\n\n return create(context, optionsWithDefault);\n }) as any,\n defaultOptions: (defaultOptions ?? {}) as TOptions,\n meta: meta as any\n };\n}\n\nexport const createRule = RuleCreator(\n ruleName =>\n `https://docs.stormsoftware.com/projects/shell-shock/eslint/rules/${ruleName}.md`\n) as any as <TOptions extends readonly unknown[], TMessageIds extends string>({\n name,\n meta,\n ...rule\n}: Readonly<\n RuleWithMetaAndName<TOptions, TMessageIds>\n>) => RuleModule<TOptions>;\n\nconst warned = new Set<string>();\n\nexport function warnOnce(message: string): void {\n if (warned.has(message)) return;\n warned.add(message);\n // eslint-disable-next-line no-console\n console.warn(message);\n}\n"],"mappings":"oBAqCA,SAAS,EAAY,EAAsC,CAGzD,OAAO,SAGL,CACA,OACA,OACA,GAAG,GAGoB,CACvB,OAAO,EAAsC,CAC3C,KAAM,CACJ,GAAG,EACH,KAAM,CACJ,GAAG,EAAK,KACR,IAAK,EAAW,EAAK,CACtB,CACF,CACD,GAAG,EACJ,CAAC,EAUN,SAAS,EAGP,CACA,SACA,iBACA,QACsE,CACtE,MAAO,CACL,QACE,GAMO,EAAO,EAJa,EAAQ,QAAQ,KAAK,EAAS,IAChD,EAAK,IAAiB,IAAU,EAAE,CAAE,EAAQ,CAGZ,CAAC,EAE5C,eAAiB,GAAkB,EAAE,CAC/B,OACP,CAGH,MAAa,EAAa,EACxB,GACE,oEAAoE,EAAS,KAChF"}
1
+ {"version":3,"file":"create-rule.mjs","names":[],"sources":[],"mappings":""}
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./plugin.cjs`),t=require(`./configs/index.cjs`),n={...e.plugin,configs:t.configs};exports.configs=t.configs,exports.default=n;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./plugin.cjs"),t=require("./configs/index.cjs"),n={...e.plugin,configs:t.configs};exports.configs=t.configs,exports.default=n;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;AAoBkC;;;;;AAuBf;;;;;AAInB;cAXM,YAAA,EAAc,MAAA,CAAO,MAAA;AAAA,KAStB,eAAA,WAA0B,MAAA;AAAA,KAEnB,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":";;;;;;;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 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;AAoBkC;;;;;AAuBf;;;;;AAInB;cAXM,YAAA,EAAc,MAAA,CAAO,MAAA;AAAA,KAStB,eAAA,WAA0B,MAAA;AAAA,KAEnB,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.mts","names":[],"sources":["../src/index.ts"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ESLint, Linter } from \"eslint\";\nimport { configs } from \"./configs\";\nimport { plugin } from \"./plugin\";\n\n/**\n * A shared ESLint configuration containing globals used in Storm Stack projects\n *\n * @packageDocumentation\n * This package contains the ESLint plugin for Storm Stack, which provides\n * a set of rules and configurations for linting JavaScript and TypeScript code.\n * It includes a set of recommended rules, as well as a strict configuration\n * that enforces a more opinionated style. The plugin is designed to be used\n * with ESLint, a popular linting tool for JavaScript and TypeScript.\n *\n * This package also includes additional utilities for enhancing the linting\n * experience and ensuring code quality across projects.\n */\n\nconst eslintPlugin: ESLint.Plugin = {\n ...plugin,\n configs\n};\n\nexport default eslintPlugin;\n\nexport { configs };\n\ntype RuleDefinitions = (typeof plugin)[\"rules\"];\n\nexport type RuleOptions = {\n [K in keyof RuleDefinitions]: RuleDefinitions[K][\"defaultOptions\"];\n};\n\nexport type Rules = {\n [K in keyof RuleOptions]: Linter.RuleEntry<RuleOptions[K]>;\n};\n"],"mappings":"oFAoCA,MAAM,EAA8B,CAClC,GAAG,EACH,UACD"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":[],"mappings":""}
package/dist/package.cjs CHANGED
@@ -1 +1 @@
1
- var e=`0.0.75`;Object.defineProperty(exports,`version`,{enumerable:!0,get:function(){return e}});
1
+ var e=`0.0.76`;Object.defineProperty(exports,"version",{enumerable:!0,get:function(){return e}});
package/dist/package.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var e=`0.0.75`;export{e as version};
1
+ var e=`0.0.76`;export{e as version};
2
2
  //# sourceMappingURL=package.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"package.mjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
1
+ {"version":3,"file":"package.mjs","names":[],"sources":[],"mappings":""}
package/dist/plugin.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./package.cjs`),t=require(`./rules/duplicate-command-path.cjs`),n=require(`./rules/invalid-command-export.cjs`),r=require(`./rules/invalid-handler-params.cjs`),i={meta:{name:`shell-shock`,version:e.version},rules:{"duplicate-command-path":t.default,"invalid-command-export":n.default,"invalid-handler-params":r.default}};exports.plugin=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./package.cjs"),t=require("./rules/duplicate-command-path.cjs"),n=require("./rules/invalid-command-export.cjs"),r=require("./rules/invalid-handler-params.cjs"),i={meta:{name:`shell-shock`,version:e.version},rules:{"duplicate-command-path":t.default,"invalid-command-export":n.default,"invalid-handler-params":r.default}};exports.plugin=i;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;cAwBa,MAAA;;;;;;8BAUY,UAAA"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.mjs","names":["packageJson.version","duplicateCommandPath","invalidCommandExport","invalidHandlerParams"],"sources":["../src/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ESLint } from \"eslint\";\nimport packageJson from \"../package.json\" with { type: \"json\" };\nimport duplicateCommandPath from \"./rules/duplicate-command-path\";\nimport invalidCommandExport from \"./rules/invalid-command-export\";\nimport invalidHandlerParams from \"./rules/invalid-handler-params\";\n\nexport const plugin = {\n meta: {\n name: \"shell-shock\",\n version: packageJson.version\n },\n rules: {\n \"duplicate-command-path\": duplicateCommandPath,\n \"invalid-command-export\": invalidCommandExport,\n \"invalid-handler-params\": invalidHandlerParams\n }\n} satisfies ESLint.Plugin;\n"],"mappings":"8LAwBA,MAAa,EAAS,CACpB,KAAM,CACJ,KAAM,cACGA,UACV,CACD,MAAO,CACL,yBAA0BC,EAC1B,yBAA0BC,EAC1B,yBAA0BC,EAC3B,CACF"}
1
+ {"version":3,"file":"plugin.mjs","names":[],"sources":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../_virtual/_rolldown/runtime.cjs`);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}}
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
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 +1 @@
1
- {"version":3,"file":"duplicate-command-path.d.mts","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.mts","names":[],"sources":["../../src/rules/duplicate-command-path.ts"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"duplicate-command-path.mjs","names":[],"sources":["../../src/rules/duplicate-command-path.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isDirectory } from \"@stryke/fs/is-file\";\nimport { listSync } from \"@stryke/fs/list-files\";\nimport {\n findFileName,\n findFilePath,\n findFolderName\n} from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { resolveParentPath } from \"@stryke/path/resolve-parent-path\";\nimport { existsSync } from \"node:fs\";\nimport { createRule } from \"../helpers/create-rule\";\n\nexport const RULE_NAME = \"duplicate-command-path\";\nexport type MessageIds = \"duplicateCommandPath\";\nexport type Options = [];\n\nexport default createRule<Options, MessageIds>({\n name: RULE_NAME,\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"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.\"\n },\n schema: [],\n messages: {\n duplicateCommandPath:\n \"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}}\\n- {{.}}{{/duplicates}}\"\n }\n },\n defaultOptions: [],\n create: context => {\n return {\n Program(node) {\n const fileName = context.filename ?? context.getFilename();\n if (\n findFileName(fileName, {\n withExtension: false\n }) !== \"command\"\n ) {\n return;\n }\n\n const filePath = findFilePath(fileName);\n if (!filePath) {\n return;\n }\n\n const duplicates = listSync(filePath).filter(\n contentItem =>\n isDirectory(contentItem) &&\n ((findFileName(contentItem).startsWith(\"(\") &&\n findFileName(contentItem).startsWith(\"(\")) ||\n findFileName(contentItem).startsWith(\"_\")) &&\n existsSync(joinPaths(contentItem, \"command.ts\"))\n );\n if (duplicates.length > 1) {\n context.report({\n node,\n messageId: \"duplicateCommandPath\",\n data: {\n duplicates\n }\n });\n }\n\n const parentPath = resolveParentPath(fileName);\n if (\n ((findFolderName(parentPath).startsWith(\"(\") &&\n findFolderName(parentPath).startsWith(\"(\")) ||\n findFolderName(parentPath).startsWith(\"_\")) &&\n existsSync(joinPaths(parentPath, \"command.ts\"))\n ) {\n context.report({\n node,\n messageId: \"duplicateCommandPath\",\n data: {\n duplicates: [parentPath]\n }\n });\n }\n }\n };\n }\n});\n"],"mappings":"kZA8BA,MAAa,EAAY,yBAIzB,IAAA,EAAe,EAAgC,CAC7C,KAAM,EACN,KAAM,CACJ,KAAM,UACN,KAAM,CACJ,YACE,6JACH,CACD,OAAQ,EAAE,CACV,SAAU,CACR,qBACE;wBACH,CACF,CACD,eAAgB,EAAE,CAClB,OAAQ,IACC,CACL,QAAQ,EAAM,CACZ,IAAM,EAAW,EAAQ,UAAY,EAAQ,aAAa,CAC1D,GACE,EAAa,EAAU,CACrB,cAAe,GAChB,CAAC,GAAK,UAEP,OAGF,IAAM,EAAW,EAAa,EAAS,CACvC,GAAI,CAAC,EACH,OAGF,IAAM,EAAa,EAAS,EAAS,CAAC,OACpC,GACE,EAAY,EAAY,GACtB,EAAa,EAAY,CAAC,WAAW,IAAI,EACzC,EAAa,EAAY,CAAC,WAAW,IAAI,EACzC,EAAa,EAAY,CAAC,WAAW,IAAI,GAC3C,EAAW,EAAU,EAAa,aAAa,CAAC,CACnD,CACG,EAAW,OAAS,GACtB,EAAQ,OAAO,CACb,OACA,UAAW,uBACX,KAAM,CACJ,aACD,CACF,CAAC,CAGJ,IAAM,EAAa,EAAkB,EAAS,EAE1C,EAAe,EAAW,CAAC,WAAW,IAAI,EAC1C,EAAe,EAAW,CAAC,WAAW,IAAI,EAC1C,EAAe,EAAW,CAAC,WAAW,IAAI,GAC5C,EAAW,EAAU,EAAY,aAAa,CAAC,EAE/C,EAAQ,OAAO,CACb,OACA,UAAW,uBACX,KAAM,CACJ,WAAY,CAAC,EAAW,CACzB,CACF,CAAC,EAGP,EAEJ,CAAC"}
1
+ {"version":3,"file":"duplicate-command-path.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../_virtual/_rolldown/runtime.cjs`);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`;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 +1 @@
1
- {"version":3,"file":"invalid-command-export.d.mts","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.mts","names":[],"sources":["../../src/rules/invalid-command-export.ts"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"invalid-command-export.mjs","names":[],"sources":["../../src/rules/invalid-command-export.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport { createRule } from \"../helpers/create-rule\";\n\nexport const RULE_NAME = \"invalid-command-export\";\nexport type MessageIds = \"invalidExport\";\nexport type Options = [];\n\nexport default createRule<Options, MessageIds>({\n name: RULE_NAME,\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"A command module must have a handler function as it's default export.\"\n },\n schema: [],\n messages: {\n invalidExport:\n \"A command module must have a handler function as it's default export.\"\n }\n },\n defaultOptions: [],\n create: context => {\n return {\n Program(node) {\n const fileName = context.filename ?? context.getFilename();\n if (\n findFileName(fileName, {\n withExtension: false\n }) !== \"command\"\n ) {\n return;\n }\n\n for (const block of node.body) {\n if (block.type === \"ExportDefaultDeclaration\") {\n if (block.declaration.type === \"FunctionDeclaration\") {\n return;\n } else if (block.declaration.type === \"Identifier\") {\n const name = block.declaration.name;\n if (\n node.body.some(\n localBlock =>\n (localBlock.type === \"FunctionDeclaration\" &&\n localBlock.id.name === name) ||\n (localBlock.type === \"VariableDeclaration\" &&\n localBlock.declarations.find(\n declaration =>\n declaration.id?.type === \"Identifier\" &&\n declaration.id.name === name\n ))\n )\n ) {\n return;\n }\n }\n\n context.report({\n node: block,\n messageId: \"invalidExport\"\n });\n }\n }\n }\n };\n }\n});\n"],"mappings":"kHAqBA,MAAa,EAAY,yBAIzB,IAAA,EAAe,EAAgC,CAC7C,KAAM,EACN,KAAM,CACJ,KAAM,UACN,KAAM,CACJ,YACE,wEACH,CACD,OAAQ,EAAE,CACV,SAAU,CACR,cACE,wEACH,CACF,CACD,eAAgB,EAAE,CAClB,OAAQ,IACC,CACL,QAAQ,EAAM,CAGV,KAFe,EAAQ,UAAY,EAAQ,aAAa,CAEjC,CACrB,cAAe,GAChB,CAAC,GAAK,UAKT,KAAK,IAAM,KAAS,EAAK,KACvB,GAAI,EAAM,OAAS,2BAA4B,CAC7C,GAAI,EAAM,YAAY,OAAS,sBAC7B,UACS,EAAM,YAAY,OAAS,aAAc,CAClD,IAAM,EAAO,EAAM,YAAY,KAC/B,GACE,EAAK,KAAK,KACR,GACG,EAAW,OAAS,uBACnB,EAAW,GAAG,OAAS,GACxB,EAAW,OAAS,uBACnB,EAAW,aAAa,KACtB,GACE,EAAY,IAAI,OAAS,cACzB,EAAY,GAAG,OAAS,EAC3B,CACN,CAED,OAIJ,EAAQ,OAAO,CACb,KAAM,EACN,UAAW,gBACZ,CAAC,IAIT,EAEJ,CAAC"}
1
+ {"version":3,"file":"invalid-command-export.mjs","names":[],"sources":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../_virtual/_rolldown/runtime.cjs`);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`})})}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:
2
2
  - string
3
3
  - number
4
4
  - boolean
@@ -1 +1 @@
1
- {"version":3,"file":"invalid-handler-params.d.mts","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.mts","names":[],"sources":["../../src/rules/invalid-handler-params.ts"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"invalid-handler-params.mjs","names":[],"sources":["../../src/rules/invalid-handler-params.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport type { TSESTree } from \"@typescript-eslint/utils\";\nimport { AST_NODE_TYPES } from \"@typescript-eslint/utils\";\nimport type { RuleContext } from \"@typescript-eslint/utils/ts-eslint\";\nimport { createRule } from \"../helpers/create-rule\";\n\nexport const RULE_NAME = \"invalid-handler-params\";\nexport type MessageIds = \"invalidArgsParam\";\nexport type Options = [];\n\nfunction getTypeNode(param: TSESTree.Parameter): TSESTree.TypeNode | null {\n switch (param.type) {\n case AST_NODE_TYPES.Identifier:\n return param.typeAnnotation ? param.typeAnnotation.typeAnnotation : null;\n\n case AST_NODE_TYPES.AssignmentPattern: {\n const left = param.left;\n if (left.type === AST_NODE_TYPES.Identifier && left.typeAnnotation) {\n return left.typeAnnotation.typeAnnotation;\n }\n return null;\n }\n\n case AST_NODE_TYPES.RestElement: {\n const arg = param.argument;\n if (arg.type === AST_NODE_TYPES.Identifier && arg.typeAnnotation) {\n return arg.typeAnnotation.typeAnnotation;\n }\n return null;\n }\n\n case AST_NODE_TYPES.ArrayPattern:\n case AST_NODE_TYPES.ObjectPattern:\n case AST_NODE_TYPES.TSParameterProperty:\n default:\n return null;\n }\n}\n\n/**\n * Check if the first parameter of the command handler function is a valid options parameter.\n *\n * @remarks\n * The first parameter of the command handler function should represent the command's potential options. As a result, it must be an object type with properties.\n *\n * This function will check if the first parameter is of an object type with properties, which can be represented as a type literal, an intersection type including a type literal, or a reference to an interface/type alias that resolves to an object type with properties.\n *\n * @param body - The body of the program, used to check for type/interface declarations when validating the options parameter.\n * @param node - The function node representing the command handler, used to access its parameters and validate the first parameter as the options parameter.\n * @returns A boolean indicating whether the first parameter is a valid options parameter or not.\n */\nfunction isFirstParamOptions(\n body: TSESTree.ProgramStatement[],\n node: TSESTree.FunctionDeclaration | TSESTree.ArrowFunctionExpression\n): boolean {\n if (node.params.length > 0 && node.params[0]) {\n const type = getTypeNode(node.params[0]);\n if (!type) {\n return false;\n }\n\n if (\n type.type === AST_NODE_TYPES.TSTypeLiteral &&\n type.members.some(\n member => member.type === AST_NODE_TYPES.TSPropertySignature\n )\n ) {\n return true;\n } else if (\n type.type === AST_NODE_TYPES.TSIntersectionType &&\n type.types.some(\n type =>\n type.type === AST_NODE_TYPES.TSTypeLiteral &&\n type.members.some(\n member => member.type === AST_NODE_TYPES.TSPropertySignature\n )\n )\n ) {\n return true;\n } else if (\n type.type === AST_NODE_TYPES.TSTypeReference &&\n type.typeName.type === AST_NODE_TYPES.Identifier\n ) {\n const typeName = type.typeName.name;\n if (\n !body.some(\n localBlock =>\n (localBlock.type === AST_NODE_TYPES.TSInterfaceDeclaration &&\n localBlock.id.name === typeName) ||\n (localBlock.type === AST_NODE_TYPES.TSTypeAliasDeclaration &&\n localBlock.id.name === typeName &&\n ((localBlock.typeAnnotation.type ===\n AST_NODE_TYPES.TSTypeLiteral &&\n localBlock.typeAnnotation.members.some(\n member => member.type === AST_NODE_TYPES.TSPropertySignature\n )) ||\n (localBlock.typeAnnotation.type ===\n AST_NODE_TYPES.TSIntersectionType &&\n localBlock.typeAnnotation.types.some(\n type =>\n type.type === AST_NODE_TYPES.TSTypeLiteral &&\n type.members.some(\n member =>\n member.type === AST_NODE_TYPES.TSPropertySignature\n )\n ))))\n )\n ) {\n return true;\n }\n }\n }\n\n return false;\n}\n\n/**\n * Checks the validity of the command handler function's positional argument parameters.\n *\n * @remarks\n * All parameters except the first should represent the command's positional arguments, and as a result, their types must be included in the following list:\n * - string\n * - number\n * - boolean\n * - number or string or boolean literal\n * - string[]\n * - number[]\n * - number or string or boolean literal array\n *\n * @param body - The body of the program, used to check for type/interface declarations when validating the args parameters.\n * @param node - The function node representing the command handler, used to access its parameters and validate their types.\n * @param context - The ESLint rule context, used to report any validation errors found in the parameters.\n */\nfunction checkArgsParam(\n body: TSESTree.ProgramStatement[],\n node: TSESTree.FunctionDeclaration | TSESTree.ArrowFunctionExpression,\n context: Readonly<RuleContext<\"invalidArgsParam\", []>>\n) {\n if (node.params.length > 1 || !isFirstParamOptions(body, node)) {\n (isFirstParamOptions(body, node)\n ? node.params.slice(1)\n : node.params\n ).forEach(param => {\n const type = getTypeNode(param);\n if (\n type?.type !== AST_NODE_TYPES.TSStringKeyword &&\n type?.type !== AST_NODE_TYPES.TSNumberKeyword &&\n type?.type !== AST_NODE_TYPES.TSBooleanKeyword &&\n !(\n type?.type === AST_NODE_TYPES.TSUnionType &&\n type.types.every(\n t =>\n t.type === AST_NODE_TYPES.TSLiteralType &&\n t.literal.type === AST_NODE_TYPES.Literal &&\n (typeof t.literal.value === \"string\" ||\n typeof t.literal.value === \"number\" ||\n typeof t.literal.value === \"boolean\")\n )\n ) &&\n !(\n type?.type === AST_NODE_TYPES.TSTypeReference &&\n type.typeName.type === AST_NODE_TYPES.Identifier &&\n body.some(\n localBlock =>\n localBlock.type === AST_NODE_TYPES.TSTypeAliasDeclaration &&\n localBlock.id.name ===\n (type.typeName as TSESTree.Identifier).name &&\n (localBlock.typeAnnotation.type ===\n AST_NODE_TYPES.TSStringKeyword ||\n localBlock.typeAnnotation.type ===\n AST_NODE_TYPES.TSNumberKeyword ||\n localBlock.typeAnnotation.type ===\n AST_NODE_TYPES.TSBooleanKeyword ||\n (localBlock.typeAnnotation.type ===\n AST_NODE_TYPES.TSUnionType &&\n localBlock.typeAnnotation.types.every(\n t =>\n t.type === AST_NODE_TYPES.TSLiteralType &&\n t.literal.type === AST_NODE_TYPES.Literal &&\n (typeof t.literal.value === \"string\" ||\n typeof t.literal.value === \"number\" ||\n typeof t.literal.value === \"boolean\")\n )))\n )\n ) &&\n !(\n type?.type === AST_NODE_TYPES.TSArrayType &&\n (type.elementType.type === AST_NODE_TYPES.TSStringKeyword ||\n type.elementType.type === AST_NODE_TYPES.TSNumberKeyword ||\n type.elementType.type === AST_NODE_TYPES.TSBooleanKeyword ||\n (type.elementType.type === AST_NODE_TYPES.TSUnionType &&\n type.elementType.types.every(\n t =>\n t.type === AST_NODE_TYPES.TSLiteralType &&\n t.literal.type === AST_NODE_TYPES.Literal &&\n (typeof t.literal.value === \"string\" ||\n typeof t.literal.value === \"number\" ||\n typeof t.literal.value === \"boolean\")\n )) ||\n (type.elementType.type === AST_NODE_TYPES.TSTypeReference &&\n type.elementType.typeName.type === AST_NODE_TYPES.Identifier &&\n body.some(\n localBlock =>\n localBlock.type === AST_NODE_TYPES.TSTypeAliasDeclaration &&\n localBlock.id.name ===\n (\n (type.elementType as TSESTree.TSTypeReference)\n .typeName as TSESTree.Identifier\n ).name &&\n (localBlock.typeAnnotation.type ===\n AST_NODE_TYPES.TSStringKeyword ||\n localBlock.typeAnnotation.type ===\n AST_NODE_TYPES.TSNumberKeyword ||\n localBlock.typeAnnotation.type ===\n AST_NODE_TYPES.TSBooleanKeyword ||\n (localBlock.typeAnnotation.type ===\n AST_NODE_TYPES.TSUnionType &&\n localBlock.typeAnnotation.types.every(\n t =>\n t.type === AST_NODE_TYPES.TSLiteralType &&\n t.literal.type === AST_NODE_TYPES.Literal &&\n (typeof t.literal.value === \"string\" ||\n typeof t.literal.value === \"number\" ||\n typeof t.literal.value === \"boolean\")\n )))\n )))\n )\n ) {\n context.report({\n node: type!,\n messageId: \"invalidArgsParam\"\n });\n }\n });\n }\n}\n\nexport default createRule<Options, MessageIds>({\n name: RULE_NAME,\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"The command handler function must have a valid parameter types.\"\n },\n schema: [],\n messages: {\n 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:\n- string\n- number\n- boolean\n- string or number or boolean literal\n- string array\n- number array\n- boolean array\n- string or number or boolean literal array `\n }\n },\n defaultOptions: [],\n create: context => {\n return {\n Program(node) {\n const fileName = context.filename ?? context.getFilename();\n if (\n findFileName(fileName, {\n withExtension: false\n }) !== \"command\"\n ) {\n return;\n }\n\n for (const block of node.body) {\n if (block.type === \"ExportDefaultDeclaration\") {\n // export default async function handler() {...}\n if (block.declaration?.type === \"FunctionDeclaration\") {\n if (block.declaration.params.length > 0) {\n checkArgsParam(node.body, block.declaration, context);\n }\n } else if (block.declaration?.type === \"Identifier\") {\n // async function handler() {...}; export default handler;\n const targetName = block.declaration.name;\n const functionDeclaration = node.body.find(\n localBlock =>\n (localBlock.type === \"FunctionDeclaration\" &&\n localBlock.id.name === targetName) ||\n (localBlock.type === \"VariableDeclaration\" &&\n localBlock.declarations.find(\n declaration =>\n declaration.id?.type === \"Identifier\" &&\n declaration.id.name === targetName\n ))\n );\n if (functionDeclaration?.type === \"FunctionDeclaration\") {\n checkArgsParam(node.body, functionDeclaration, context);\n } else if (functionDeclaration?.type === \"VariableDeclaration\") {\n const varDeclarator = functionDeclaration.declarations.find(\n declaration =>\n declaration.id?.type === \"Identifier\" &&\n declaration.id.name === targetName\n );\n if (varDeclarator?.init?.type === \"ArrowFunctionExpression\") {\n checkArgsParam(node.body, varDeclarator.init, context);\n }\n }\n }\n }\n }\n }\n };\n }\n});\n"],"mappings":"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"}
1
+ {"version":3,"file":"invalid-handler-params.mjs","names":[],"sources":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/eslint-plugin",
3
- "version": "0.0.75",
3
+ "version": "0.0.77",
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"],
@@ -40,119 +40,36 @@
40
40
  ],
41
41
  "type": "module",
42
42
  "exports": {
43
- ".": {
44
- "require": {
45
- "types": "./dist/index.d.cts",
46
- "default": "./dist/index.cjs"
47
- },
48
- "import": {
49
- "types": "./dist/index.d.mts",
50
- "default": "./dist/index.mjs"
51
- },
52
- "default": {
53
- "types": "./dist/index.d.mts",
54
- "default": "./dist/index.mjs"
55
- }
56
- },
43
+ ".": { "import": "./dist/index.mjs", "require": "./dist/index.cjs" },
57
44
  "./configs": {
58
- "require": {
59
- "types": "./dist/configs/index.d.cts",
60
- "default": "./dist/configs/index.cjs"
61
- },
62
- "import": {
63
- "types": "./dist/configs/index.d.mts",
64
- "default": "./dist/configs/index.mjs"
65
- },
66
- "default": {
67
- "types": "./dist/configs/index.d.mts",
68
- "default": "./dist/configs/index.mjs"
69
- }
45
+ "import": "./dist/configs/index.mjs",
46
+ "require": "./dist/configs/index.cjs"
70
47
  },
71
48
  "./configs/base": {
72
- "require": {
73
- "types": "./dist/configs/base.d.cts",
74
- "default": "./dist/configs/base.cjs"
75
- },
76
- "import": {
77
- "types": "./dist/configs/base.d.mts",
78
- "default": "./dist/configs/base.mjs"
79
- },
80
- "default": {
81
- "types": "./dist/configs/base.d.mts",
82
- "default": "./dist/configs/base.mjs"
83
- }
49
+ "import": "./dist/configs/base.mjs",
50
+ "require": "./dist/configs/base.cjs"
84
51
  },
85
52
  "./configs/recommended": {
86
- "require": {
87
- "types": "./dist/configs/recommended.d.cts",
88
- "default": "./dist/configs/recommended.cjs"
89
- },
90
- "import": {
91
- "types": "./dist/configs/recommended.d.mts",
92
- "default": "./dist/configs/recommended.mjs"
93
- },
94
- "default": {
95
- "types": "./dist/configs/recommended.d.mts",
96
- "default": "./dist/configs/recommended.mjs"
97
- }
53
+ "import": "./dist/configs/recommended.mjs",
54
+ "require": "./dist/configs/recommended.cjs"
98
55
  },
99
- "./package.json": "./package.json",
100
56
  "./plugin": {
101
- "require": {
102
- "types": "./dist/plugin.d.cts",
103
- "default": "./dist/plugin.cjs"
104
- },
105
- "import": {
106
- "types": "./dist/plugin.d.mts",
107
- "default": "./dist/plugin.mjs"
108
- },
109
- "default": {
110
- "types": "./dist/plugin.d.mts",
111
- "default": "./dist/plugin.mjs"
112
- }
57
+ "import": "./dist/plugin.mjs",
58
+ "require": "./dist/plugin.cjs"
113
59
  },
114
60
  "./rules/duplicate-command-path": {
115
- "require": {
116
- "types": "./dist/rules/duplicate-command-path.d.cts",
117
- "default": "./dist/rules/duplicate-command-path.cjs"
118
- },
119
- "import": {
120
- "types": "./dist/rules/duplicate-command-path.d.mts",
121
- "default": "./dist/rules/duplicate-command-path.mjs"
122
- },
123
- "default": {
124
- "types": "./dist/rules/duplicate-command-path.d.mts",
125
- "default": "./dist/rules/duplicate-command-path.mjs"
126
- }
61
+ "import": "./dist/rules/duplicate-command-path.mjs",
62
+ "require": "./dist/rules/duplicate-command-path.cjs"
127
63
  },
128
64
  "./rules/invalid-command-export": {
129
- "require": {
130
- "types": "./dist/rules/invalid-command-export.d.cts",
131
- "default": "./dist/rules/invalid-command-export.cjs"
132
- },
133
- "import": {
134
- "types": "./dist/rules/invalid-command-export.d.mts",
135
- "default": "./dist/rules/invalid-command-export.mjs"
136
- },
137
- "default": {
138
- "types": "./dist/rules/invalid-command-export.d.mts",
139
- "default": "./dist/rules/invalid-command-export.mjs"
140
- }
65
+ "import": "./dist/rules/invalid-command-export.mjs",
66
+ "require": "./dist/rules/invalid-command-export.cjs"
141
67
  },
142
68
  "./rules/invalid-handler-params": {
143
- "require": {
144
- "types": "./dist/rules/invalid-handler-params.d.cts",
145
- "default": "./dist/rules/invalid-handler-params.cjs"
146
- },
147
- "import": {
148
- "types": "./dist/rules/invalid-handler-params.d.mts",
149
- "default": "./dist/rules/invalid-handler-params.mjs"
150
- },
151
- "default": {
152
- "types": "./dist/rules/invalid-handler-params.d.mts",
153
- "default": "./dist/rules/invalid-handler-params.mjs"
154
- }
155
- }
69
+ "import": "./dist/rules/invalid-handler-params.mjs",
70
+ "require": "./dist/rules/invalid-handler-params.cjs"
71
+ },
72
+ "./package.json": "./package.json"
156
73
  },
157
74
  "main": "./dist/index.cjs",
158
75
  "module": "./dist/index.mjs",
@@ -160,29 +77,29 @@
160
77
  "typings": "dist/index.d.mts",
161
78
  "files": ["dist/**/*"],
162
79
  "dependencies": {
163
- "@stryke/fs": "^0.33.70",
164
- "@stryke/path": "^0.28.2",
165
- "@typescript-eslint/utils": "^8.59.2",
80
+ "@stryke/fs": "^0.33.85",
81
+ "@stryke/path": "^0.29.11",
82
+ "@typescript-eslint/utils": "^8.60.1",
166
83
  "defu": "^6.1.7",
167
- "@storm-software/testing-tools": "^1.119.155",
168
- "powerlines": "^0.47.4"
84
+ "@storm-software/testing-tools": "^1.119.193",
85
+ "powerlines": "^0.47.126"
169
86
  },
170
87
  "devDependencies": {
171
- "@eslint/compat": "^2.0.5",
88
+ "@eslint/compat": "^2.1.0",
172
89
  "@eslint/config-inspector": "^1.5.0",
173
- "@powerlines/plugin-tsdown": "^0.1.406",
174
- "@storm-software/testing-tools": "^1.119.155",
90
+ "@powerlines/plugin-tsdown": "^0.1.527",
91
+ "@storm-software/testing-tools": "^1.119.193",
175
92
  "@types/eslint": "^9.6.1",
176
93
  "@types/eslint__js": "^9.14.0",
177
- "@types/node": "^25.6.0",
94
+ "@types/node": "^25.9.1",
178
95
  "eslint": "^9.39.4",
179
- "eslint-doc-generator": "^3.3.2",
96
+ "eslint-doc-generator": "^3.6.0",
180
97
  "eslint-flat-config-utils": "^2.1.4",
181
- "eslint-plugin-eslint-plugin": "^7.3.3",
98
+ "eslint-plugin-eslint-plugin": "^7.4.0",
182
99
  "eslint-plugin-i18n-text": "^1.0.1",
183
100
  "eslint-rule-documentation": "^1.0.23",
184
101
  "eslint-typegen": "^2.3.1",
185
- "powerlines": "^0.47.4"
102
+ "powerlines": "^0.47.126"
186
103
  },
187
104
  "peerDependencies": { "eslint": ">=9.39.3" },
188
105
  "peerDependenciesMeta": { "eslint": { "optional": false } },
@@ -217,5 +134,5 @@
217
134
  "./package.json": "./package.json"
218
135
  }
219
136
  },
220
- "gitHead": "7b4030fd6be000c960e8cc4c4f7b4db205054e69"
137
+ "gitHead": "3c10901dd3fbbc3c9d6d1a3373f01cc5f56d3321"
221
138
  }