@leukeleu/prettier-config

3.2.0 • Public • Published

Leukeleu Prettier configuration

Installing this package

If you already had Prettier installed in your project you can delete this first with npm uninstall prettier.

Then install this package as a development dependency npm i -D @leukeleu/prettier-config.

Adding the config

In your .prettierrc.js add:

module.exports = require('@leukeleu/prettier-config')

Add script commands to package.json

To run Prettier on your code, add the following script to your package.json:

"scripts": {
  "prettier": "prettier . --cache",
  "lint:prettier": "npm run prettier -- --check",
  "lintfix:prettier": "npm run prettier -- --write",
}

Adding an ignore file

By default prettier will lint specific filetypes. If you want to ignore files you can create a file named .prettierignore in the root and add ignored file(types) to it.

Running the check

Now you can run the Prettier check using npm run lint:prettier or npm run lintfix:prettier to auto fix.

Extending/ changing config

This is not recommended as the goal is have similar settings in all projects, but if for some reason you need to add or change the config it's possible. The config is in JavaScript, so you can make use of the spread operator to extend the config.

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

Contributing

To learn how to local test and publish this package, please refer to the instructions in the CONTRIBUTORS.md file.

Readme

Keywords

Package Sidebar

Install

npm i @leukeleu/prettier-config

Weekly Downloads

253

Version

3.2.0

License

MIT

Unpacked Size

7.29 kB

Total Files

11

Last publish

Collaborators

  • wadevries
  • dbunskoek
  • leukeleu-bot