You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What code were you trying to parse?
I use @typescript-eslint/parser parser for TypeScript files.
When I try to lint the code below, It cannot parse functional type.
<MyButton// ... some codesonClick={handleSubmitas((e: any)=>void)}/>
What did you expect to happen?
Parse ((e: any)=> void) as usual type.
What actually happened?
Error: The prop value with an expression type of TSAsExpression could not be resolved.
Please file issue to get this fixed immediately.
Occurred while linting /Users/MyProject/src/MyComponent.tsx:151
at Object.extract [as JSXExpressionContainer] (/Users/MyProject/node_modules/jsx-ast-utils/lib/values/expressions/index.js:179:11)
at getValue (/Users/MyProject/node_modules/jsx-ast-utils/lib/values/index.js:48:27)
at extractValue (/Users/MyProject/node_modules/jsx-ast-utils/lib/getPropValue.js:24:12)
at getPropValue (/Users/MyProject/node_modules/jsx-ast-utils/lib/getPropValue.js:41:10)
at /Users/MyProject/node_modules/eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-interactions.js:90:95
at Array.some (<anonymous>)
at JSXOpeningElement (/Users/MyProject/node_modules/eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-interactions.js:89:52)
at listeners.(anonymous function).forEach.listener (/Users/MyProject/node_modules/eslint/lib/util/safe-emitter.js:45:58)
at Array.forEach (<anonymous>)
at Object.emit (/Users/MyProject/node_modules/eslint/lib/util/safe-emitter.js:45:38)
The text was updated successfully, but these errors were encountered:
ghost
changed the title
TSAsExpression could not be resolved on function type
TSAsExpression could not be resolved on function literal type
Sep 13, 2019
What code were you trying to parse?
I use
@typescript-eslint/parser
parser for TypeScript files.When I try to lint the code below, It cannot parse functional type.
What did you expect to happen?
Parse
((e: any)=> void)
as usual type.What actually happened?
Versions
@typescript-eslint/parser
2.1.0
TypeScript
3.4.5
ESLint
5.12.0
node
8.14.1
npm
6.11.3
( Came from typescript-eslint/typescript-eslint#966 )
So I've tried to figure it out,
https://github.com/evcohen/jsx-ast-utils/blob/master/src/values/expressions/index.js#L63-L91
but I don't know why TSAsExpression escape from
while
loop.The text was updated successfully, but these errors were encountered: