Shareable eslint
config enforcing our lint conventions.
This configuration assumes that the dependant project is using Prettier to style its code, leaving ESLint to handle the linting of code. eslint-config-base is not a plugin, so you need to spread the exported config into yours.
npm install --save-dev @dwp/eslint-config-base eslint
Add an eslint.config.js
file that looks something like:
import dwpConfigBase from '@dwp/eslint-config-base';
export default [
...dwpConfigBase,
{
languageOptions: {
...`the rest of your config`
Add eslint
to your test suite like this, or see our package.json for an example of how we do it:
{
"scripts": {
"lint": "eslint ."
}
}
This package contains only syntax linting rules, and explicitly excludes any styling rules that may conflict with our recommended styling ruleset, which uses Prettier.