debian-image-builder-frontend/.eslintrc.yml
regexowl f0c078921b eslint: Add accessibility rules
This adds eslint-plugin-jsx-a11y to the eslint configuration, setting up recommended set of rules for accessibility testing.

The error output by `jsx-a11y/no-autofocus` on encountering `autoFocus` attribute was switched to warning for now as whether to auto focus on an element or not can be highly contextual.

Fixes #948
2023-11-10 15:05:12 +01:00

47 lines
1.1 KiB
YAML

extends: [
"plugin:jsx-a11y/recommended",
"@redhat-cloud-services/eslint-config-redhat-cloud-services",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:testing-library/react"
]
globals:
insights: 'readonly'
shallow: readonly
render: 'readonly'
mount: 'readonly'
plugins:
- import
rules:
rulesdir/forbid-pf-relative-imports: off
no-unused-vars: warn
import/order:
- error
- groups:
- builtin
- external
- internal
- sibling
- parent
- index
alphabetize:
order: asc
caseInsensitive: true
newlines-between: always
pathGroups: # ensures the import of React is always on top
- pattern: react
group: builtin
position: before
pathGroupsExcludedImportTypes:
- react
prefer-const:
- error
- destructuring: any
no-console: 2
eqeqeq: error
array-callback-return: warn
jsx-a11y/no-autofocus: warn
overrides:
- files: "**/*.ts?(x)"
parser: "@typescript-eslint/parser"
extends: ".eslintrc-typescript.yml"