eslint-config-inrupt-react
Eslint and prettier configs
Installation
If Node <= 14:
npm install --save-dev @inrupt/eslint-config-base
npm install --save-dev @inrupt/eslint-config-react
npx install-peerdeps @inrupt/eslint-config-react
npx install-peerdeps @inrupt/eslint-config-base
- Add
extends: ['@inrupt/eslint-config-react']
to your .eslintrc.js file.
If Node >= 16:
npm install --save-dev @inrupt/eslint-config-base
npm install --save-dev @inrupt/eslint-config-react
- Run the following scripts, adjusting version where necessary:
(
export PKG=@inrupt/eslint-config-base;
export VER=latest;
npm info "$PKG@VER" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@VER"
)
(
export PKG=@inrupt/eslint-config-react;
export VER=latest;
npm info "$PKG@VER" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@VER"
)
Then, add extends: ['@inrupt/eslint-config-lib']
to your .eslintrc.js file.
Rules
Exhaustive documentation forthcoming. For now, the general principles are:
- Load a stylistic base set - in this case,
airbnb and
airbnb/hooks
- Load inrupt-base, which loads recommended configs for common libraries: eslint, jest, typescript,
and prettier
- Do very little else- as few custom rules or overrides as possible.
- Some rules are updated to work with nextjs.