Closed
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
declare function foo(param: any): any
foo(Symbol.for('foo'))
ESLint Config
module.exports = {
"rules": {
"@typescript-eslint/prefer-find": "error"
}
}
tsconfig
Expected Result
No lint error.
Actual Result
Locally the error message is more expressive than in the playground:
TypeError: Cannot convert a Symbol value to a number
Occurred while linting …/foo.ts:3
Rule: "@typescript-eslint/prefer-find"
at Number (<anonymous>)
at isTreatedAsZeroByArrayAt (…/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-find.js:129:30)
at getObjectIfArrayAtExpression (…/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-find.js:114:39)
at CallExpression (…/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-find.js:165:32)
at ruleErrorHandler (…/node_modules/eslint/lib/linter/linter.js:1076:28)
at …/node_modules/eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach (<anonymous>)
at Object.emit (…/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
at NodeEventGenerator.applySelector …/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
at NodeEventGenerator.applySelectors (…/node_modules/eslint/lib/linter/node-event-generator.js:326:22)