Skip to content

Commit

Permalink
Add support for JSX A11y
Browse files Browse the repository at this point in the history
  • Loading branch information
azat-io committed Apr 25, 2023
1 parent 5e0578a commit fc4b6b2
Show file tree
Hide file tree
Showing 43 changed files with 1,737 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -70,6 +70,7 @@
"eslint-plugin-inclusive-language": "~2.2.0",
"eslint-plugin-jsdoc": "~43.0.7",
"eslint-plugin-jsonc": "~2.7.0",
"eslint-plugin-jsx-a11y": "~6.7.1",
"eslint-plugin-mdx": "~2.0.5",
"eslint-plugin-n": "~15.7.0",
"eslint-plugin-node": "~11.1.0",
Expand Down
158 changes: 158 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions scripts/generate-rule-files/src/plugins-map.ts
Expand Up @@ -39,6 +39,10 @@ export const PLUGIN_REGISTRY: Readonly<Record<string, Plugin>> = {
name: 'Jsonc',
module: 'eslint-plugin-jsonc',
},
'jsx-a11y': {
name: 'JsxA11y',
module: 'eslint-plugin-jsx-a11y',
},
mdx: {
name: 'Mdx',
module: 'eslint-plugin-mdx',
Expand Down
40 changes: 40 additions & 0 deletions src/rules/jsx-a11y/accessible-emoji.d.ts
@@ -0,0 +1,40 @@
import type { RuleConfig } from '../rule-config';

/**
* Option.
*/
export interface AccessibleEmojiOption {
[k: string]: any;
}

/**
* Options.
*/
export type AccessibleEmojiOptions = [AccessibleEmojiOption?];

/**
* Enforce emojis are wrapped in `<span>` and provide screenreader access.
*
* @deprecated
*
* @see [accessible-emoji](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/HEAD/docs/rules/accessible-emoji.md)
*/
export type AccessibleEmojiRuleConfig = RuleConfig<AccessibleEmojiOptions>;

/**
* Enforce emojis are wrapped in `<span>` and provide screenreader access.
*
* @deprecated
*
* @see [accessible-emoji](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/HEAD/docs/rules/accessible-emoji.md)
*/
export interface AccessibleEmojiRule {
/**
* Enforce emojis are wrapped in `<span>` and provide screenreader access.
*
* @deprecated
*
* @see [accessible-emoji](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/HEAD/docs/rules/accessible-emoji.md)
*/
'jsx-a11y/accessible-emoji': AccessibleEmojiRuleConfig;
}
39 changes: 39 additions & 0 deletions src/rules/jsx-a11y/alt-text.d.ts
@@ -0,0 +1,39 @@
import type { RuleConfig } from '../rule-config';

/**
* Option.
*/
export interface AltTextOption {
elements?: string[];
img?: string[];
object?: string[];
area?: string[];
'input[type="image"]'?: string[];
[k: string]: any;
}

/**
* Options.
*/
export type AltTextOptions = [AltTextOption?];

/**
* Enforce all elements that require alternative text have meaningful information to relay back to end user.
*
* @see [alt-text](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/HEAD/docs/rules/alt-text.md)
*/
export type AltTextRuleConfig = RuleConfig<AltTextOptions>;

/**
* Enforce all elements that require alternative text have meaningful information to relay back to end user.
*
* @see [alt-text](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/HEAD/docs/rules/alt-text.md)
*/
export interface AltTextRule {
/**
* Enforce all elements that require alternative text have meaningful information to relay back to end user.
*
* @see [alt-text](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/HEAD/docs/rules/alt-text.md)
*/
'jsx-a11y/alt-text': AltTextRuleConfig;
}

0 comments on commit fc4b6b2

Please sign in to comment.