1.0.0 • Published 8 months ago

@dootrix/prettier-config v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

@dootrix/prettier-config

Sharable config for Prettier

Installation

Install the package

npm install -D @dootrix/prettier-config

Then add the following line to your package.json file.

{
  "prettier": "@dootrix/prettier-config"
}

Extending

If you wish to customise options further, remove the pettier config from package.json and create a prettier file (/.prettierrc.js) with the following.

module.exports = {
  ...require('@dootrix/prettier-config'),
  tabs: true,
  tabWidth: 4,
};

VSCode User?

Make sure you have Prettier extention installed and add the following into the project's settings file (/.vscode/settings.json) (adding/deleting as appropriate).

{
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[scss]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "typescript.format.enable": false,
  "editor.formatOnSave": true
}