Skip to content

Commit 03d9cdc

Browse files
committed
docs: automate docs with eslint-doc-generator
1 parent 3ea368b commit 03d9cdc

25 files changed

+1584
-64
lines changed

.eslint-doc-generatorrc.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/** @type {import('eslint-doc-generator').GenerateOptions} */
2+
module.exports = {
3+
configEmoji: [
4+
['browser', '🔍'],
5+
['internal', '🔐'],
6+
['react', '⚛️']
7+
],
8+
ruleDocSectionInclude: ['Rule Details', 'Version'],
9+
};

README.md

+35-23
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Installation
44

55
```sh
6-
$ npm install --save-dev eslint eslint-plugin-github
6+
npm install --save-dev eslint eslint-plugin-github
77
```
88

99
## Setup
@@ -72,25 +72,37 @@ This config will be interpreted in the following way:
7272

7373
### Rules
7474

75-
- [Array Foreach](./docs/rules/array-foreach.md)
76-
- [Async Currenttarget](./docs/rules/async-currenttarget.md)
77-
- [Async Preventdefault](./docs/rules/async-preventdefault.md)
78-
- [Authenticity Token](./docs/rules/authenticity-token.md)
79-
- [Get Attribute](./docs/rules/get-attribute.md)
80-
- [JS Class Name](./docs/rules/js-class-name.md)
81-
- [No Blur](./docs/rules/no-blur.md)
82-
- [No D None](./docs/rules/no-d-none.md)
83-
- [No Dataset](./docs/rules/no-dataset.md)
84-
- [No Dynamic Script Tag](./docs/rules/no-dynamic-script-tag.md)
85-
- [No Implicit Buggy Globals](./docs/rules/no-implicit-buggy-globals.md)
86-
- [No Inner HTML](./docs/rules/no-inner-html.md)
87-
- [No InnerText](./docs/rules/no-innerText.md)
88-
- [No Then](./docs/rules/no-then.md)
89-
- [No Useless Passive](./docs/rules/no-useless-passive.md)
90-
- [Prefer Observers](./docs/rules/prefer-observers.md)
91-
- [Require Passive Events](./docs/rules/require-passive-events.md)
92-
- [Unescaped HTML Literal](./docs/rules/unescaped-html-literal.md)
93-
94-
#### Accessibility-focused rules (prefixed with a11y)
95-
96-
- [Role Supports ARIA Props](./docs/rules/role-supports-aria-props.md)
75+
<!-- begin auto-generated rules list -->
76+
77+
💼 Configurations enabled in.\
78+
🔍 Set in the `browser` configuration.\
79+
🔐 Set in the `internal` configuration.\
80+
⚛️ Set in the `react` configuration.\
81+
✅ Set in the `recommended` configuration.\
82+
🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
83+
❌ Deprecated.
84+
85+
| Name                      | Description | 💼 | 🔧 ||
86+
| :------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------- | :- | :- | :- |
87+
| [a11y-no-generic-link-text](docs/rules/a11y-no-generic-link-text.md) | disallow generic link text | | ||
88+
| [array-foreach](docs/rules/array-foreach.md) | enforce `for..of` loops over `Array.forEach` || | |
89+
| [async-currenttarget](docs/rules/async-currenttarget.md) | disallow `event.currentTarget` calls inside of async functions | 🔍 | | |
90+
| [async-preventdefault](docs/rules/async-preventdefault.md) | disallow `event.preventDefault` calls inside of async functions | 🔍 | | |
91+
| [authenticity-token](docs/rules/authenticity-token.md) | disallow usage of CSRF tokens in JavaScript | 🔐 | | |
92+
| [get-attribute](docs/rules/get-attribute.md) | disallow wrong usage of attribute names | 🔍 | 🔧 | |
93+
| [js-class-name](docs/rules/js-class-name.md) | enforce a naming convention for js- prefixed classes | 🔐 | | |
94+
| [no-blur](docs/rules/no-blur.md) | disallow usage of `Element.prototype.blur()` | 🔍 | | |
95+
| [no-d-none](docs/rules/no-d-none.md) | disallow usage the `d-none` CSS class | 🔐 | | |
96+
| [no-dataset](docs/rules/no-dataset.md) | enforce usage of `Element.prototype.getAttribute` instead of `Element.prototype.datalist` | 🔍 | | |
97+
| [no-dynamic-script-tag](docs/rules/no-dynamic-script-tag.md) | disallow creating dynamic script tags || | |
98+
| [no-implicit-buggy-globals](docs/rules/no-implicit-buggy-globals.md) | disallow implicit global variables || | |
99+
| [no-inner-html](docs/rules/no-inner-html.md) | disallow `Element.prototype.innerHTML` in favor of `Element.prototype.textContent` | 🔍 | | |
100+
| [no-innerText](docs/rules/no-innerText.md) | disallow `Element.prototype.innerText` in favor of `Element.prototype.textContent` | 🔍 | 🔧 | |
101+
| [no-then](docs/rules/no-then.md) | enforce using `async/await` syntax over Promises || | |
102+
| [no-useless-passive](docs/rules/no-useless-passive.md) | disallow marking a event handler as passive when it has no effect | 🔍 | 🔧 | |
103+
| [prefer-observers](docs/rules/prefer-observers.md) | disallow poorly performing event listeners | 🔍 | | |
104+
| [require-passive-events](docs/rules/require-passive-events.md) | enforce marking high frequency event handlers as passive | 🔍 | | |
105+
| [role-supports-aria-props](docs/rules/role-supports-aria-props.md) | Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role`. | ⚛️ | | |
106+
| [unescaped-html-literal](docs/rules/unescaped-html-literal.md) | disallow unescaped HTML literals | 🔍 | | |
107+
108+
<!-- end auto-generated rules list -->

docs/rules/a11y-no-generic-link-text.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# No Generic Link Text [Deprecated]
1+
# Disallow generic link text (`github/a11y-no-generic-link-text`)
22

3-
_This rule has been deprecated in favor of `anchor-ambiguous-text` in `eslint-plugin-jsx-a11y`._
3+
❌ This rule is deprecated. It was replaced by `jsx-a11y/anchor-ambiguous-text`.
4+
5+
<!-- end auto-generated rule header -->
46

57
## Rule Details
68

docs/rules/array-foreach.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Array Foreach
1+
# Enforce `for..of` loops over `Array.forEach` (`github/array-foreach`)
2+
3+
💼 This rule is enabled in the ✅ `recommended` config.
4+
5+
<!-- end auto-generated rule header -->
26

37
Prefer `for...of` statement instead of `Array.forEach`.
48

docs/rules/async-currenttarget.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Async Currenttarget
1+
# Disallow `event.currentTarget` calls inside of async functions (`github/async-currenttarget`)
2+
3+
💼 This rule is enabled in the 🔍 `browser` config.
4+
5+
<!-- end auto-generated rule header -->
26

37
## Rule Details
48

docs/rules/async-preventdefault.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Async Preventdefault
1+
# Disallow `event.preventDefault` calls inside of async functions (`github/async-preventdefault`)
2+
3+
💼 This rule is enabled in the 🔍 `browser` config.
4+
5+
<!-- end auto-generated rule header -->
26

37
Using `event.preventDefault()` inside an `async function()` won't likely work as you'd expect because synchronous nature of event dispatch.
48

docs/rules/authenticity-token.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Authenticity Token
1+
# Disallow usage of CSRF tokens in JavaScript (`github/authenticity-token`)
2+
3+
💼 This rule is enabled in the 🔐 `internal` config.
4+
5+
<!-- end auto-generated rule header -->
26

37
## Rule Details
48

docs/rules/get-attribute.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# Get Attribute
1+
# Disallow wrong usage of attribute names (`github/get-attribute`)
2+
3+
💼 This rule is enabled in the 🔍 `browser` config.
4+
5+
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
6+
7+
<!-- end auto-generated rule header -->
28

39
## Rule Details
410

docs/rules/js-class-name.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# JS Class Name
1+
# Enforce a naming convention for js- prefixed classes (`github/js-class-name`)
2+
3+
💼 This rule is enabled in the 🔐 `internal` config.
4+
5+
<!-- end auto-generated rule header -->
26

37
JavaScript should only query and handle events for `js-` prefixed class names.
48

docs/rules/no-blur.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# No Blur
1+
# Disallow usage of `Element.prototype.blur()` (`github/no-blur`)
2+
3+
💼 This rule is enabled in the 🔍 `browser` config.
4+
5+
<!-- end auto-generated rule header -->
26

37
Do not use `element.blur()`. Blurring an element causes the focus position to be reset causing accessibility issues when using keyboard or voice navigation. Instead, restore focus by calling `element.focus()` on a prior element.
48

docs/rules/no-d-none.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# No D None
1+
# Disallow usage the `d-none` CSS class (`github/no-d-none`)
2+
3+
💼 This rule is enabled in the 🔐 `internal` config.
4+
5+
<!-- end auto-generated rule header -->
26

37
## Rule Details
48

docs/rules/no-dataset.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# No Dataset
1+
# Enforce usage of `Element.prototype.getAttribute` instead of `Element.prototype.datalist` (`github/no-dataset`)
2+
3+
💼 This rule is enabled in the 🔍 `browser` config.
4+
5+
<!-- end auto-generated rule header -->
26

37
## Rule Details
48

docs/rules/no-dynamic-script-tag.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# No Dynamic Script Tag
1+
# Disallow creating dynamic script tags (`github/no-dynamic-script-tag`)
2+
3+
💼 This rule is enabled in the ✅ `recommended` config.
4+
5+
<!-- end auto-generated rule header -->
26

37
## Rule Details
48

docs/rules/no-implicit-buggy-globals.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# No Implicit Buggy Globals
1+
# Disallow implicit global variables (`github/no-implicit-buggy-globals`)
2+
3+
💼 This rule is enabled in the ✅ `recommended` config.
4+
5+
<!-- end auto-generated rule header -->
26

37
## Rule Details
48

docs/rules/no-inner-html.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# No Inner HTML
1+
# Disallow `Element.prototype.innerHTML` in favor of `Element.prototype.textContent` (`github/no-inner-html`)
2+
3+
💼 This rule is enabled in the 🔍 `browser` config.
4+
5+
<!-- end auto-generated rule header -->
26

37
## Rule Details
48

docs/rules/no-innerText.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# No InnerText
1+
# Disallow `Element.prototype.innerText` in favor of `Element.prototype.textContent` (`github/no-innerText`)
2+
3+
💼 This rule is enabled in the 🔍 `browser` config.
4+
5+
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
6+
7+
<!-- end auto-generated rule header -->
28

39
## Rule Details
410

docs/rules/no-then.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# No Then
1+
# Enforce using `async/await` syntax over Promises (`github/no-then`)
2+
3+
💼 This rule is enabled in the ✅ `recommended` config.
4+
5+
<!-- end auto-generated rule header -->
26

37
## Rule Details
48

docs/rules/no-useless-passive.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# No Useless Passive
1+
# Disallow marking a event handler as passive when it has no effect (`github/no-useless-passive`)
2+
3+
💼 This rule is enabled in the 🔍 `browser` config.
4+
5+
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
6+
7+
<!-- end auto-generated rule header -->
28

39
This rule disallows setting `passive: true` for events on which it will have no effect.
410

docs/rules/prefer-observers.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Prefer Observers
1+
# Disallow poorly performing event listeners (`github/prefer-observers`)
2+
3+
💼 This rule is enabled in the 🔍 `browser` config.
4+
5+
<!-- end auto-generated rule header -->
26

37
Some events, such as `scroll` and `resize` have traditionally caused performance issues on web pages, as they are high frequency events, firing many times per second as the user interacts with the page viewport.
48

docs/rules/require-passive-events.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Require Passive Events
1+
# Enforce marking high frequency event handlers as passive (`github/require-passive-events`)
2+
3+
💼 This rule is enabled in the 🔍 `browser` config.
4+
5+
<!-- end auto-generated rule header -->
26

37
This rule enforces adding `passive: true` to high frequency event listeners (`touchstart`, `touchmove`, `touchenter`, `touchend`, `touchleave`, `wheel`, `mousewheel`).
48

docs/rules/role-supports-aria-props.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Role Supports ARIA Props
1+
# Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role` (`github/role-supports-aria-props`)
2+
3+
💼 This rule is enabled in the ⚛️ `react` config.
4+
5+
<!-- end auto-generated rule header -->
26

37
## Rule Details
48

@@ -72,3 +76,5 @@ There are conflicting resources and opinions on what elements should support the
7276
<h1 id="dialogHeading">Heading</h1>
7377
</div>
7478
```
79+
80+
## Version

docs/rules/unescaped-html-literal.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Unescaped HTML Literal
1+
# Disallow unescaped HTML literals (`github/unescaped-html-literal`)
2+
3+
💼 This rule is enabled in the 🔍 `browser` config.
4+
5+
<!-- end auto-generated rule header -->
26

37
## Rule Details
48

lib/rules/a11y-no-generic-link-text.js

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ module.exports = {
1818
description: 'disallow generic link text',
1919
url: require('../url')(module),
2020
},
21+
deprecated: true,
22+
replacedBy: ['jsx-a11y/anchor-ambiguous-text'],
2123
schema: [],
2224
},
2325

0 commit comments

Comments
 (0)