@interaktiv/prettier-config-dia

2.1.1 • Public • Published

prettier-config-dia

Prettier shareable configuration for projects at DIA

Commitizen friendly Conventional Commits Code of Conduct Semantic Release MIT License

npm latest version npm next version

Table of Contents

Installation

npm install --save-dev @interaktiv/prettier-config-dia

Usage

.prettierrc.js

module.exports = require('@interaktiv/prettier-config-dia');

.prettierignore

Do something like this:

cat ./node_modules/@interaktiv/prettier-config-dia/.prettierignore >> .prettierignore

or use the prettier-cli:

prettier --ignore "./node_modules/@interaktiv/prettier-config-dia/.prettierignore" --write .

package.json

e.g.

...
"scripts": {
  "format": "prettier --write \"src/**/*.+(js|ts|vue|json)\""
}
...

Optional Configurations

  • aura - Lightning Aura Components, extends but also replaces options in a more es5 based fashion for files in **/aura/** dirs.

  • lwc - Lightning Web Components, literally just extends the default config and sets the parser for html files in **/lwc/** dirs to lwc.

    If you are in a Lightning Web Components project just set your prettier config to @interaktiv/prettier-config-dia/lwc.

  • salesforce - A merge of the lwc and aura configs to support Code Formatting for Development on the Salesforce Platform.

Used Plugins

If you wanna opt-out of these plugin see the Prettier Docs.

Recommendations

We recommend to use Prettier together with husky and lint-staged as a pre-commit git hook.

Pre-Commit Hook Installation

npm install --save-dev husky lint-staged

Pre-Commit Hook Usage

package.json

e.g.

...
"husky": {
  "hooks": {
    "pre-commit": "lint-staged"
  }
},
"lint-staged": {
  "**/*.+(js|ts|vue|json|css|sass|less|graphql|yml|yaml|scss|md)": [
    "prettier --write",
    "git add",
  ]
}
...

License

MIT Copyright © 2019-present die.interaktiven GmbH & Co. KG

Package Sidebar

Install

npm i @interaktiv/prettier-config-dia

Weekly Downloads

0

Version

2.1.1

License

MIT

Unpacked Size

13.9 kB

Total Files

17

Last publish

Collaborators

  • dia-bot
  • kbshl