Justia's base JS ESLint configuration
This package provides Justia's base JavaScript guidelines (without React plugins) as an extensible shared configuration.
Make sure you upgrade to at least Node.js
12.22.0
when using ESLintv8.0.0
. One important thing to double check is the Node.js version supported by your editor when using ESLint via editor integrations. If you are unable to upgrade, we recommend continuing to use ESLint7
until you are able to upgrade Node.js.
Install the correct versions of the peer dependencies, which are listed by the command:
npm info "@justia/eslint-config@latest" peerDependencies
If using npm 5+, use this shortcut
npx install-peerdeps --dev @justia/eslint-config
If using npm < 5, Linux/OSX users can run
(
export PKG=@justia/eslint-config;
npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"
)
Which produces and runs a command like:
npm install --save-dev @justia/eslint-config eslint@^#.#.# prettier@^#.#.# babel-eslint@^#.#.# eslint-config-prettier@^#.#.# eslint-plugin-import@^#.#.# eslint-plugin-prettier@^#.#.# eslint-plugin-promise@^#.#.#
This configuration contains all of our ESLint rules, including ECMAScript 6+ and formatting styles. It requires the following external packages:
eslint
prettier
babel-eslint
eslint-config-prettier
eslint-plugin-import
eslint-plugin-prettier
eslint-plugin-promise
After installation of packages and its peer dependencies, add "extends": ["@justia"]
to your .eslintrc
.