2.0.0 • Published 1 year ago

@telefonica/prettier-config v2.0.0

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
1 year ago

prettier-config

Install

Add prettier and this package to your devDependencies

yarn add --dev prettier @telefonica/prettier-config

or

npm i --save-dev prettier @telefonica/prettier-config

Usage

Add to your package.json:

"prettier": "@telefonica/prettier-config"

Configure pre-commit hook

You may want to configure a pre-commit hook, to enforce code style on commit.

You will need to add two dev dependencies: husky and lint-staged:

yarn add --dev husky lint-staged

or

npm i --save-dev husky lint-staged

Then add the following configuration to your package.json:

"husky": {
    "hooks": {
        "pre-commit": "lint-staged"
    }
},
"lint-staged": {
    "*.{ts,tsx,js,json,md,yml,yaml}": [
        "prettier --write"
    ]
}

Contribute

Please, open an issue if you want to discuss a rule or add a new configuration