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
...there's no way for custom rules written in TypeScript to enforce that the type of node matches its AST shape. Which means devs can write blatantly wrong code like:
Is eslint-plugin-eslint-plugin an appropriate place to write a lint rule that makes sure the type annotation on a node matches the node itself?
This rule might be tricky to write given that microsoft/TypeScript#9879 blocks having a TypeScript API to check type assignability. The rule could use basic string comparisons in the meantime.
The text was updated successfully, but these errors were encountered:
Copying conversation from typescript-eslint/typescript-eslint#4065 (comment) & typescript-eslint/typescript-eslint#6444 (comment): typescript-eslint doesn't have a way to infer the types of nodes when the ESQuery selector is complex:
Even with these two not(-yet?)-implemented helpers (neither of which may ever be useful for public consumers):
...there's no way for custom rules written in TypeScript to enforce that the type of
node
matches its AST shape. Which means devs can write blatantly wrong code like:Is
eslint-plugin-eslint-plugin
an appropriate place to write a lint rule that makes sure the type annotation on a node matches the node itself?This rule might be tricky to write given that microsoft/TypeScript#9879 blocks having a TypeScript API to check type assignability. The rule could use basic string comparisons in the meantime.
The text was updated successfully, but these errors were encountered: