A base ESLint configuration which extends the following:
Install this package, and ensure you have installed its peer dependencies.
yarn info @side/eslint-config-base peerDependencies
yarn add -D @side/eslint-config-base
Once all peer dependencies have been added to your project, extend this configuration in your project's .eslintrc.js
.
.eslintrc.js
module.exports = {
extends: ['@side/base'],
};
If you're trying to integrate this library with a monorepo, you will want to tell @side/eslint-config-base
of the workspaces you have setup so rules such as import/no-extraneous-dependencies
can properly navigate the correct package.json files. You have two ways you can do this in your root package.json file.
If you have setup workspaces already, then there is nothing else you need to do. Lint-config will pick this up and do it's thing.
./package.json
{
"workspaces": ["packages/*"]
}
If option 1 isn't doable, you can specify your workspaces inside the lintConfig
property.
./package.json
"lintConfig": {
"workspaces": ["packages/*"]
},
For more information on configuring ESLint, please refer to their documentation