Nobug : Adds eslint and husky for linting goodness #4199
Conversation
.eslintrc.js
Outdated
"browser": true, | ||
"es6": true, | ||
"jquery": true, | ||
"jasmine": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may not need jasmine
here, not sure what MDN uses for JS tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have any JS tests right now. We will probably use jasmine if/when we do to be inline with bedrock but it should be removed for now.
.eslintrc.js
Outdated
"gettext": true, | ||
"interpolate": true, | ||
"mdn": true, | ||
"Mozilla": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, not sure if we need all of these as globals, added them as they came up but, with some of the exclusions I then introduced, perhaps they are not all needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to add waffle
. Nothing jumps out at me from that last as something we can remove if we're not linting the libraries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great locally.
OMG we have so much work to do 😲
+1 without Jasmine and ES6
.eslintrc.js
Outdated
"gettext": true, | ||
"interpolate": true, | ||
"mdn": true, | ||
"Mozilla": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to add waffle
. Nothing jumps out at me from that last as something we can remove if we're not linting the libraries.
.eslintrc.js
Outdated
module.exports = { | ||
"env": { | ||
"browser": true, | ||
"es6": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our browser support requirements don't let us use ES6 yet.
Codecov Report
@@ Coverage Diff @@
## master #4199 +/- ##
==========================================
- Coverage 86.25% 86.25% -0.01%
==========================================
Files 146 147 +1
Lines 9035 9040 +5
Branches 1211 1211
==========================================
+ Hits 7793 7797 +4
Misses 1004 1004
- Partials 238 239 +1
Continue to review full report at Codecov.
|
Hey @stephaniehobson
This adds
eslint
to the project. If you use aneslint
linter plugin for your editor, you should get real time linting feedback. There is also a lint target with:npm run lint
I have marked most things as warnings so, the pre-commit hook introduced here will pass for the moment.