Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TS config files #1917

Open
Tracked by #201
polyzen opened this issue Aug 9, 2024 · 8 comments
Open
Tracked by #201

Support TS config files #1917

polyzen opened this issue Aug 9, 2024 · 8 comments
Labels
feature-request Request for new features or functionality good first issue help wanted Issues identified as good community contribution opportunities
Milestone

Comments

@polyzen
Copy link

polyzen commented Aug 9, 2024

ESLint 9.9.0 was just released with support for TS config files:
eslint/eslint#18134

@polyzen
Copy link
Author

polyzen commented Aug 9, 2024

Not sure if it's as simple as adding eslint.config.ts, eslint.config.mts, and eslint.config.cts to https://github.com/microsoft/vscode-eslint/blob/release/3.0.10/server/src/eslint.ts#L800

Edit: For the VS Code client these need to be updated (seems they're also missing .mjs and .cjs?):
https://github.com/microsoft/vscode-eslint/blob/release/3.0.10/client/src/client.ts#L140
https://github.com/microsoft/vscode-eslint/blob/release/3.0.10/client/src/client.ts#L424

@polyzen
Copy link
Author

polyzen commented Aug 9, 2024

Need also to at least pass --flag unstable_ts_config, but not having success using a TS config with just ESLint myself yet.
https://eslint.org/docs/latest/use/configure/configuration-files#typescript-configuration-files

@hyoban
Copy link
Contributor

hyoban commented Aug 10, 2024

You can add the following settings:

{
  "eslint.options": {
    "flags": ["unstable_ts_config"]
  }
}

eslint.options: options to configure how ESLint is started using either the ESLint class API or the CLIEngine API.

options.flags (string[])
Default is []. The feature flags to enable for this instance.

@dbaeumer
Copy link
Member

I added mjs and cjs to the watcher pattern. With the ts I would like to wait to see where the feature in eslint is heading to.

@dbaeumer dbaeumer added this to the Backlog milestone Aug 12, 2024
@dbaeumer dbaeumer added help wanted Issues identified as good community contribution opportunities good first issue labels Aug 12, 2024
@nzakas
Copy link

nzakas commented Aug 16, 2024

@dbaeumer what questions can I answer about this feature for you?

(In general, feel free to reach out via GitHub discussion or Discord if you're ever blocked waiting for info about what ESLint is doing.)

@dbaeumer
Copy link
Member

@nzakas my biggest question is currently why this is in ESLint since NodeJS itself added experimental support for this: https://nodejs.org/api/typescript.html#type-stripping

@nzakas
Copy link

nzakas commented Aug 20, 2024

@dbaeumer because ESLint needs to run on multiple versions of Node.js, some of which don't have experimental support, as well as Bun and Deno. Once TypeScript support is built into Node.js as stable, and we are able to move off of support for older versions, we can remove the jiti dependency.

@dbaeumer
Copy link
Member

@gorstak17 please open a fresh issue for your problem, best with a GitHub repository I can clone with a minimal repro case that demos the problem you are seeing. This being said, please ensure that ESLint works correctly in the terminal before file the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality good first issue help wanted Issues identified as good community contribution opportunities
Projects
None yet
Development

No branches or pull requests

4 participants