Skip to content

Commit 6e16025

Browse files
authored
docs: update 'Related Rules' and 'Further Reading' in remaining rules (#15884)
* chore: update 'Related Rules' and 'Further Reading' in remaining rules * remove extra backticks * remove broken links * update http -> https where possible * restore dead links as webarchive links * restore eslintVersion.js
1 parent c7894cd commit 6e16025

164 files changed

Lines changed: 607 additions & 998 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ target.checkRuleFiles = function() {
775775
const docText = cat(docFilename);
776776
const docMarkdown = marked.lexer(docText, { gfm: true, silent: false });
777777
const ruleCode = cat(filename);
778-
const knownHeaders = ["Rule Details", "Options", "Environments", "Examples", "Known Limitations", "When Not To Use It", "Related Rules", "Compatibility", "Further Reading"];
778+
const knownHeaders = ["Rule Details", "Options", "Environments", "Examples", "Known Limitations", "When Not To Use It", "Compatibility"];
779779

780780
/**
781781
* Check if basename is present in rule-types.json file.

docs/src/rules/accessor-pairs.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ title: accessor-pairs
33
layout: doc
44
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/accessor-pairs.md
55
rule_type: suggestion
6+
related_rules:
7+
- no-dupe-keys
8+
- no-dupe-class-members
9+
further_reading:
10+
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set
11+
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get
12+
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects
613
---
714

815
Enforces getter/setter pairs in objects and classes.
@@ -287,14 +294,3 @@ See [no-dupe-class-members](no-dupe-class-members) if you also want to disallow
287294
## When Not To Use It
288295

289296
You can turn this rule off if you are not concerned with the simultaneous presence of setters and getters on objects.
290-
291-
## Related Rules
292-
293-
* [no-dupe-keys](no-dupe-keys)
294-
* [no-dupe-class-members](no-dupe-class-members)
295-
296-
## Further Reading
297-
298-
* [Object Setters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set)
299-
* [Object Getters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get)
300-
* [Working with Objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects)

docs/src/rules/array-bracket-newline.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ title: array-bracket-newline
33
layout: doc
44
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/array-bracket-newline.md
55
rule_type: layout
6+
related_rules:
7+
- array-bracket-spacing
68
---
79

810
<!--FIXABLE-->
@@ -280,10 +282,6 @@ var e = [
280282

281283
If you don't want to enforce line breaks after opening and before closing array brackets, don't enable this rule.
282284

283-
## Related Rules
284-
285-
* [array-bracket-spacing](array-bracket-spacing)
286-
287285
## Compatibility
288286

289287
* **JSCS:** [validateNewlineAfterArrayElements](https://jscs-dev.github.io/rule/validateNewlineAfterArrayElements)

docs/src/rules/array-bracket-spacing.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ title: array-bracket-spacing
33
layout: doc
44
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/array-bracket-spacing.md
55
rule_type: layout
6+
related_rules:
7+
- space-in-parens
8+
- object-curly-spacing
9+
- computed-property-spacing
610
---
711

812
<!--FIXABLE-->
@@ -224,9 +228,3 @@ var arr = [[ 1, 2 ], 2, [ 3, 4 ]];
224228
## When Not To Use It
225229

226230
You can turn this rule off if you are not concerned with the consistency of spacing between array brackets.
227-
228-
## Related Rules
229-
230-
* [space-in-parens](space-in-parens)
231-
* [object-curly-spacing](object-curly-spacing)
232-
* [computed-property-spacing](computed-property-spacing)

docs/src/rules/array-element-newline.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ title: array-element-newline
33
layout: doc
44
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/array-element-newline.md
55
rule_type: layout
6+
related_rules:
7+
- array-bracket-spacing
8+
- array-bracket-newline
9+
- object-property-newline
10+
- object-curly-spacing
11+
- object-curly-newline
12+
- max-statements-per-line
13+
- block-spacing
14+
- brace-style
615
---
716

817
<!--FIXABLE-->
@@ -383,17 +392,6 @@ var [i = function foo() {
383392

384393
If you don't want to enforce linebreaks between array elements, don't enable this rule.
385394

386-
## Related Rules
387-
388-
* [array-bracket-spacing](array-bracket-spacing)
389-
* [array-bracket-newline](array-bracket-newline)
390-
* [object-property-newline](object-property-newline)
391-
* [object-curly-spacing](object-curly-spacing)
392-
* [object-curly-newline](object-curly-newline)
393-
* [max-statements-per-line](max-statements-per-line)
394-
* [block-spacing](block-spacing)
395-
* [brace-style](brace-style)
396-
397395
## Compatibility
398396

399397
* **JSCS:** [validateNewlineAfterArrayElements](https://jscs-dev.github.io/rule/validateNewlineAfterArrayElements)

docs/src/rules/arrow-parens.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ title: arrow-parens
33
layout: doc
44
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/arrow-parens.md
55
rule_type: layout
6+
further_reading:
7+
- https://github.com/airbnb/javascript#arrows--one-arg-parens
68
---
79

810
<!--FIXABLE-->
@@ -230,8 +232,3 @@ a((foo) => { if (true) {} });
230232
([a, b]) => a;
231233
({a, b}) => a;
232234
```
233-
234-
## Further Reading
235-
236-
* The `"as-needed", { "requireForBlockBody": true }` rule is directly inspired by the Airbnb
237-
[JS Style Guide](https://github.com/airbnb/javascript#arrows--one-arg-parens).

docs/src/rules/block-spacing.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ title: block-spacing
33
layout: doc
44
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/block-spacing.md
55
rule_type: layout
6+
related_rules:
7+
- space-before-blocks
8+
- brace-style
69
---
710

811
<!--FIXABLE-->
@@ -82,8 +85,3 @@ class C {
8285
## When Not To Use It
8386

8487
If you don't want to be notified about spacing style inside of blocks, you can safely disable this rule.
85-
86-
## Related Rules
87-
88-
* [space-before-blocks](space-before-blocks)
89-
* [brace-style](brace-style)

docs/src/rules/brace-style.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ title: brace-style
33
layout: doc
44
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/brace-style.md
55
rule_type: layout
6+
related_rules:
7+
- block-spacing
8+
- space-before-blocks
9+
further_reading:
10+
- https://en.wikipedia.org/wiki/Indent_style
611
---
712

813
<!--FIXABLE-->
@@ -392,12 +397,3 @@ class D { static { foo(); } }
392397
## When Not To Use It
393398

394399
If you don't want to enforce a particular brace style, don't enable this rule.
395-
396-
## Related Rules
397-
398-
* [block-spacing](block-spacing)
399-
* [space-before-blocks](space-before-blocks)
400-
401-
## Further Reading
402-
403-
* [Indent style](https://en.wikipedia.org/wiki/Indent_style)

docs/src/rules/callback-return.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ title: callback-return
33
layout: doc
44
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/callback-return.md
55
rule_type: suggestion
6+
related_rules:
7+
- handle-callback-err
8+
further_reading:
9+
- https://github.com/maxogden/art-of-node#callbacks
10+
- https://web.archive.org/web/20171224042620/https://docs.nodejitsu.com/articles/errors/what-are-the-error-conventions/
611
---
712

813
Enforces return after callback.
@@ -171,12 +176,3 @@ function foo(err, callback) {
171176
There are some cases where you might want to call a callback function more than once. In those cases this rule
172177
may lead to incorrect behavior. In those cases you may want to reserve a special name for those callbacks and
173178
not include that in the list of callbacks that trigger warnings.
174-
175-
## Related Rules
176-
177-
* [handle-callback-err](handle-callback-err)
178-
179-
## Further Reading
180-
181-
* [The Art Of Node: Callbacks](https://github.com/maxogden/art-of-node#callbacks)
182-
* [Nodejitsu: What are the error conventions?](https://docs.nodejitsu.com/articles/errors/what-are-the-error-conventions/)

docs/src/rules/class-methods-use-this.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ title: class-methods-use-this
33
layout: doc
44
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/class-methods-use-this.md
55
rule_type: suggestion
6+
further_reading:
7+
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
8+
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static
69
---
710

811
Enforces that class methods utilize `this`.
@@ -173,8 +176,3 @@ class A {
173176
foo = () => {}
174177
}
175178
```
176-
177-
## Further Reading
178-
179-
* [Classes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes)
180-
* [Static Methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static)

0 commit comments

Comments
 (0)