Repo: Add a util for determining whether a node is a specific identifier #8327
Labels
locked due to age
Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
repo maintenance
things to do with maintenance of the repo, and not with code/docs
wontfix
This will not be worked on
Suggestion
Splits from #8295 (comment)
The proposal is to go over all of the places where we check if a node is a specific identifier and use a util for that. Here are a couple of examples of places we do this:
typescript-eslint/packages/eslint-plugin/src/rules/array-type.ts
Lines 31 to 34 in 82cb9dd
typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-assertions.ts
Lines 102 to 105 in a54a60b
typescript-eslint/packages/eslint-plugin/src/rules/no-explicit-any.ts
Lines 110 to 114 in e77616b
I think we can take inspiration from this existing function and extract it to a util:
typescript-eslint/packages/eslint-plugin/src/rules/no-inferrable-types.ts
Lines 73 to 80 in a54a60b
It might be a nice
good first issue
PR 😄The text was updated successfully, but these errors were encountered: