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

[prettier-config] Add new rule to override jsxSingleQuote default behaviour #7

Merged
merged 3 commits into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/curly-jeans-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@inigomarquinez/prettier-config': major
---

Set jsxSingleQuote option to true, overriding the default false value.
19 changes: 19 additions & 0 deletions packages/prettier-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- [Installation](#📦-installation)
- [Documentation](#📚-documentation)
- [Custom configuration](#📚-custom-configuration)
- [Contributing](#🧩-contributing)
- [Changelog](#📝-changelog)
- [License](#©️-license)
Expand Down Expand Up @@ -47,6 +48,18 @@ After installing it, a `.prettierrc` file will be created automatically in the p
Read the [Prettier docs][prettier-docs-link] for more information. [Here][prettier-sharing-configurations-link] you can find specific information about sharing configurations.
## 📏 Custom options
The library customises the following options. All other options take their default value as defined [here][prettier-options-link].
| Option | Custom value |
| ------ | ------------ |
| [arrowParens][prettier-option-arrow-parens-link] | `'avoid'` |
| [experimentalTernaries][prettier-option-experimental-ternaries-link] | `true` |
| [jsxSingleQuote][prettier-option-jsx-single-quote-link] | `true` |
| [singleAttributePerLine][prettier-option-single-attribute-per-line-link] | `true` |
| [singleQuote][prettier-option-single-quote-link] | `true` |
## 🧩 Contributing
If you are interested in helping contribute, please open an [issue][issue-link] or [pull request][pull-request-link].
Expand All @@ -68,6 +81,12 @@ Distributed under the MIT License. See [LICENSE][license-link] for more informat
[npm-link]: https://www.npmjs.com/package/@inigomarquinez/prettier-config
[prettier-docs-link]: https://prettier.io
[prettier-link]: https://github.com/prettier/prettier
[prettier-option-arrow-parens-link]: https://prettier.io/docs/en/options.html#arrow-function-parentheses
[prettier-option-experimental-ternaries-link]: https://prettier.io/docs/en/options.html#experimental-ternaries
[prettier-option-jsx-single-quote-link]: https://prettier.io/docs/en/options.html#jsx-quotes
[prettier-option-single-attribute-per-line-link]: https://prettier.io/docs/en/options.html#single-attribute-per-line
[prettier-option-single-quote-link]: https://prettier.io/docs/en/options.html#quotes
[prettier-options-link]: https://prettier.io/docs/en/options.html
[prettier-sharing-configurations-link]: https://prettier.io/docs/en/configuration#sharing-configurations
[pull-request-link]: https://github.com/inigomarquinez/base-configs/pulls
Expand Down
1 change: 1 addition & 0 deletions packages/prettier-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
module.exports = {
arrowParens: 'avoid',
experimentalTernaries: true,
jsxSingleQuote: true,
singleAttributePerLine: true,
singleQuote: true,
}
Loading