Human Made coding standards for JavaScript.
This package is an ESLint shareable configuration, and requires: babel-eslint
, eslint
, eslint-config-react-app
, eslint-plugin-flowtype
, eslint-plugin-import
, eslint-plugin-jsx-a11y
, eslint-plugin-jsdoc
, eslint-plugin-react
, eslint-plugin-react-hooks
, eslint-plugin-sort-destructure-keys
.
To install this config and the peerDependencies when using npm 5+:
npx install-peerdeps --dev @humanmade/eslint-config@latest
(Thanks to Airbnb's package for the command.)
You can then use it directly on the command line:
./node_modules/.bin/eslint -c @humanmade/eslint-config MyFile.js
Alternatively, you can create your own configuration and extend these rules:
extends:
- @humanmade/eslint-config
If you desire to use TypeScript for your project, you will need to add another dependency:
npm install --save-dev @typescript-eslint/parser
Once it's installed, update your configuration with the parser
parameter:
parser: "@typescript-eslint/parser"
extends:
- @humanmade/eslint-config
When installing globally, you need to ensure the peer dependencies are also installed globally.
Run the same command as above, but instead with --global
:
npx install-peerdeps --global @humanmade/eslint-config@latest
This allows you to use eslint -c humanmade MyFile.js
anywhere on your filesystem.
We require the use of Node v16+ and npm v7+, however the Altis build container ships with Node 12.18 and npm 6.14 so it will not work out of the box.
As per the Altis documentation, you can install other versions of Node using nvm, so we recommend that you add the following to your build script.
nvm install 16
nvm use 16