@letea/prettier-config
v0.0.8
Published
My prettier config.
Downloads
11
Readme
@letea/prettier-config
My Prettier config.
Usage
Install:
$ yarn add --dev @letea/prettier-config
Edit package.json
:
{
// ...
"prettier": "@letea/prettier-config"
}
Style
arrowParens: "always"
Keep the same style to all functions.
// always
() => { ... };
(x) => { ... };
(x, y) => { ... };
// avoid
() => { ... };
x => { ... };
(x, y) => { ... };
bracketSpacing: true
Add a space for the best reading to developers.
// true
{ foo: bar }
//false
{foo: bar}
jsxBracketSameLine: false
Keep the same position of the bracket for the best reading to developers.
// false
<button
className="prettier-class"
id="prettier-id"
onClick={this.handleClick}
>
Click Here
</button>
// true
<button
className="prettier-class"
id="prettier-id"
onClick={this.handleClick}>
Click Here
</button>
semi: true
Make sure where is the end of the line to developers.
// true
console.log("1");
console.log("2");
console.log("3");
// false
console.log("1")
console.log("2")
console.log("3")
singleQuote: false
Keep the same format with JSON.
// false
let item = "This is double quote";
// true
let item = 'This is single quote';
tabWidth: 2
The best space for reading.
// 2
if (true) {
console.log("This tabWidth is 2.");
}
// 4
if (true) {
console.log("This tabWidth is 4.");
}