0.0.8 • Published 1 year ago

@letea/prettier-config v0.0.8

Weekly downloads
12
License
ISC
Repository
github
Last release
1 year ago

@letea/prettier-config

npm version

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.");
}

Reference

0.0.8

1 year ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago