10

I would like to use airbnb styles ESLint. However, accessibility does not bring values in my project, and actually it add more noise to the code.

Is there a way to use AirBnb eslint but disable jsx-a11y? I can fork the AirBnb repo and delete the link, but just wonder if there is a better way.

3 Answers 3

9

In your .eslintrc you can change:

"extends": [
  "airbnb"
]

to

"extends": [
  "airbnb-base",
  "airbnb/rules/react"
]

All credit goes to oustn

1

If you are using Typescript, then change:

"extends": [
  "airbnb-typescript"
],

To:

"extends": [
  "eslint-config-airbnb-base",
  "airbnb/rules/react"
],
0

Uninstall eslint-config-airbnb, then install and use eslint-config-airbnb-base, eslint-plugin-react, and eslint-plugin-react-hooks. If you also want TypeScript, install eslint-config-airbnb-typescript as normal. Your eslint config should have changed from:

extends: [
  'airbnb',
  'airbnb-typescript'
]

to:

extends: [
  'eslint:recommended',
  'plugin:react/recommended',
  'plugin:react-hooks/recommended',
  'airbnb-base',
  'airbnb-typescript'
]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.