Skip to content

Commit

Permalink
Fix typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov committed Feb 12, 2023
1 parent 5e5145a commit 03b97c8
Show file tree
Hide file tree
Showing 4 changed files with 13,978 additions and 13,842 deletions.
5 changes: 4 additions & 1 deletion lib/rules/node-execute-block-error-missing-item-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default utils.createRule({
for (const statement of throwStatements) {
if (
statement.argument === null ||
// @ts-ignore @TODO: This does not typecheck but AST check is correct
statement.argument.type !== AST_NODE_TYPES.NewExpression
) {
continue;
Expand All @@ -58,7 +59,9 @@ export default utils.createRule({
// covered by node-execute-block-wrong-error-thrown
if (!isNodeErrorType(statement.argument)) continue;

const { arguments: errorArguments } = statement.argument;
const { arguments: errorArguments } = statement.argument as {
arguments: TSESTree.Expression[];
};

if (errorArguments.length !== 3 && indexName === "itemIndex") {
context.report({
Expand Down
Loading

0 comments on commit 03b97c8

Please sign in to comment.