-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Change Request: Support .ts
files with TypeScript syntax by default
#19373
Comments
This is a heavy lift for such a short sentence. 😄 To double-check: do you literally mean the parser understands and produces an AST containing TypScript? Or do you mean we should strip TypeScript-specific syntax and produce an AST as if it were JS?
I'm not in favor of this. As we're moving more to a world where languages exist in plugins, I don't think adding more default extensions makes sense. |
I'd meant to ideate both, but really just defer to whatever is decided for #19173. |
I think #19173 is only tangentially related in that it's on the topic of TypeScript but doesn't really have any bearing on what the default parser does. I'm not sure if it makes sense to have TypeScript support built in to the default parser or if it would be better to a separate package so non-TS folks don't pay the extra cost. (The effort for this is sufficiently large that we should be sure to think deeply about it.) |
Oops! It looks like we lost track of this issue. What do we want to do here? This issue will auto-close in 7 days without an update. |
This issue was auto-closed due to inactivity. While we wish we could keep responding to every issue, we unfortunately don't have the bandwidth and need to focus on high-value issues. |
ESLint version
9.19.0
What problem do you want to solve?
Now that Node.js supports
.ts
files and type stripping by default (explainer post from Marco), ESLint is the last mainstream tool amongst the common (build, format, lint, test) list for many repositories to not support.ts
files by default. It would be very convenient for users if they could lint TypeScript syntax directly.What do you think is the correct solution?
Proposal:
.cts
,.mts
, and.ts
to the list of default checked file extensionsThis way, folks can get the standard ESLint flow with an
eslint.config.*
file and no additional configuration.Participation
Additional comments
I think the adding support for
.*ts
extensions only makes sense if TypeScript syntax is supported out-of-the-box too. An alternative could be to strip out the syntax à la amaro / ts-blank-space - but then I think users would be confused about the lack of linting for that syntax.Thus, I think this issue is blocked on #19173 (comment):
Related:
The text was updated successfully, but these errors were encountered: