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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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

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

coveralls commented Aug 5, 2023

Coverage Status

coverage: 84.084% (+0.008%) from 84.076%
when pulling 6dd6e31 on remcohaszing:prettier-3
into dfccc6f 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.

- 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.
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.

None yet

3 participants