@rebeccastevens/eslint-config 3.3.0 → 3.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -8,20 +8,20 @@ const fs = require('node:fs/promises');
8
8
  const globals = require('globals');
9
9
 
10
10
  function _interopNamespaceDefault(e) {
11
- const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
12
- if (e) {
13
- for (const k in e) {
14
- if (k !== 'default') {
15
- const d = Object.getOwnPropertyDescriptor(e, k);
16
- Object.defineProperty(n, k, d.get ? d : {
17
- enumerable: true,
18
- get: () => e[k]
19
- });
20
- }
11
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
12
+ if (e) {
13
+ for (const k in e) {
14
+ if (k !== 'default') {
15
+ const d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: () => e[k]
19
+ });
20
+ }
21
+ }
21
22
  }
22
- }
23
- n.default = e;
24
- return Object.freeze(n);
23
+ n.default = e;
24
+ return Object.freeze(n);
25
25
  }
26
26
 
27
27
  const path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
@@ -1226,7 +1226,7 @@ async function imports(options) {
1226
1226
  "import/no-dynamic-require": "error",
1227
1227
  },
1228
1228
  },
1229
- ...((typescript
1229
+ ...(typescript
1230
1230
  ? [
1231
1231
  {
1232
1232
  files: [GLOB_TS, GLOB_TSX, GLOB_DTS],
@@ -1247,7 +1247,7 @@ async function imports(options) {
1247
1247
  },
1248
1248
  },
1249
1249
  ]
1250
- : [])),
1250
+ : []),
1251
1251
  ];
1252
1252
  }
1253
1253
 
@@ -2078,10 +2078,11 @@ const RemixPackages = ["@remix-run/node", "@remix-run/react", "@remix-run/serve"
2078
2078
  const NextJsPackages = ["next"];
2079
2079
  async function react(options) {
2080
2080
  const { files, i18n, overrides, typescript, parserOptions } = options;
2081
- const [pluginReact, pluginReactHooks, pluginReactRefresh] = (await loadPackages([
2081
+ const [pluginReact, pluginReactHooks, pluginReactRefresh, pluginJsxA11y] = (await loadPackages([
2082
2082
  "@eslint-react/eslint-plugin",
2083
2083
  "eslint-plugin-react-hooks",
2084
2084
  "eslint-plugin-react-refresh",
2085
+ "eslint-plugin-jsx-a11y",
2085
2086
  ]));
2086
2087
  const parserTs = typescript ? await interopDefault(import('@typescript-eslint/parser')) : undefined;
2087
2088
  const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => localPkg.isPackageExists(i));
@@ -2098,6 +2099,7 @@ async function react(options) {
2098
2099
  "react-hooks-extra": plugins["@eslint-react/hooks-extra"],
2099
2100
  "react-naming-convention": plugins["@eslint-react/naming-convention"],
2100
2101
  "react-refresh": pluginReactRefresh,
2102
+ "jsx-a11y": pluginJsxA11y,
2101
2103
  },
2102
2104
  },
2103
2105
  {
@@ -2179,6 +2181,79 @@ async function react(options) {
2179
2181
  "react/prefer-destructuring-assignment": "error",
2180
2182
  "react/prefer-shorthand-boolean": "error",
2181
2183
  "react/prefer-shorthand-fragment": "error",
2184
+ "jsx-a11y/alt-text": "error",
2185
+ "jsx-a11y/anchor-has-content": "error",
2186
+ "jsx-a11y/anchor-is-valid": "error",
2187
+ "jsx-a11y/aria-activedescendant-has-tabindex": "error",
2188
+ "jsx-a11y/aria-props": "error",
2189
+ "jsx-a11y/aria-proptypes": "error",
2190
+ "jsx-a11y/aria-role": "error",
2191
+ "jsx-a11y/aria-unsupported-elements": "error",
2192
+ "jsx-a11y/autocomplete-valid": "error",
2193
+ "jsx-a11y/click-events-have-key-events": "error",
2194
+ "jsx-a11y/control-has-associated-label": [
2195
+ "off",
2196
+ {
2197
+ ignoreElements: ["audio", "canvas", "embed", "input", "textarea", "tr", "video"],
2198
+ ignoreRoles: [
2199
+ "grid",
2200
+ "listbox",
2201
+ "menu",
2202
+ "menubar",
2203
+ "radiogroup",
2204
+ "row",
2205
+ "tablist",
2206
+ "toolbar",
2207
+ "tree",
2208
+ "treegrid",
2209
+ ],
2210
+ includeRoles: ["alert", "dialog"],
2211
+ },
2212
+ ],
2213
+ "jsx-a11y/heading-has-content": "error",
2214
+ "jsx-a11y/html-has-lang": "error",
2215
+ "jsx-a11y/iframe-has-title": "error",
2216
+ "jsx-a11y/img-redundant-alt": "error",
2217
+ "jsx-a11y/interactive-supports-focus": [
2218
+ "error",
2219
+ {
2220
+ tabbable: [
2221
+ "button",
2222
+ "checkbox",
2223
+ "link",
2224
+ "progressbar",
2225
+ "searchbox",
2226
+ "slider",
2227
+ "spinbutton",
2228
+ "switch",
2229
+ "textbox",
2230
+ ],
2231
+ },
2232
+ ],
2233
+ "jsx-a11y/label-has-for": "off",
2234
+ "jsx-a11y/label-has-associated-control": "error",
2235
+ "jsx-a11y/media-has-caption": "error",
2236
+ "jsx-a11y/mouse-events-have-key-events": "error",
2237
+ "jsx-a11y/no-access-key": "error",
2238
+ "jsx-a11y/no-autofocus": "error",
2239
+ "jsx-a11y/no-distracting-elements": "error",
2240
+ "jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
2241
+ "jsx-a11y/no-noninteractive-element-interactions": [
2242
+ "error",
2243
+ {
2244
+ body: ["onError", "onLoad"],
2245
+ iframe: ["onError", "onLoad"],
2246
+ img: ["onError", "onLoad"],
2247
+ },
2248
+ ],
2249
+ "jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
2250
+ "jsx-a11y/no-noninteractive-tabindex": "error",
2251
+ "jsx-a11y/no-redundant-roles": "error",
2252
+ "jsx-a11y/no-static-element-interactions": "error",
2253
+ "jsx-a11y/role-has-required-aria-props": "error",
2254
+ "jsx-a11y/role-supports-aria-props": "error",
2255
+ "jsx-a11y/scope": "error",
2256
+ "jsx-a11y/tabindex-no-positive": "error",
2182
2257
  ...(typescript
2183
2258
  ? {
2184
2259
  "react/no-leaked-conditional-rendering": "error",
@@ -3136,7 +3211,7 @@ async function typescript(options) {
3136
3211
  },
3137
3212
  {
3138
3213
  selector: "variable",
3139
- filter: { regex: "_[^_]+", match: true },
3214
+ filter: { regex: "^[mM]ut_[^_]+", match: true },
3140
3215
  format: ["camelCase", "PascalCase"],
3141
3216
  modifiers: ["const"],
3142
3217
  prefix: ["mut_", "Mut_"],
@@ -3164,20 +3239,12 @@ async function typescript(options) {
3164
3239
  },
3165
3240
  {
3166
3241
  selector: ["autoAccessor", "parameterProperty", "property"],
3242
+ filter: { regex: "^[mM]ut_[^_]+", match: true },
3167
3243
  format: ["camelCase", "PascalCase"],
3168
3244
  prefix: ["mut_", "Mut_"],
3169
3245
  leadingUnderscore: "forbid",
3170
3246
  trailingUnderscore: "forbid",
3171
3247
  },
3172
- {
3173
- selector: ["autoAccessor", "parameterProperty", "property"],
3174
- filter: { regex: "_[^_]+", match: true },
3175
- format: ["camelCase", "PascalCase"],
3176
- modifiers: ["readonly"],
3177
- prefix: ["mut_", "Mut_"],
3178
- leadingUnderscore: "forbid",
3179
- trailingUnderscore: "forbid",
3180
- },
3181
3248
  {
3182
3249
  selector: ["autoAccessor", "parameterProperty", "property"],
3183
3250
  format: ["camelCase", "PascalCase", "UPPER_CASE"],