-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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: upgrade to prettier 3 and prettier-plugin-svelte 3 #10410
Conversation
🦋 Changeset detectedLatest commit: 2954e8b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This needs some additional adjustments which i wrote down here. TLDR config file adjustments, needs Given all this is quite new we may want to wait a few more weeks, maybe Prettier fixes the upstream bug by then. |
Okay. Seems this is blocked by prettier/prettier#15079. There's a PR for it, so hopefully we don't have to wait too long: prettier/prettier#15155 |
8a9052b
to
8e0c7bb
Compare
prettier/prettier#15433 was merged with the fix. It's not been released yet though. It looks like it will be included in prettier 3.1 (prettier/prettier#15462) |
Prettier 3.1 has been released with the fix 🚀 |
@@ -25,7 +25,7 @@ | |||
"adapters.js" | |||
], | |||
"scripts": { | |||
"lint": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw these were removed - could someone clarify why? Or why they were needed before? (probably related to the major version bump?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prettier now ignores files in .gitignore
by default. It will also search up the directory tree for a config file, so you don't need to point at the config file
Finally! A migration guide would be nice for existing projects. # jsconfig.json, tsconfig.json
+ "moduleResolution": "bundler" # package.json
- "lint": "prettier --plugin-search-dir . --check . && eslint .",
- "format": "prettier --plugin-search-dir . --write ."
+ "lint": "prettier --check . && eslint .",
+ "format": "prettier --write ." # package.json
- "prettier": "^2.8.8",
- "prettier-plugin-svelte": "^2.10.1",
+ "prettier": "^3.1.0",
+ "prettier-plugin-svelte": "^3.1.0", # .prettierrc
- "pluginSearchDirs": ["."], |
@@ -3,7 +3,7 @@ | |||
"eslint-config-prettier": "^8.5.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't eslint-config-prettier
be bumped to v9? It does not depend on Prettier v3, but it is the only outdated package as of now. Changelog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. thanks for the suggestion. PR here: #11037
Thanks for the suggestion of the migration guide. I'm not sure where such a migration guide would live though? Maybe your comment serves as a migration guide? |
The comment can work as a guide, but it should be added to the documentation. Similar case: migration to I do wish there was an official guide to bumping packages' major versions. If the user started with
This will allows users to update their dependencies with confidence. |
The place to add that documentation would be the |
Upgrade prettier and plugins. Update scripts. Format files. See sveltejs/kit#10410 (comment).
This will give users the new versions via
create-svelte
. The rest of the change is internalcloses #10751
closes #10716