Skip to content

Note that .editorconfig settings include quote_type.#12780

Closed
midgleyc wants to merge 1 commit intoprettier:mainfrom
midgleyc:editorconfig-single-quote
Closed

Note that .editorconfig settings include quote_type.#12780
midgleyc wants to merge 1 commit intoprettier:mainfrom
midgleyc:editorconfig-single-quote

Conversation

@midgleyc
Copy link
Copy Markdown
Contributor

@midgleyc midgleyc commented May 3, 2022

Description

Note that .editorconfig settings include quote_type.

They can include all values mapped in editorconfig-to-prettier. I've been using quote_type locally for a while and was surprised to see it not in the docs.

Checklist

  • I’ve changed only documentation (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@fisker
Copy link
Copy Markdown
Member

fisker commented May 3, 2022

I didn't know this. Not sure if we should support this non-standard property.

@midgleyc
Copy link
Copy Markdown
Contributor Author

midgleyc commented May 3, 2022

If you don't support it, I don't believe there's a way to do what I currently do: single quotes for TypeScript (as Angular recommends), double quotes for HTML / CSS.

EditorConfig is a nice way to do file extension-specific configuration.

@midgleyc
Copy link
Copy Markdown
Contributor Author

midgleyc commented May 3, 2022

By the git history, quote_type is one of the proposed domain-specific properties, under the editorconfig project: https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties/98f8059ac82af0bea2d5af5f64f0dcc79c015ab1#ideas-for-domain-specific-properties

@fisker
Copy link
Copy Markdown
Member

fisker commented May 6, 2022

I don't believe there's a way to do what I currently do: single quotes for TypeScript (as Angular recommends), double quotes for HTML / CSS.

{
	singleQuote: true,
	overrides: {
		files: ['**/*.html', '**/*.css'],
		options: {
			singleQuote: false,
		}
	}
}

archlinux-github pushed a commit to archlinux/neoasknot that referenced this pull request Mar 14, 2023
polyzen added a commit to polyzen/landing that referenced this pull request Mar 8, 2025
Prettier picks up quote style from .editorconfig:
prettier/prettier#12780
@fisker
Copy link
Copy Markdown
Member

fisker commented May 22, 2025

Sorry, we are not going to read non-standard keys.

@fisker fisker closed this May 22, 2025
@polyzen
Copy link
Copy Markdown

polyzen commented May 24, 2025

Support for this already exists, no? This is just accompanying documentation.

@fisker
Copy link
Copy Markdown
Member

fisker commented May 24, 2025

Ah, you are right, it's supported, since people may already use it, I guess we'll just keep it as undocumented feature.

Original commit
Releated code

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.

3 participants