1.0.8 • Published 5 years ago
trailing-whitespaces v1.0.8
trailing-whitespaces
removes trailing whitespaces from your files
Instalition:
npm install trailing-whitespacesRun from command line:
Install globally:
npm install trailing-whitespaces -gThen run with filenames or globs as arguments:
trailing-whitespaces ./src/**/.jsRemove trailing whitespaces on pre-commit:
Insall husky to set up pre-commit hooks
Then lint-staged. We should run linters only on staged files, right?
npm install trailing-whitespaces husky lint-staged -sAnd then add to you package.json root object:
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.js": [
      "trailing-whitespaces"
    ]
  }