@einride/prettier-config

2.1.0 • Public • Published

@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

Package Sidebar

Install

npm i @einride/prettier-config

Weekly Downloads

620

Version

2.1.0

License

MIT

Unpacked Size

4.7 kB

Total Files

4

Last publish

Collaborators

  • odsod-einride
  • tammergard