eslint-config
These are Bjerk's eslint config, used on most of our projects.
This is derived work from runeh and Indiv AS:
https://github.com/runeh/typical-fetch/blob/main/.eslintrc.json
We'd actually love more users of our config, so if you have ideas on
improvements – please file an issue or pull request!
yarn add @bjerk/eslint-config
If you want help installing the bunch of peerDependencies for this package,
consider using this:
npx check-peer-dependencies
Or, if you're using pnpm, you can make it install peer
dependencies automatically:
pnpm config set auto-install-peers true --location project
To make all this config work, you only need to add this to package.json
:
{
"eslintConfig": {
"extends": "@bjerk/eslint-config"
}
}
Tip: We often use this along with @cobraz/prettier
, a shared Prettier config.
Migrate from v2?
We removed jest
-related rules in v3, essentially making jest
an optional
dependency. In our experience, we don't necessarily want to use Jest for every
project anymore. Versions below v3 require jest
.
Here are the steps to get it working [again]:
Run this in your terminal:
yarn add -D eslint-plugin-jest
{
"eslintConfig": {
"extends": ["@bjerk/eslint-config", "plugin:jest/recommended"],
"plugins": ["jest"]
}
}