Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Repo: reuse newly added "is builtin symbol like" logic fromtype-utils #8234

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
@auvred

Description

@auvred

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;
}
}
}
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

No one assigned

    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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp