stable

Clone or download

Read-only

request #11190 Use eslint as a pre-commit hook

How to test: - When you create a new javascript file and introduce an error, for example using a variable that is not defined, then the pre-commit hook will stop you. - When you create a new javascript file and introduce a warning, for example using a return in a else (see https://eslint.org/docs/rules/no-else-return), then the pre-commit hook won't stop you. You should enable linting on your text editor to catch warnings. This pre-commit hook is there to stop you from committing possible errors. This enforces eslint recommended rules and adds the "You don't need lodash" plugin, to reduce our dependency on lodash when native javascript functions would work the same. Future commits will add more plugins (for example for Vue files). Change-Id: Id1b24ca454de8f1ee13d0e61b818d80f336b04e1

Modified Files

Name
A .eslintignore +33 −0 Go to diff View file
A .eslintrc +107 −0 Go to diff View file
M package-lock.json +940 −0 Go to diff View file
M package.json +3 −0 Go to diff View file
D plugins/pullrequest/www/js/angular/.eslintrc.json +0 −233 Go to diff View file
M plugins/pullrequest/www/js/angular/Gruntfile.js +2 −38 Go to diff View file
M plugins/pullrequest/www/js/angular/package-lock.json +0 −631 Go to diff View file
M plugins/pullrequest/www/js/angular/package.json +0 −3 Go to diff View file
A tools/utils/githooks/pre-commit-04-eslint +79 −0 Go to diff View file