I am using NX Monorepo which comes with EsLint configured but without AirBnB Rules.
How can I use AirBnB Rules with the existing configuration?
I am using NX Monorepo which comes with EsLint configured but without AirBnB Rules.
How can I use AirBnB Rules with the existing configuration?
ricardoNava
On
This is my current override for TS
{
"files": ["*.ts", "*.tsx"],
"extends": [
"plugin:@nrwl/nx/typescript",
"airbnb",
"airbnb-typescript",
"plugin:prettier/recommended",
"plugin:react/jsx-runtime"
],
"parserOptions": {
"project": "./tsconfig.base.json"
},
"rules": {}
}
Most of the peerDependencies needed by these extend configs are already installed so double check before installing, in my case for React Integrated Repo I only installed:
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-plugin-prettier": "^4.2.1"
I use eslint-plugin-prettier since its recommended to leave the formatting part to Prettier, so that's optional. From there decide what to do with the clashing rules between NX conventions and the suggested by airbnb.
Copyright © 2021 Jogjafile Inc.
I ended up with config below, however I faced error related to vitest. It seems that airbnb's eslint-plugin-import configuration doesn't work well with monorepos. see linter error here So I just disabled this rule, because nx handles dependencies itself.
Also I found two similar issues you can checkout: