@einride/prettier-config
v2.1.0
Published
Einride's default Prettier config
Downloads
3,024
Readme
@einride/prettier-config
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