Eslint: use airbnb styles but exclude all jsx-a11y
Asked Answered
S

3

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.

Sprit answered 3/2, 2019 at 15:38 Comment(0)
H
9

In your .eslintrc you can change:

"extends": [
  "airbnb"
]

to

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

All credit goes to oustn

Hargett answered 4/4, 2019 at 12:22 Comment(0)
E
1

If you are using Typescript, then change:

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

To:

"extends": [
  "eslint-config-airbnb-base",
  "airbnb/rules/react"
],
Erubescent answered 2/8, 2020 at 7:56 Comment(0)
D
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'
]
Displacement answered 18/10, 2021 at 9:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.