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

Update to Prettier 3 #909

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

remcohaszing
Copy link
Contributor

What does this PR do?

This updates Prettier to version 3.

  • Prettier 3 is async, so related functions were made async.
  • Code was reformatted using Prettier.
  • Prettier now ships their own types, so @types/prettier was removed.
  • Prettier was moved to dependencies. optionalDependencies is for dependencies that have a install script that may fail. This isn’t the case for Prettier.
  • eslint-plugin-prettier was updated as well.

Alternatively the formatting functionality could be removed. IMO people should just use Prettier themselves for formatting YAML instead of relying on this yaml-language-server.

What issues does this PR fix or reference?

N/A

Is it tested? How?

npm test

@@ -24,7 +24,7 @@
describe('Formatter', function () {
describe('Test that formatter works with custom tags', function () {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function parseSetup(content: string, options: any = {}): TextEdit[] {
function parseSetup(content: string, options: any = {}): Promise<TextEdit[]> {

Check warning

Code scanning / ESLint

Disallow the `any` type Warning test

Unexpected any. Specify a different type.
@coveralls
Copy link

coveralls commented Aug 5, 2023

Coverage Status

coverage: 84.254% (+0.007%) from 84.247%
when pulling 0db58e2 on remcohaszing:prettier-3
into 379bdfa on redhat-developer:main.

@artola
Copy link

artola commented Nov 9, 2023

@msivasubramaniaan This would be a nice enhancement to support Prettier v3, otherwise we are forced deliver 2 versions of Prettier within our app.

Copy link
Contributor

@msivasubramaniaan msivasubramaniaan left a comment

Choose a reason for hiding this comment

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

Seeing lots of lint changes. Kindly rebase and raise PR only with affected files

@remcohaszing
Copy link
Contributor Author

Done, but now CI fails. It’s hard to tell intent, because both ESLint are Prettier are not configured correctly for this repo.

- Prettier 3 is async, so related functions were made async.
- Code was reformatted using Prettier.
- Prettier now ships their own types, so `@types/prettier` was removed.
- Prettier was moved to `dependencies`. `optionalDependencies` is for
  dependencies that have a `install` script that may fail. This isn’t
  the case for Prettier.
- `eslint-config-prettier` was updated as well.
- `eslint-plugin-prettier` was updated as well.
Copy link
Contributor

@msivasubramaniaan msivasubramaniaan left a comment

Choose a reason for hiding this comment

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

LGTM

@msivasubramaniaan msivasubramaniaan merged commit d0a7299 into redhat-developer:main Dec 19, 2024
4 checks passed
@remcohaszing remcohaszing deleted the prettier-3 branch December 19, 2024 09:01
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.

4 participants