2.1.0 • Published 10 months ago

@einride/prettier-config v2.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@einride/prettier-config

license npm version total npm downloads

Einride's default Prettier config

Installation

Install @einride/prettier-config as a dev dependency:

yarn add @einride/prettier-config --dev

Make sure Prettier is also installed in your project.

Usage

Add @einride/prettier-config to your .prettierrc.js file:

module.exports = {
  ...require("@einride/prettier-config"),
}

Specific settings can be overridden by adding them after @einride/prettier-config:

module.exports = {
  ...require("@einride/prettier-config"),
  semi: true,
}

Add a formatting scripts to the scripts section of your package.json:

{
  "scripts": {
    "format": "prettier --write .",
    "format-check": "prettier --check ."
  }
}

Running yarn format will format all your files according to the config specified in .prettierrc.js.

Running yarn format-check will return exit code 1 when there are formatting issues, which makes it a good fit for CI.

Add a .prettierignore file to ignore files from being formatted:

src/gen # ignores files in src/gen directory from being formatted

node_modules is ignored by default.

Contribute

See Contributing Guide.

License

MIT

2.1.0-beta.1

10 months ago

2.1.0

10 months ago

2.0.1

1 year ago

2.0.0

2 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago