Provides hughx’s JavaScript conventions as .eslintrc
shared configs.
Emphasizes readability and ease of writing.
ℹ️ For TypeScript support, use eslint-config-hughx-ts
instead.
npm install -D eslint-config-hughx
You will have to install peerDependencies
manually:
# npm install -D
yarn add -D \
eslint \
eslint-config-airbnb-base \
eslint-config-hughx \
eslint-plugin-import
# npm install -D
yarn add -D \
eslint \
eslint-config-airbnb-base \
eslint-config-hughx \
eslint-plugin-import \
eslint-plugin-jsx-a11y \
eslint-plugin-react \
eslint-plugin-react-hooks
Extend hughx
in your project’s .eslintrc.js
or equivalent:
module.exports = {
"extends": [
"hughx",
],
// …
}
Eslint-config-hughx defaults to the latest version of JavaScript/ECMAScript at the time of release. If your transpiler isn’t set up for this (or you don’t use one), then you should override both env.es*
and parserOptions.ecmaVersion
, e.g.
// Downgrading from ES2021 to ES6
module.exports = {
"extends": [
"hughx",
],
"env": {
"es2021": false,
"es6": true
},
"parserOptions": {
"ecmaVersion": 6
}
};
You can extend from one of the following to bring in sensible defaults for different use cases:
hughx/react
hughx/node
hughx/web-components