Skip to content

Support "Type aware" linting for gts files #1995

Closed
@vstefanovic97

Description

@vstefanovic97

I'm not really a pro at Eslint nor Typescript Compiler, but I did notice this strange behaviour
To me it seems that "type aware" linting isn't really fully working.

For example if we import something from a gts file, whatever we imported, the @typescript-eslint/parser won't be aware of it's types

Here is a link to a fork where I setup a test with reproduction:
vstefanovic97@70235ac

This is my theory on why this is happening (though I might be wrong):

Right now we rely on @typescript-eslint/parser to do everything and we just forward options to it, but if we just rely on it, it will generate a Typescript Program w/o including any of our gts files. It seems like we need to create our own typescript Program with a custom CompilerHost that will know how to read gts files.

For context, terminology like Program and CompilerHost are from https://github.com/microsoft/TypeScript/wiki/Using-the-Compiler-API, and typescript-eslint supports us providing it a program in it's options so that seems like the way to go to me at least

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions