redhat-developer / redhat-developer/vscode-yaml

Format doesn’t respect prettier configuration

Open
#159 4 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement formatter
Dominant language
TypeScript
Stars
829
Forks
260
Avg merge
5h 43m
Merged PRs (30d)
1

Description

Prettier supports configuration files. https://prettier.io/docs/en/configuration.html

However, the formatter or this extension ignores use them.

I have the following prettier.config.js:

module.exports = {
  proseWrap: 'always',
  singleQuote: true,
  trailingComma: 'all',
};

and the following .editorconfig:

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 100
trim_trailing_whitespace = true

[COMMIT_EDITMSG]
max_line_length = 72

However, my yaml code was suddenly being formatted using double quotes. I didn’t check any other options, the quotes just stood out.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the YAML formatting case in VS Code using the supplied prettier.config.js and .editorconfig examples, then trace how the extension selects formatter configuration. Done means YAML formatting honors the configured single quotes and other relevant options instead of falling back to double quotes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode, yaml
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.