chore: enabled Prettier in Trunk#19354
Conversation
✅ Deploy Preview for docs-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
13ed57d to
efa7e1a
Compare
03e0e56 to
4dd2dc7
Compare
c77c923 to
1d067f1
Compare
9f0ed89 to
2fd4fc5
Compare
2fd4fc5 to
de09734
Compare
nzakas
left a comment
There was a problem hiding this comment.
Thanks for taking a look at this. Is your recommendation that this be merged first and then #19355?
And we should discuss what we want for Prettier options. We've started a new format in the rewrite repo, so maybe we want to stick with that here?
|
Note there are linting errors. |
Yes. The order isn't extremely important - in theory that one could be merged first, then this one have the OTOH, there's an argument that merging the formatting PR in first is friendlier. It's more likely of a PR to have unexpected delays. Minimizing the time when
👍 That'd be my vote: going with the defaults unless directed otherwise:
Just confirming: are you referring to the Verify job failure from Trunk? https://github.com/eslint/eslint/actions/runs/13081264060/job/36505118543: If so: 👍 this is expected. Trunk is applying formatting concerns as configured in this PR but the files haven't been formatted yet.
|
|
Yes, that's the failure I'm referring to. That's part of why I was asking about the order of merging these PRs, as we don't want to merge something that will cause a CI failure. The Prettier defaults don't work well in all situations. Here's what we have in the new repos: @eslint/eslint-tsc do we want to go with that in this repo too? My vote is 👍 |
|
If we stick with two PRs then I don't think there's a way to avoid CI failures. This PR fails CI because it changes formatting & linting settings without changes code. The other PR fails because it changes code without changing formatting & linting settings. We could avoid a failure by sticking to one PR. We'd have to merge it carefully and not squash the commits. Alternately, we could go with three PRs:
|
No objections to enforcing that files are formatted with Prettier in this repo from my end, and I think that using the same settings as in other repos is a good idea. We'll end up with a mess of merge conflicts in other pull requests but that's a temporary effect. |
|
Ping @mdjermanovic |
|
I agree that we use the same Prettier settings as in other repos. |
|
Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update. |
d7be74c to
de09734
Compare
|
👍 split up. Noted in #19473 (comment):
|
There was a problem hiding this comment.
Sigh artifact from my manual touch-ups in #19355.
| "*.md": "trunk check --fix --filter=markdownlint", | ||
| "*": "trunk check --fix", | ||
| "lib/rules/*.js": [ | ||
| "node tools/update-eslint-all.js", |
There was a problem hiding this comment.
Sorry for coming here so late. Have we checked this #19354 (comment)?
node tools/update-eslint-all.js creates a new file which will be run by trunk check --fix. Which runs first? is it the script or format?
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[x] Other, please explain: internal tooling change
Fixes #17814 (part 1 of 2).
What changes did you make? (Give an overview)
Removes the disabling of
prettierin Trunk and expandslint-stagedso that roughly all files will be formatted with Prettier.The
.markdownlint.yml,docs/.stylelintrc.json, andeslint.config.jsconfig files needed to be changed to exclude formatting rules that conflict with Prettier. This change additionally addsignoreentries totrunk.yamlto exclude:_includesin docsI chose to add"trailingCommas": "none"in the.prettierrc.jsonbecause it seems to be the existing style. The line changes excluding inline config comments in #19355 came out to:"all"(default):206012 insertions(+), 178431 deletions(-)"none":178480 insertions(+), 151397 deletions(-)I personally prefer the default for consistency and to remove a config file, though, and would be very up for changing it if requested. 🙂Per #19354 (comment) & #19354 (comment), uses the same Prettier config as other repos: copied from https://github.com/eslint/json/blob/c4f4abb5c4699e89b76eb478415c4e3b71fa6675/prettier.config.js.
Is there anything you'd like reviewers to focus on?
CI failures are expected. This PR does not include the actual formatting of files with Prettier. That would make for a huge nigh-unreviewable diff. Keeping the formatting application to a separate PR & commit also makes it much easier to
.git-blame-ignore-revsthem away.The intended merge order of PRs to avoid
mainbranch CI failures is:.git-blame-ignore-revs