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

Enhancement: Allow project service to provide type information for out-of-project files #7871

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or request
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Before You File a Proposal Please Confirm You Have Done The Following...

Relevant Package

typescript-estree

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Description

Splitting out of#7435: that issue indicates that the error message for trying to generate type information for a file not recognized by thetsconfig.json is not ideal. But as we see in#7752, if we don't check to make sure that the file is recognized... type information still works! This issue tracks: can we allow "unknown" (not included in the TSConfig) files to have type info generated by the project service?

Not needing to explicitly include files in the TSConfig would be ideal from the perspective of simple configs. It'd mean we can get rid oftsconfig.eslint.json-style strategies of having a different TSConfig for your linted code. Those are commonly used to enableallowJs for root-level config files (e.g.eslint.config.js) not included in the project's TS-onlytsconfig.json.

We can't enable that kind of "config-less typed JS linting" with traditionalproject: true styles of approaches because of the following combination of tech restrictions:

  1. Thedefault program in TypeScript is a "builder": each time you add a new file to it, it recreates & recomputes a large swathe of nodes and types.
  2. ESLint does not provide us with APIs around when files are added, updated, or removed. We're restricted to just setting everything up once in the parser. Seefeat: parsing session objects eslint/rfcs#102.
  3. As a result, what was renamed toDEPRECATED__createDefaultProgram in v6 is known to cause significant slowdowns in non-trivial uses

If we can use the project service in a way that doesn't suffer from the same drawback, then that'd be a massive win for users.

Additional Info

Shoutout+thanks as always@jakebailey for helping us with the TypeScript side!

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or request

    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