Skip to content

feat: add TypeScript config file support #181

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

Merged
merged 2 commits into from
Jul 9, 2025

Conversation

xbinaryx
Copy link
Contributor

Prerequisites checklist

What is the purpose of this pull request?

This PR adds support for generating TypeScript configuration files in the config generator.

What changes did you make? (Give an overview)

  • Added a prompt for users to select the language of their configuration file (JavaScript or TypeScript) if TypeScript is enabled.
  • Implemented logic to generate eslint.config.ts (or eslint.config.mts for CommonJS) when TypeScript is selected.
  • Added a conditional prompt for users to add Jiti as a devDependency if they choose a TypeScript config file and are running Node.js <24.3.0, since Jiti is required to load TypeScript config files in those environments.
  • Added snapshot tests

Related Issues

Fixes #177

Copy link

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, thanks! I left a couple of suggestions that I think should land, but I'm not deeply familiar with this project and want to defer to a second team member's opinion.

Copy link
Member

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Waiting a few days for other reviewers before merging.

@aladdin-add
Copy link
Member

for reviewers:

@eslint/create-config: v1.9.0

√ What do you want to lint? · javascript
√ How would you like to use ESLint? · problems
√ What type of modules does your project use? · esm
√ Which framework does your project use? · none
√ Does your project use TypeScript? · No / Yes
√ Where does your code run? · browser
√ Which language do you want your configuration file be written in? · ts
Jiti is required for Node.js <24.3.0 to read TypeScript configuration files.
√ Would you like to add Jiti as a devDependency? · No / Yes
The config that you've selected requires the following dependencies:

eslint, @eslint/js, globals, typescript-eslint, jiti
√ Would you like to install them now? · No / Yes
√ Which package manager do you want to use? · npm

@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Jul 4, 2025
@aladdin-add aladdin-add moved this from Needs Triage to Second Review Needed in Triage Jul 4, 2025
@aladdin-add aladdin-add merged commit 04935f1 into eslint:main Jul 9, 2025
11 checks passed
@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Jul 9, 2025
@github-actions github-actions bot mentioned this pull request Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

Add support for generating TypeScript configuration files
3 participants