🚨 This package has been deprecated in favor of https://github.com/hudl/hudl-frontends/tree/main/config/config-eslint. Do not make any more changes to this package! 🚨
This package provides Hudl's .eslintrc as an extensible shared config.
Note: This is forked from Airbnb's eslint-config-airbnb
package. To see how Hudl's config compares to
the Airbnb config, take a look at the comparison docs.
We export three ESLint configurations for your usage.
See Hudl's Javascript styleguide and the ESlint config docs for more information on using ESLint config plugins.
Our default export contains all of our ESLint rules, including EcmaScript 6+
and React. It requires eslint
and eslint-plugin-react
.
npm install --save-dev eslint-config-hudl eslint-plugin-react babel-eslint eslint --registry=http://npm.thorhudl.com
- Add
"extends": "hudl"
to your .eslintrc
NOTE: If you're implementing in a multiverse cluster using the hudl-webpack
package you should run the simpler install command npm install --save eslint-config-hudl --registry="http://npm.thorhudl.com
Lints ES6+ but does not lint React. Requires eslint
.
npm install --save-dev eslint-config-hudl eslint --registry=http://npm.thorhudl.com
- Add
"extends": "hudl/base"
to your .eslintrc
Lints ES5 and below. Only requires eslint
.
npm install --save-dev eslint-config-hudl eslint --registry=http://npm.thorhudl.com
- Add
"extends": "hudl/legacy"
to your .eslintrc
Code running on Node < 4.0 (and not transpiled from ES6 syntax) can be linted effectively using the following as a base
for the project's .eslintrc
file:
{
"root": true,
"extends": "hudl/legacy",
"ecmaFeatures": {
"//": "Recognize `const` keyword. Note that this also enables `let`, even though it's not available",
"blockBindings": true
}
}
See an example of a similar configuration.
Consider adding test cases if you're making complicated rules changes, like anything involving regexes. Perhaps in a distant future, we could use literate programming to structure our README as test cases for our .eslintrc?
You can run tests with npm test
.
You can make sure this module lints with itself using npm run lint
.