forked from Cognigy/Webchat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.a11y.config.mjs
More file actions
42 lines (41 loc) · 1.21 KB
/
Copy patheslint.a11y.config.mjs
File metadata and controls
42 lines (41 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import tsPlugin from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import reactPlugin from "eslint-plugin-react";
import jsxA11y from "eslint-plugin-jsx-a11y";
import globals from "globals";
/**
* Dedicated accessibility lint config used by the `lint:a11y` script and the
* a11y CI gate (.github/workflows/lint.yml).
*
* This config runs ONLY the jsx-a11y "recommended" ruleset (the main
* eslint.config.mjs also enforces these rules as errors). Scoping the CI gate
* to a11y rules alone lets it block PRs on accessibility regressions without
* being affected by unrelated, pre-existing lint debt elsewhere in the project.
*
* See docs/accessibility.md for the full accessibility governance setup.
*/
export default [
{
files: ["src/**/*.{ts,tsx,js,jsx}"],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaFeatures: { jsx: true },
sourceType: "module",
},
globals: globals.browser,
},
settings: {
react: {
version: "detect",
},
},
plugins: {
"@typescript-eslint": tsPlugin,
react: reactPlugin,
"jsx-a11y": jsxA11y,
},
// Only the accessibility rules, all as errors.
rules: jsxA11y.flatConfigs.recommended.rules,
},
];