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

chore: prettier all files with lint-staged #241

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nschonni
Copy link
Contributor

Run for all files in lint-staged, and check on CI through lint

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • New rule
  • Changes an existing rule
  • Add autofixing to a rule
  • Other, please explain:

What changes did you make? (Give an overview)

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@brettz9
Copy link
Member

brettz9 commented Jul 19, 2024

This LGTM... Are we ok to move forward on it, @xjamundx if the conflicts are resolved?

@brettz9 brettz9 added the chore label Jul 19, 2024
@nschonni nschonni force-pushed the prettier-all branch 2 times, most recently from c059ac8 to 048b86d Compare July 19, 2024 16:30
Copy link

codecov bot commented Jul 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (bbcfcbf) to head (6cfa642).
Report is 37 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #241   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        25           
  Lines          649       687   +38     
  Branches       250       260   +10     
=========================================
+ Hits           649       687   +38     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

package.json Outdated Show resolved Hide resolved
Copy link
Member

@voxpelli voxpelli left a comment

Choose a reason for hiding this comment

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

I believe @xjamundx gave the project to the ESLint Community because he didn't want to be the lead for it anymore.

Especially a non-breaking change like this can be merged once we have eg two reviews or one review and opportunity has been clearly given for others to voice their opinions :)

package.json Outdated
"lint": "npm-run-all \"lint:*\"",
"lint:eslint-docs": "npm run update:eslint-docs && git diff --exit-code",
"lint:js": "eslint --report-unused-disable-directives .",
"lint:js": "eslint --report-unused-disable-directives . && prettier --check .",
Copy link
Member

Choose a reason for hiding this comment

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

This will not just check JS, it will check everything when it comes to prettier, right?

I think it should be a 'lint:prettier' script that's checked in parallel with eslint (through npm-run-all)

But also:

In the format step the two are applied sequentially and there's nothing that guarantees that the end result style is still prettier compliant after the ESLint fixes has been made – it's quite classic that the two disagrees.

So I'm not sure there should be a prettier --check at all unless we're 100% sure the two will agree on all the things?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will not just check JS, it will check everything when it comes to prettier, right?

Yes

I think it should be a 'lint:prettier' script that's checked in parallel with eslint (through npm-run-all)

I can split it out. This PR was originally from before the lint:* targets were added, and I kept the changes minimal when I rebased it

In the format step the two are applied sequentially and there's nothing that guarantees that the end result style is still prettier compliant after the ESLint fixes has been made – it's quite classic that the two disagrees.

ESLint has been deprecating those style rules since 8.53. Looking at this project, it is using the plugin/config for Prettier, that could be removed and split out to the lint target if you'd prefer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I pushed a separate commit that strips out the eslint-*-prettier parts and just uses the plain Prettier calls. I left it as a separate commit to make it easier to roll off, if that's not what you were thinking

@brettz9
Copy link
Member

brettz9 commented Jul 21, 2024

Especially a non-breaking change like this can be merged once we have eg two reviews or one review and opportunity has been clearly given for others to voice their opinions :)

Maybe you could also put the mention of 2 reviews in the governance doc if that's the approach?

@voxpelli
Copy link
Member

Especially a non-breaking change like this can be merged once we have eg two reviews or one review and opportunity has been clearly given for others to voice their opinions :)

Maybe you could also put the mention of 2 reviews in the governance doc if that's the approach?

Its a good idea, but I'm not sure we have enough consencus to get that in yet, its more of a general rule of thumb I would say

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.

5 participants