Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(eslint-config): change eslint to better match strict ruleset #24920

Merged
merged 2 commits into from
Jun 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 53 additions & 4 deletions packages/gatsby/src/utils/eslint-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const eslintConfig = (schema: GraphQLSchema): CLIEngine.Options => {
},
],
"react/jsx-pascal-case": `off`, // Prevents errors with Theme-UI and Styled component
// https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/master/docs/rules
"jsx-a11y/accessible-emoji": `warn`,
"jsx-a11y/alt-text": `warn`,
"jsx-a11y/anchor-has-content": `warn`,
Expand All @@ -42,12 +42,54 @@ export const eslintConfig = (schema: GraphQLSchema): CLIEngine.Options => {
// },
// ],
"jsx-a11y/click-events-have-key-events": `warn`,
"jsx-a11y/control-has-associated-label": `warn`,
"jsx-a11y/control-has-associated-label": [
`warn`,
{
ignoreElements: [
`audio`,
`canvas`,
`embed`,
`input`,
`textarea`,
`tr`,
`video`,
],
ignoreRoles: [
`grid`,
`listbox`,
`menu`,
`menubar`,
`radiogroup`,
`row`,
`tablist`,
`toolbar`,
`tree`,
`treegrid`,
],
includeRoles: [`alert`, `dialog`],
},
],
"jsx-a11y/heading-has-content": `warn`,
"jsx-a11y/html-has-lang": `warn`,
"jsx-a11y/iframe-has-title": `warn`,
"jsx-a11y/img-redundant-alt": `warn`,
"jsx-a11y/interactive-supports-focus": `warn`,
"jsx-a11y/interactive-supports-focus": [
`warn`,
{
tabbable: [
`button`,
`checkbox`,
`link`,
`progressbar`,
`searchbox`,
`slider`,
`spinbutton`,
`switch`,
`textbox`,
],
},
],
"jsx-a11y/label-has-for": `warn`,
"jsx-a11y/label-has-associated-control": `warn`,
"jsx-a11y/lang": `warn`,
"jsx-a11y/media-has-caption": `warn`,
Expand All @@ -56,7 +98,14 @@ export const eslintConfig = (schema: GraphQLSchema): CLIEngine.Options => {
"jsx-a11y/no-autofocus": `warn`,
"jsx-a11y/no-distracting-elements": `warn`,
"jsx-a11y/no-interactive-element-to-noninteractive-role": `warn`,
"jsx-a11y/no-noninteractive-element-interactions": `warn`,
"jsx-a11y/no-noninteractive-element-interactions": [
`warn`,
{
body: [`onError`, `onLoad`],
iframe: [`onError`, `onLoad`],
img: [`onError`, `onLoad`],
},
],
"jsx-a11y/no-noninteractive-element-to-interactive-role": `warn`,
"jsx-a11y/no-noninteractive-tabindex": `warn`,
"jsx-a11y/no-onchange": `warn`,
Expand Down