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): Generator creating .eslintrc.json at the root path even when .eslintrc.js already exist #10080

Merged
merged 3 commits into from May 11, 2022

Conversation

AloisH
Copy link
Contributor

@AloisH AloisH commented Apr 30, 2022

Don't create an .eslintrc.json at the root path when .eslintrc.js already exist

ISSUE CLOSED: #7791

Current Behavior

When creating a lib/app and having a .eslintrc.js at the root path, nx still create a .eslintrc.json.

Expected Behavior

Don't create a .eslintrc.json and extend from .eslintrc.js instead of .eslintrc.json

Related Issue(s)

Fixes #7791

…ating file

Underscore is a character usually used for sorting purposes and is absolutely legit. There is no
reason to replace it.

ISSUES CLOSED: nrwl#8875
@nx-cloud
Copy link

nx-cloud bot commented Apr 30, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit ea68ca5. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 22 targets

Sent with 💌 from NxCloud.

@vercel
Copy link

vercel bot commented Apr 30, 2022

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

1 Ignored Deployment
Name Status Preview Updated
nx-dev ⬜️ Ignored (Inspect) Apr 30, 2022 at 3:35PM (UTC)

@AloisH
Copy link
Contributor Author

AloisH commented Apr 30, 2022

Hello ! I don't unterstand why main-linux failed, could you help me with it ?

Copy link
Collaborator

@FrozenPandaz FrozenPandaz left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! LGTM 🎉

Warning, eslintrc.js files likely won't be migrated if we make any changes to the config. But in eslint case, I don't think it will be often.

@FrozenPandaz FrozenPandaz merged commit e5bde2f into nrwl:master May 11, 2022
}
}
// Default file
return 'eslintrc.json';
Copy link
Collaborator

Choose a reason for hiding this comment

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

@AloisH @FrozenPandaz I know this has already been merged, but why wasn't this .eslintrc.json?

It has changed the behaviour inside of packages/linter/src/generators/lint-project/lint-project.ts above

eslintrc.json without a leading dot is not ever referenced by https://eslint.org/docs/user-guide/configuring/configuration-files.

This seems to be intentional because you have multiple unit tests asserting this, but I haven't understood why we would want to make this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello @JamesHenry ! I think I made a mistake ! Thank you for noticing it !
I got one test trying it but I think I just forgot to put a dot.

Should we revert this PR so I can make a new commit fixing it ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Unless @FrozenPandaz disagrees I think a fast follow on PR would be ok, if will you have chance to do that today?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No worries, I'll follow up with a fix. 👍

@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 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generator creating .eslintrc.json at the root path even when .eslintrc.js already exist
3 participants