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

fix(linter): check for all .eslintrc.* files when generating a package #12515

Merged
merged 2 commits into from Oct 12, 2022

Conversation

SimonM0
Copy link
Contributor

@SimonM0 SimonM0 commented Oct 11, 2022

Current Behavior

  • When generating new applications or packages, a .eslintrc.json file is still generated if we are using other eslint config file formats, for example .eslintrc.

Expected Behavior

  • If a .eslintrc.* file that matches any of the possible .eslintrc.* formats listed here, in the root of the monorepo. We should not generate a new .eslintrc.json file.

Related Issue(s)

Enhances #10080

@vercel
Copy link

vercel bot commented Oct 11, 2022

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

1 Ignored Deployment
Name Status Preview Updated
nx-dev ⬜️ Ignored (Inspect) Oct 11, 2022 at 10:44PM (UTC)

@FrozenPandaz
Copy link
Collaborator

Thank you for adding support for these files! We also have a migration which will add these global files as an input into the lint target:

https://github.com/nrwl/nx/blob/master/packages/linter/src/migrations/update-15-0-0/add-eslint-inputs.ts#L17

Could you take a look at adding support for these files there as well?

@SimonM0
Copy link
Contributor Author

SimonM0 commented Oct 11, 2022

Hey @FrozenPandaz

I've added the new eslint files to the migrations now. I hope it's correct, I noticed the snapshot before showed "!{projectRoot}/.eslintrc.json"in thenamedInputs.productionarray for the.eslintrc.js` test. Was this intentional?

],
"production": Array [
"default",
"!{projectRoot}/.eslintrc.json",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@FrozenPandaz This is the snapshot in question.

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably a typo. Interestingly how that worked.

Copy link
Contributor

@meeroslav meeroslav left a comment

Choose a reason for hiding this comment

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

Left one minor comment.

Everything else looks good to me! Thank you

@meeroslav meeroslav added type: bug scope: linter Issues related to Eslint support in Nx labels Oct 11, 2022
@meeroslav meeroslav changed the title fix(linter): added all .eslintrc.* possibilities and updated tests fix(linter): check for all .eslintrc.* files when generating a package Oct 11, 2022
@meeroslav meeroslav merged commit d4fd7c0 into nrwl:master Oct 12, 2022
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope: linter Issues related to Eslint support in Nx type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants