/prettier-config-udes

Prettier shareable config for the UdeS style guide

Primary LanguageJavaScriptMIT LicenseMIT

prettier-config-udes

npm Known Vulnerabilities

Prettier shareable config for the UdeS style guide. It can be used to format automatically these files:

  • css
  • html
  • js
  • json
  • md
  • php
  • scss
  • yaml

Installation

npm install prettier prettier-config-udes --save-dev

Usage

Edit package.json:

{
  "prettier": "prettier-config-udes",
  "scripts": {
    "format:prettier": "npm run lint:prettier -- --write",
    "lint:prettier": "prettier --ignore-path .gitignore --check '**/*.{css,html,js,json,md,scss,yaml,yml}'"
  }
}

If you don't have all these extensions files, you should adjust the extension list for you project. Else, Prettier will output an error:

[error] No files matching the pattern were found: "**/*.css".

PHP

If you want to be able to format PHP files, you must extend our PHP Prettier configuration by editing your package.json:

{
  "prettier": "prettier-config-udes/php",
  "scripts": {
    "format:prettier": "prettier --ignore-path .gitignore --write '**/*.{css,html,js,json,md,php,scss,yaml,yml}'",
    "lint:prettier": "prettier --ignore-path .gitignore --check '**/*.{css,html,js,json,md,php,scss,yaml,yml}'"
  }
}

Publish

Increment the version defined in the package.json file and run the command below to publish the module in the registry:

# Dry run
npm publish --dry-run

# For real (are you really sure?)
npm publish

License

The MIT License (MIT)