De-noisify git diffs.
Reading through git diffs should be a straightforward experience. Unfortunately, meaningless differences in trailing whitespace and end-of-file newlines clutters up diffs.
diff-cleaner removes this noise.
npm run trim
npm run trimcommand which fixes the errors found in the pre-commit hook
npm install --save-dev diff-cleaner
npm install --save-dev husky
"precommit": "gulp precommit","trim": "gulp trim"
config.js for full options. A selection are shown below.
To change e.g. the included filetypes to just html and css, add the following to your
configfiletypes = '(html|css)';
filetypes. The file extensions that will be linted and updated. Must be in the form e.g.
'(js|py|txt)'. Defaults to
logErrors. When truthy, log the full issue report on precommit linting errors.
specificGitignore. Use a
.gitignoreother than in the root directory.
customGlobs. Any custom globs to consider during precommit and trim.
To override the pre-commit hook, use
git commit --no-verify.
See dealing with line endings for how to standardize line endings using a
"files.trimTrailingWhitespace": true to your user settings document to strip trailing whitespace automatically.