Skip to content

"quote_type" didn't added to editorconfig file. #303

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

Open
3 tasks done
pixieaka opened this issue Apr 2, 2021 · 4 comments
Open
3 tasks done

"quote_type" didn't added to editorconfig file. #303

pixieaka opened this issue Apr 2, 2021 · 4 comments

Comments

@pixieaka
Copy link

pixieaka commented Apr 2, 2021

Please fill-in this template.

  • I have a question that is specific to this extension; thus, inappropriate for the main EditorConfig issue tracker.
  • I tried running code --disable-extensions and the issue did NOT present itself.

Delete the following condition if it doesn't apply to your case:

If the extension is not picking up the expected configuration for a file:

  • I tried npm install editorconfig -g and ran editorconfig [file-in-question] and the configuration was what I expected. If not, please file on the editorconfig-core-js issue tracker.

Issue

Visual Studio Code editorconfig-vscode
Version 1.55.0 0.16.4

Root .editorconfig File

root = true

[*]
indent_style = space
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

Are there any other relevant .editorconfig files in your project? No

Visual Studio Code Setting Default User Workspace
javascript.preferences.quoteStyle auto single
typescript.preferences.quoteStyle auto single
prettier.singleQuote false true
prettier.jsxSingleQuote "false" "true"

File opened

./test.js

Expected behavior

indent_style = space
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
quote_type = single <<<<<<<<<<<<<<<<<<<<<<<<<<<<< This should be added

Actual behavior

indent_style = space
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

Additional comments or steps to reproduce

.

@SunsetTechuila
Copy link
Member

SunsetTechuila commented Feb 27, 2025

The quote_type property is not included in the specification. I believe that official EditorConfig plugins shouldn't interact in any way with such properties.

There is no general quote style option in VSCode. Therefore, if the requested functionality is implemented, the extension should account for different languages. For example, if javascript.preferences.quoteStyle is set to "single" editorconfig should be changed to:

# there should be a key-value collection of settings groups and related file extension
# like { "javascript.preferences": ["js", "mjs"] }
[*.{js,mjs}]
quote_type = single

All options are provided by extensions (either built-in or external) and must be manually checked. All of this will become a mess in the blink of an eye. Respecting formatter-specific preferences isn't realistically possible, as there are many formatters, each supporting different languages and having different settings that affect how and to which files options are applied.

@xuhdev request your opinion

@SunsetTechuila
Copy link
Member

@xuhdev you responded to two mentions yesterday, so tagging you again

@xuhdev
Copy link
Member

xuhdev commented Mar 16, 2025

@SunsetTechuila Sorry I missed your message earlier.

The quote_type property is not included in the specification. I believe that official EditorConfig plugins shouldn't interact in any way with such properties.

Editor plugins can support custom properties, and I don't believe we have a strict definition of "official" plugins here -- so far most editor plugin developers enjoy a high degree of freedom. However, we don't have a uniform opinion on the naming of such custom properties yet, see editorconfig/editorconfig#332 . However, likely we should add some unique prefix at the very least, such as vscode_quote_type.

There is no general quote style option in VSCode. Therefore, if the requested functionality is implemented, the extension should account for different languages. For example, if javascript.preferences.quoteStyle is set to "single" editorconfig should be changed to:

# there should be a key-value collection of settings groups and related file extension
# like { "javascript.preferences": ["js", "mjs"] }
[*.{js,mjs}]
quote_type = single

All options are provided by extensions (either built-in or external) and must be manually checked. All of this will become a mess in the blink of an eye. Respecting formatter-specific preferences isn't realistically possible, as there are many formatters, each supporting different languages and having different settings that affect how and to which files options are applied.

I don't understand VSCode that much and will always leave VSCode specific decisions to you 😉

@thw0rted
Copy link

The quote_type property is not included in the specification. I believe that official EditorConfig plugins shouldn't interact in any way with such properties.

Not included in the spec but see editorconfig/editorconfig#410 which points to https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#ideas-for-domain-specific-properties where quote_type is the first nonstandard property on the list. It might also be worth considering what other tooling looks at this value -- several commenters have brought up support in prettier, for example.

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

No branches or pull requests

5 participants