weiran-zsd / dts-cli

Zero-config CLI for TypeScript package development
MIT License
440 stars 23 forks source link

Add support for new ESLint eslint.config.js files #220

Open SirSKillz opened 1 month ago

SirSKillz commented 1 month ago

Current Behavior

As seen here, only .eslintrc.js files are supported for merging. With ESLint 9.0, eslint.config.js has become the default, so it should be supported in DTS.

Desired Behavior

Allow a user to at least use eslint.config.js, or ideally any of the eslint config file options.

Suggested Solution

Inside of createEslintConfig.ts Define a list of supported ESLint config files. Check if any of these files exist in the project root. If a file exists, use it; otherwise, default to eslint.config.js (or eslintrc.js for older versions of ESLint) Update the config file path and write the configuration.

This likely also requires some checks for the version of ESLint in use if specific files versions are allowed