@letea/prettier-config

0.0.8 • Public • Published

@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

Readme

Keywords

Package Sidebar

Install

npm i @letea/prettier-config

Weekly Downloads

3

Version

0.0.8

License

ISC

Unpacked Size

2.57 kB

Total Files

3

Last publish

Collaborators

  • letea