Skip to content

Option to disable a11y plugin? #2032

Closed
Closed
@justinhelmer

Description

@justinhelmer

We love the airbnb style guide, including the react stuff. But we don't want any of the a11y rules.

I saw this, which makes me think it would be relatively easy to only include a11y through some configuration:

module.exports = {
  extends: [
    'eslint-config-airbnb-base', // want this
    'eslint-config-airbnb-base/rules/strict', // want this
    './rules/react', // want this
    './rules/react-a11y', // don't want this
  ].map(require.resolve),
  rules: {}
};

The other option would be to include each item independently, but it would require the react rules to be published separately:

module.exports = {
  extends: [
    'airbnb-base',
    'airbnb-base/rules/strict',
    'airbnb-react' // doesn't actually exist
  ]
}

When we try to just access airbnb-react via the eslint-config-airbnb package, it still requires eslint-plugin-jsx-a11y due to the way modules are resolved:

module.exports = {
  extends: [
    'airbnb-base',
    'airbnb-base/rules/strict',
    'airbnb/rules/react'
  ]
}

Throws an error

ESLint couldn't find the plugin "eslint-plugin-jsx-a11y". This can happen for a couple different reasons...

Our workaround is to install eslint-plugin-jsx-a11y even though it's not used, and include each item independently like above. This works, but forces us to include the extra dependency that we don't want or need.

Any suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions