Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issuegood first issueGood for newcomerslocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.refactorPRs that refactor code onlyrepo maintenancethings to do with maintenance of the repo, and not with code/docs
Description
Suggestion
Followup for#8011 (comment)
We've added few utility functions to thepackages/type-utils/src/builtinSymbolLikes.ts
Basically they contain the logic for determining whether a given type is a type from the TS default library or not
These files already contain similar logic, it'd be cool if we dedupe it!
| if(symbol&&symbol.escapedName===FUNCTION_CONSTRUCTOR){ | |
| constdeclarations=symbol.getDeclarations()??[]; | |
| for(constdeclarationofdeclarations){ | |
| constsourceFile=declaration.getSourceFile(); | |
| if(services.program.isSourceFileDefaultLibrary(sourceFile)){ | |
| returntrue; | |
| } | |
| } | |
| } |
typescript-eslint/packages/eslint-plugin/src/rules/no-implied-eval.ts
Lines 145 to 153 in705370a
| if(symbol){ | |
| constdeclarations=symbol.getDeclarations()??[]; | |
| for(constdeclarationofdeclarations){ | |
| constsourceFile=declaration.getSourceFile(); | |
| if(services.program.isSourceFileDefaultLibrary(sourceFile)){ | |
| context.report({ node,messageId:'noFunctionConstructor'}); | |
| return; | |
| } | |
| } |
Let's label this issue asgood first issue? Ref:#8011 (comment)
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issuegood first issueGood for newcomerslocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.refactorPRs that refactor code onlyrepo maintenancethings to do with maintenance of the repo, and not with code/docs