$ eslint test.js
Oops! Something went wrong! :(
ESLint: 8.22.0
TypeError: Cannot read properties of undefined (reading 'regex')
Occurred while linting /home/ehmicky/Desktop/test.js:4
Rule: "ava/prefer-t-regex"
at isRegExp (/home/ehmicky/Desktop/node_modules/eslint-plugin-ava/rules/prefer-t-regex.js:83:14)
at equalityHandler (/home/ehmicky/Desktop/node_modules/eslint-plugin-ava/rules/prefer-t-regex.js:138:32)
at /home/ehmicky/Desktop/node_modules/eslint-plugin-ava/rules/prefer-t-regex.js:195:5
at /home/ehmicky/Desktop/node_modules/enhance-visitors/index.js:25:12
at /home/ehmicky/Desktop/node_modules/enhance-visitors/index.js:15:7
at ruleErrorHandler (/home/ehmicky/Desktop/node_modules/eslint/lib/linter/linter.js:1114:28)
at /home/ehmicky/Desktop/node_modules/eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach (<anonymous>)
at Object.emit (/home/ehmicky/Desktop/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (/home/ehmicky/Desktop/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
When
t.is()
is passed 0 or 1 argument instead of 2,prefer-t-regex
crashes.This is related to https://github.com/avajs/eslint-plugin-ava/issues/346, but that other issue seems to be more focused on graceful failures in general.
Steps to reproduce
test.js
:.eslintrc.yml
:ESLint:
8.22.0
eslint-plugin-ava
:13.2.0
Ava:4.3.1