@shell-shock/eslint-plugin 0.0.86 → 0.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs/base.cjs +1 -1
- package/dist/configs/base.d.cts +2 -2
- package/dist/configs/base.d.cts.map +1 -1
- package/dist/configs/base.d.mts +1 -2
- package/dist/configs/base.mjs +1 -1
- package/dist/configs/index.cjs +1 -1
- package/dist/configs/index.d.cts +0 -1
- package/dist/configs/index.d.cts.map +1 -1
- package/dist/configs/index.d.mts +0 -1
- package/dist/configs/index.mjs +1 -1
- package/dist/configs/recommended.cjs +1 -1
- package/dist/configs/recommended.d.cts +2 -2
- package/dist/configs/recommended.d.cts.map +1 -1
- package/dist/configs/recommended.d.mts +1 -2
- package/dist/configs/recommended.mjs +1 -1
- package/dist/helpers/create-rule.cjs +1 -1
- package/dist/helpers/create-rule.d.cts +1 -0
- package/dist/helpers/create-rule.d.cts.map +1 -1
- package/dist/helpers/create-rule.d.mts +1 -0
- package/dist/helpers/create-rule.mjs +1 -1
- package/dist/index.d.cts +2 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -3
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/plugin.d.cts +0 -1
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +0 -1
- package/dist/rules/duplicate-command-path.cjs +2 -2
- package/dist/rules/duplicate-command-path.d.cts +2 -3
- package/dist/rules/duplicate-command-path.d.cts.map +1 -1
- package/dist/rules/duplicate-command-path.d.mts +2 -3
- package/dist/rules/duplicate-command-path.mjs +2 -2
- package/dist/rules/invalid-command-export.cjs +1 -1
- package/dist/rules/invalid-command-export.d.cts +2 -3
- package/dist/rules/invalid-command-export.d.cts.map +1 -1
- package/dist/rules/invalid-command-export.d.mts +2 -3
- package/dist/rules/invalid-command-export.mjs +1 -1
- package/dist/rules/invalid-handler-params.cjs +2 -2
- package/dist/rules/invalid-handler-params.d.cts +2 -3
- package/dist/rules/invalid-handler-params.d.cts.map +1 -1
- package/dist/rules/invalid-handler-params.d.mts +2 -3
- package/dist/rules/invalid-handler-params.mjs +2 -2
- package/package.json +14 -14
- package/dist/_virtual/_rolldown/runtime.cjs +0 -1
package/dist/configs/base.cjs
CHANGED
|
@@ -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`}};
|
|
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;
|
package/dist/configs/base.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.cts","names":[],"sources":["../../src/configs/base.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"base.d.cts","names":[],"sources":["../../src/configs/base.ts"],"mappings":";;cAqBa,QAAQ,OAAO"}
|
package/dist/configs/base.d.mts
CHANGED
package/dist/configs/base.mjs
CHANGED
|
@@ -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
|
package/dist/configs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const 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;
|
package/dist/configs/index.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/configs/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/configs/index.ts"],"mappings":";;cAsBa,SAAS,eAAe,OAAO"}
|
package/dist/configs/index.d.mts
CHANGED
package/dist/configs/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e
|
|
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`}};
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommended.d.cts","names":[],"sources":["../../src/configs/recommended.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"recommended.d.cts","names":[],"sources":["../../src/configs/recommended.ts"],"mappings":";;cAqBa,QAAQ,OAAO"}
|
|
@@ -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
|
-
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-rule.d.cts","names":[],"sources":["../../src/helpers/create-rule.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-rule.d.cts","names":[],"sources":["../../src/helpers/create-rule.ts"],"mappings":";;;KA2BY,WAAW,gCAAgC,KAAK;EAC1D,gBAAgB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e
|
|
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
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":"
|
|
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
|
-
|
|
1
|
+
Object.defineProperty(exports,"version",{enumerable:!0,get:function(){return`0.0.87`}});
|
package/dist/package.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=`0.0.
|
|
1
|
+
var e=`0.0.87`;export{e as version};
|
|
2
2
|
//# sourceMappingURL=package.mjs.map
|
package/dist/plugin.d.cts
CHANGED
package/dist/plugin.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../src/plugin.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../src/plugin.ts"],"mappings":";;cAwBa;;;;;;8BAAA"}
|
package/dist/plugin.d.mts
CHANGED
|
@@ -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
|
|
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
|
|
6
|
+
declare const rule: RuleModule<[]>;
|
|
8
7
|
//#endregion
|
|
9
|
-
export { MessageIds, Options, RULE_NAME,
|
|
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":"
|
|
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
|
|
6
|
+
declare const rule: RuleModule<[]>;
|
|
8
7
|
//#endregion
|
|
9
|
-
export { MessageIds, Options, RULE_NAME,
|
|
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
|
|
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
|
|
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
|
|
6
|
+
declare const rule: RuleModule<[]>;
|
|
8
7
|
//#endregion
|
|
9
|
-
export { MessageIds, Options, RULE_NAME,
|
|
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":"
|
|
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
|
|
6
|
+
declare const rule: RuleModule<[]>;
|
|
8
7
|
//#endregion
|
|
9
|
-
export { MessageIds, Options, RULE_NAME,
|
|
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
|
|
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`})})}
|
|
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)(
|
|
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
|
|
6
|
+
declare const rule: RuleModule<[]>;
|
|
8
7
|
//#endregion
|
|
9
|
-
export { MessageIds, Options, RULE_NAME,
|
|
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":"
|
|
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
|
|
6
|
+
declare const rule: RuleModule<[]>;
|
|
8
7
|
//#endregion
|
|
9
|
-
export { MessageIds, Options, RULE_NAME,
|
|
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`})})}
|
|
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){
|
|
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.
|
|
3
|
+
"version": "0.0.88",
|
|
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
|
-
"@
|
|
81
|
-
"@stryke/
|
|
82
|
-
"@
|
|
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
|
-
"
|
|
85
|
-
"powerlines": "^0.47.137"
|
|
85
|
+
"powerlines": "^0.47.211"
|
|
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.
|
|
91
|
-
"@storm-software/testing-tools": "^1.119.
|
|
90
|
+
"@powerlines/plugin-tsdown": "^0.1.612",
|
|
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.
|
|
95
|
-
"eslint": "^10.
|
|
96
|
-
"eslint-doc-generator": "^3.
|
|
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.
|
|
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.
|
|
102
|
+
"powerlines": "^0.47.211"
|
|
103
103
|
},
|
|
104
104
|
"peerDependencies": { "eslint": ">=9.39.3" },
|
|
105
105
|
"peerDependenciesMeta": { "eslint": { "optional": false } },
|
|
106
106
|
"publishConfig": { "access": "public" },
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "06592cb0cccc2c7e9297af4c5138550e86fa4eec"
|
|
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;
|