trailing-whitespaces

1.0.8 • Public • Published

trailing-whitespaces

removes trailing whitespaces from your files

Instalition:

npm install trailing-whitespaces

Run from command line:

Install globally:

npm install trailing-whitespaces -g

Then run with filenames or globs as arguments:

trailing-whitespaces ./src/**/.js

Remove 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 -s

And then add to you package.json root object:

  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.js": [
      "trailing-whitespaces"
    ]
  }

Package Sidebar

Install

npm i trailing-whitespaces

Weekly Downloads

81

Version

1.0.8

License

MIT

Unpacked Size

12.8 kB

Total Files

7

Last publish

Collaborators

  • o175