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

feat(linter): update allowed ESLint config file extensions #30127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TorinFrancis
Copy link

@TorinFrancis TorinFrancis commented Feb 20, 2025

ESLint added experimental support for typescript config files since 9.9.0, and as of 9.18.0 that support is stable. This PR add ts/mts/cts to the list of known eslint config files, and adds the same extensions to config file generators

Current Behavior

When using the eslint executor with a ts file, returns error "When using the new Flat Config with ESLint, all configs must be named eslint.config.js or eslint.config.cjs and .eslintrc files may not be used. See https://eslint.org/docs/latest/use/configure/configuration-files"

When using the eslint plugin, the inferred task is not created for projects that do not have a non-ts eslint config.

Workarounds

  • Compiling ts rules/configs in a project. Introduces other issues
  • Using jiti or comparable
  • For plugin users, having a fake eslint.config.js at the root allows the inferred task to be created. ESLint will still use the ts config.
    • Cache targets are wrong
    • Complications in non-monorepo workspaces

Expected Behavior

When using the eslint executor with a ts file, no error is thrown.

When using the eslint plugin with a ts file, the inferred task is created.

Related Issue(s)

No issues, but addresses this discussion

@TorinFrancis TorinFrancis requested a review from a team as a code owner February 20, 2025 19:49
Copy link

vercel bot commented Feb 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Feb 25, 2025 7:06pm

@TorinFrancis TorinFrancis force-pushed the eslint/typescript-config-support branch 3 times, most recently from 6285a20 to 2e4b2a2 Compare February 21, 2025 16:39
@TorinFrancis TorinFrancis force-pushed the eslint/typescript-config-support branch from 2e4b2a2 to 0e5be8c Compare February 25, 2025 19:03
@TorinFrancis
Copy link
Author

Hey @leosvelperez is there anything I can do to help get this through? This is my first Nx PR so I'm sure I've missed some things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant