@shell-shock/eslint-plugin 0.0.53 → 0.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ This package is part of the ⚡<b>Shell Shock</b> monorepo. The Shell Shock pack
|
|
|
27
27
|
|
|
28
28
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
29
29
|
|
|
30
|
-
[](https://stormsoftware.com/projects/shell-shock/) [](http://commitizen.github.io/cz-cli/)  
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
package/dist/package.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`0.0.
|
|
1
|
+
var e=`0.0.55`;Object.defineProperty(exports,`version`,{enumerable:!0,get:function(){return e}});
|
package/dist/package.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=`0.0.
|
|
1
|
+
var e=`0.0.55`;export{e as version};
|
|
2
2
|
//# sourceMappingURL=package.mjs.map
|
|
@@ -1 +1,8 @@
|
|
|
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
|
|
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`)))&&!(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`)))))&&!(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.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`))||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.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`))))))&&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
|
+
- string
|
|
3
|
+
- number
|
|
4
|
+
- boolean
|
|
5
|
+
- number or boolean literal
|
|
6
|
+
- string[]
|
|
7
|
+
- number[]
|
|
8
|
+
- number or string literal array `}},defaultOptions:[],create:e=>({Program(n){if((0,t.findFileName)(e.filename??e.getFilename(),{withExtension:!1})===`command`){for(let t of n.body)if(t.type===`ExportDefaultDeclaration`){if(t.declaration?.type===`FunctionDeclaration`)t.declaration.params.length>0&&o(n.body,t.declaration,e);else if(t.declaration?.type===`Identifier`){let r=t.declaration.name,i=n.body.find(e=>e.type===`FunctionDeclaration`&&e.id.name===r||e.type===`VariableDeclaration`&&e.declarations.find(e=>e.id?.type===`Identifier`&&e.id.name===r));if(i?.type===`FunctionDeclaration`)o(n.body,i,e);else if(i?.type===`VariableDeclaration`){let t=i.declarations.find(e=>e.id?.type===`Identifier`&&e.id.name===r);t?.init?.type===`ArrowFunctionExpression`&&o(n.body,t.init,e)}}}}}})});exports.RULE_NAME=r,exports.default=s;
|
|
@@ -1,2 +1,9 @@
|
|
|
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
|
|
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`)))&&!(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`)))))&&!(a?.type===n.TSArrayType&&(a.elementType.type===n.TSStringKeyword||a.elementType.type===n.TSNumberKeyword||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`))||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.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`))))))&&r.report({node:a,messageId:`invalidArgsParam`})})}var s=e({name:r,meta:{type:`problem`,docs:{description:`The command handler function must have a valid parameter types.`},schema:[],messages:{invalidArgsParam:`All command handler function parameters, with the potential exception of the first (which can represent the command's options), should represent the command's positional arguments. As a result, these parameters' types must be included in the following list:
|
|
2
|
+
- string
|
|
3
|
+
- number
|
|
4
|
+
- boolean
|
|
5
|
+
- number or boolean literal
|
|
6
|
+
- string[]
|
|
7
|
+
- number[]
|
|
8
|
+
- number or string literal array `}},defaultOptions:[],create:e=>({Program(n){if(t(e.filename??e.getFilename(),{withExtension:!1})===`command`){for(let t of n.body)if(t.type===`ExportDefaultDeclaration`){if(t.declaration?.type===`FunctionDeclaration`)t.declaration.params.length>0&&o(n.body,t.declaration,e);else if(t.declaration?.type===`Identifier`){let r=t.declaration.name,i=n.body.find(e=>e.type===`FunctionDeclaration`&&e.id.name===r||e.type===`VariableDeclaration`&&e.declarations.find(e=>e.id?.type===`Identifier`&&e.id.name===r));if(i?.type===`FunctionDeclaration`)o(n.body,i,e);else if(i?.type===`VariableDeclaration`){let t=i.declarations.find(e=>e.id?.type===`Identifier`&&e.id.name===r);t?.init?.type===`ArrowFunctionExpression`&&o(n.body,t.init,e)}}}}}})});export{r as RULE_NAME,s as default};
|
|
2
9
|
//# sourceMappingURL=invalid-handler-params.mjs.map
|
|
@@ -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 * - string[]\n * - number[]\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 node.params.slice(1).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 type?.type !== AST_NODE_TYPES.TSTypeLiteral &&\n type?.type !== AST_NODE_TYPES.TSIntersectionType &&\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.TSInterfaceDeclaration &&\n localBlock.id.name === type.typeName.type) ||\n (localBlock.type === AST_NODE_TYPES.TSTypeAliasDeclaration &&\n localBlock.id.name === type.typeName.type &&\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 !(\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.TSTypeLiteral ||\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.TSInterfaceDeclaration &&\n localBlock.id.name ===\n (type.elementType as TSESTree.TSTypeReference).typeName\n .type) ||\n (localBlock.type === AST_NODE_TYPES.TSTypeAliasDeclaration &&\n localBlock.id.name ===\n (type.elementType as TSESTree.TSTypeReference).typeName\n .type &&\n ((localBlock.typeAnnotation.type ===\n AST_NODE_TYPES.TSTypeLiteral &&\n localBlock.typeAnnotation.members.some(\n member =>\n 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 ===\n AST_NODE_TYPES.TSPropertySignature\n )\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:\n \"All command handler function parameters except the first should represent the command's positional arguments. As a result, their types must be included in the following list: string, number, boolean, number or boolean literal, string[], number[], or number or string 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":"4KAwBA,MAAa,EAAY,yBAIzB,SAAS,EAAY,EAAqD,CACxE,OAAQ,EAAM,KAAd,CACE,KAAK,EAAe,WAClB,OAAO,E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EAAK,QAAQ,KACX,GACE,EAAO,OACP,EAAe,oBAClB,CACJ,EACV,IAGP,EAAQ,OAAO,CACb,KAAM,EACN,UAAW,mBACZ,CAAC,EAEJ,CAIN,IAAA,EAAe,EAAgC,CAC7C,KAAM,EACN,KAAM,CACJ,KAAM,UACN,KAAM,CACJ,YACE,kEACH,CACD,OAAQ,EAAE,CACV,SAAU,CACR,iBACE,4RACH,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,+BAEb,EAAM,aAAa,OAAS,sBAC1B,EAAM,YAAY,OAAO,OAAS,GACpC,EAAe,EAAK,KAAM,EAAM,YAAa,EAAQ,SAE9C,EAAM,aAAa,OAAS,aAAc,CAEnD,IAAM,EAAa,EAAM,YAAY,KAC/B,EAAsB,EAAK,KAAK,KACpC,GACG,EAAW,OAAS,uBACnB,EAAW,GAAG,OAAS,GACxB,EAAW,OAAS,uBACnB,EAAW,aAAa,KACtB,GACE,EAAY,IAAI,OAAS,cACzB,EAAY,GAAG,OAAS,EAC3B,CACN,CACD,GAAI,GAAqB,OAAS,sBAChC,EAAe,EAAK,KAAM,EAAqB,EAAQ,SAC9C,GAAqB,OAAS,sBAAuB,CAC9D,IAAM,EAAgB,EAAoB,aAAa,KACrD,GACE,EAAY,IAAI,OAAS,cACzB,EAAY,GAAG,OAAS,EAC3B,CACG,GAAe,MAAM,OAAS,2BAChC,EAAe,EAAK,KAAM,EAAc,KAAM,EAAQ,MAOnE,EAEJ,CAAC"}
|
|
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 literal\n * - string[]\n * - number[]\n * - number or string 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 )\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 )))\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.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 )) ||\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.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 )))\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- number or boolean literal\n- string[]\n- number[]\n- number or string 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":"4KAwBA,MAAa,EAAY,yBAIzB,SAAS,EAAY,EAAqD,CACxE,OAAQ,EAAM,KAAd,CACE,KAAK,EAAe,WAClB,OAAO,EAAM,eAAiB,EAAM,eAAe,eAAiB,KAEtE,KAAK,EAAe,kBAAmB,CACrC,IAAM,EAAO,EAAM,KAInB,OAHI,EAAK,OAAS,EAAe,YAAc,EAAK,eAC3C,EAAK,eAAe,eAEtB,KAGT,KAAK,EAAe,YAAa,CAC/B,IAAM,EAAM,EAAM,SAIlB,OAHI,EAAI,OAAS,EAAe,YAAc,EAAI,eACzC,EAAI,eAAe,eAErB,KAGT,KAAK,EAAe,aACpB,KAAK,EAAe,cACpB,KAAK,EAAe,oBACpB,QACE,OAAO,MAgBb,SAAS,EACP,EACA,EACS,CACT,GAAI,EAAK,OAAO,OAAS,GAAK,EAAK,OAAO,GAAI,CAC5C,IAAM,EAAO,EAAY,EAAK,OAAO,GAAG,CACxC,GAAI,CAAC,EACH,MAAO,MAIP,EAAK,OAAS,EAAe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,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,+BAEb,EAAM,aAAa,OAAS,sBAC1B,EAAM,YAAY,OAAO,OAAS,GACpC,EAAe,EAAK,KAAM,EAAM,YAAa,EAAQ,SAE9C,EAAM,aAAa,OAAS,aAAc,CAEnD,IAAM,EAAa,EAAM,YAAY,KAC/B,EAAsB,EAAK,KAAK,KACpC,GACG,EAAW,OAAS,uBACnB,EAAW,GAAG,OAAS,GACxB,EAAW,OAAS,uBACnB,EAAW,aAAa,KACtB,GACE,EAAY,IAAI,OAAS,cACzB,EAAY,GAAG,OAAS,EAC3B,CACN,CACD,GAAI,GAAqB,OAAS,sBAChC,EAAe,EAAK,KAAM,EAAqB,EAAQ,SAC9C,GAAqB,OAAS,sBAAuB,CAC9D,IAAM,EAAgB,EAAoB,aAAa,KACrD,GACE,EAAY,IAAI,OAAS,cACzB,EAAY,GAAG,OAAS,EAC3B,CACG,GAAe,MAAM,OAAS,2BAChC,EAAe,EAAK,KAAM,EAAc,KAAM,EAAQ,MAOnE,EAEJ,CAAC"}
|
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.55",
|
|
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"],
|
|
@@ -217,5 +217,5 @@
|
|
|
217
217
|
"./package.json": "./package.json"
|
|
218
218
|
}
|
|
219
219
|
},
|
|
220
|
-
"gitHead": "
|
|
220
|
+
"gitHead": "27a9e457bd50dd3576a1edf1882f43d82a402743"
|
|
221
221
|
}
|