Skip to content

Commit

Permalink
Merge pull request #7 from inigomarquinez/improve-prettier-config-docs
Browse files Browse the repository at this point in the history
[prettier-config] Add new rule to override jsxSingleQuote default behaviour
  • Loading branch information
inigomarquinez authored Feb 25, 2024
2 parents 744c574 + ea5eaab commit f203de9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
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,
}

0 comments on commit f203de9

Please sign in to comment.