From abcb7ac696a55d4a1a995071efa9966988607d55 Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Tue, 19 Nov 2024 03:14:36 +0100 Subject: [PATCH] docs: Fix and standardize links to ESLint documentation (#501) --- docs/rules/consistent-output.md | 2 +- docs/rules/fixer-return.md | 2 +- docs/rules/no-deprecated-context-methods.md | 4 ++-- docs/rules/no-deprecated-report-api.md | 7 +++---- docs/rules/no-missing-message-ids.md | 2 +- docs/rules/no-missing-placeholders.md | 2 +- docs/rules/no-unused-message-ids.md | 2 +- docs/rules/no-unused-placeholders.md | 2 +- docs/rules/no-useless-token-range.md | 2 +- docs/rules/prefer-message-ids.md | 2 +- docs/rules/prefer-object-rule.md | 2 +- docs/rules/prefer-placeholders.md | 2 +- docs/rules/prefer-replace-text.md | 2 +- docs/rules/require-meta-docs-description.md | 2 +- docs/rules/require-meta-docs-recommended.md | 2 +- docs/rules/require-meta-fixable.md | 4 ++-- docs/rules/require-meta-has-suggestions.md | 4 ++-- docs/rules/require-meta-schema-description.md | 2 +- docs/rules/require-meta-schema.md | 2 +- docs/rules/require-meta-type.md | 4 ++-- docs/rules/test-case-shorthand-strings.md | 2 +- 21 files changed, 27 insertions(+), 28 deletions(-) diff --git a/docs/rules/consistent-output.md b/docs/rules/consistent-output.md index 970cfebf..ffa6fe64 100644 --- a/docs/rules/consistent-output.md +++ b/docs/rules/consistent-output.md @@ -75,4 +75,4 @@ As mentioned in the introduction, the need for this rule is reduced as of ESLint ## Further Reading -- [`RuleTester` documentation](http://eslint.org/docs/developer-guide/working-with-plugins#testing) +- [ESLint plugin docs: Testing a Plugin](https://eslint.org/docs/latest/extend/plugins#testing-a-plugin) diff --git a/docs/rules/fixer-return.md b/docs/rules/fixer-return.md index 10978101..cfbdb5e8 100644 --- a/docs/rules/fixer-return.md +++ b/docs/rules/fixer-return.md @@ -4,7 +4,7 @@ -In a [fixable](https://eslint.org/docs/developer-guide/working-with-rules#applying-fixes) rule, a fixer function is useless if it never returns anything. +In a [fixable](https://eslint.org/docs/latest/extend/custom-rules#applying-fixes) rule, a fixer function is useless if it never returns anything. ## Rule Details diff --git a/docs/rules/no-deprecated-context-methods.md b/docs/rules/no-deprecated-context-methods.md index 50795425..c889666d 100644 --- a/docs/rules/no-deprecated-context-methods.md +++ b/docs/rules/no-deprecated-context-methods.md @@ -31,7 +31,7 @@ The deprecated methods are: - `getTokensBefore` - `getTokensBetween` -Instead of using these methods, you should use the equivalent methods on [`SourceCode`](https://eslint.org/docs/developer-guide/working-with-rules#contextgetsourcecode), e.g. `context.getSourceCode().getText()` instead of `context.getSource()`. +Instead of using these methods, you should use the equivalent methods on [`SourceCode`](https://eslint.org/docs/latest/extend/custom-rules#accessing-the-source-code), e.g. `context.sourceCode.getText()` instead of `context.getSource()`. ## Rule Details @@ -71,4 +71,4 @@ If you need to support very old versions of ESLint where `SourceCode` doesn't ex ## Further Reading -- [`SourceCode` API](https://eslint.org/docs/developer-guide/working-with-rules#contextgetsourcecode) +- [ESLint rule docs: Accessing the Source Code](https://eslint.org/docs/latest/extend/custom-rules#accessing-the-source-code) diff --git a/docs/rules/no-deprecated-report-api.md b/docs/rules/no-deprecated-report-api.md index 407faf61..ad20a2c6 100644 --- a/docs/rules/no-deprecated-report-api.md +++ b/docs/rules/no-deprecated-report-api.md @@ -8,8 +8,8 @@ ESLint has two APIs that rules can use to report problems. -- The [deprecated API](http://eslint.org/docs/developer-guide/working-with-rules-deprecated) accepts multiple arguments: `context.report(node, [loc], message)`. -- The ["new API"](http://eslint.org/docs/developer-guide/working-with-rules#contextreport) accepts a single argument: an object containing information about the reported problem. +- The [deprecated API](https://eslint.org/docs/latest/extend/custom-rules-deprecated) accepts multiple arguments: `context.report(node, [loc], message)`. +- The ["new API"](https://eslint.org/docs/latest/extend/custom-rules#reporting-problems) accepts a single argument: an object containing information about the reported problem. It is recommended that all rules use the new API. @@ -41,5 +41,4 @@ module.exports = { ## Further Reading -- [Deprecated rule API](http://eslint.org/docs/developer-guide/working-with-rules-deprecated) -- [New rule API](http://eslint.org/docs/developer-guide/working-with-rules) +- [ESLint rule docs: Reporting Problems](https://eslint.org/docs/latest/extend/custom-rules#reporting-problems) diff --git a/docs/rules/no-missing-message-ids.md b/docs/rules/no-missing-message-ids.md index 383ecf1b..a13600fe 100644 --- a/docs/rules/no-missing-message-ids.md +++ b/docs/rules/no-missing-message-ids.md @@ -58,6 +58,6 @@ module.exports = { ## Further Reading -- [messageIds API](https://eslint.org/docs/developer-guide/working-with-rules#messageids) +- [ESLint rule docs: `messageId`s](https://eslint.org/docs/latest/extend/custom-rules#messageids) - [no-unused-message-ids](./no-unused-message-ids.md) rule - [prefer-message-ids](./prefer-message-ids.md) rule diff --git a/docs/rules/no-missing-placeholders.md b/docs/rules/no-missing-placeholders.md index acead6a3..e86d36a4 100644 --- a/docs/rules/no-missing-placeholders.md +++ b/docs/rules/no-missing-placeholders.md @@ -74,4 +74,4 @@ If you want to use rule messages that actually contain double-curly bracket text ## Further Reading -- [context.report() API](http://eslint.org/docs/developer-guide/working-with-rules#contextreport) +- [ESLint rule docs: Using Message Placeholders](https://eslint.org/docs/latest/extend/custom-rules#using-message-placeholders) diff --git a/docs/rules/no-unused-message-ids.md b/docs/rules/no-unused-message-ids.md index 99660b00..6a277d4d 100644 --- a/docs/rules/no-unused-message-ids.md +++ b/docs/rules/no-unused-message-ids.md @@ -59,6 +59,6 @@ module.exports = { ## Further Reading -- [messageIds API](https://eslint.org/docs/developer-guide/working-with-rules#messageids) +- [ESLint rule docs: `messageId`s](https://eslint.org/docs/latest/extend/custom-rules#messageids) - [no-missing-message-ids](./no-missing-message-ids.md) rule - [prefer-message-ids](./prefer-message-ids.md) rule diff --git a/docs/rules/no-unused-placeholders.md b/docs/rules/no-unused-placeholders.md index 0f5454e1..d6a0db68 100644 --- a/docs/rules/no-unused-placeholders.md +++ b/docs/rules/no-unused-placeholders.md @@ -57,5 +57,5 @@ If you want to allow unused placeholders, you should turn off this rule. ## Further Reading -- [context.report() API](http://eslint.org/docs/developer-guide/working-with-rules#contextreport) +- [ESLint rule docs: Using Message Placeholders](https://eslint.org/docs/latest/extend/custom-rules#using-message-placeholders) - [no-missing-placeholders](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/no-missing-placeholders.md) diff --git a/docs/rules/no-useless-token-range.md b/docs/rules/no-useless-token-range.md index cb935d72..3f794725 100644 --- a/docs/rules/no-useless-token-range.md +++ b/docs/rules/no-useless-token-range.md @@ -48,4 +48,4 @@ module.exports = { ## Further Reading -- [`SourceCode` API](https://eslint.org/docs/developer-guide/working-with-rules#contextgetsourcecode) +- [ESLint rule docs: Accessing the Source Code](https://eslint.org/docs/latest/extend/custom-rules#accessing-the-source-code) diff --git a/docs/rules/prefer-message-ids.md b/docs/rules/prefer-message-ids.md index 45ea9d86..bc5f213f 100644 --- a/docs/rules/prefer-message-ids.md +++ b/docs/rules/prefer-message-ids.md @@ -59,6 +59,6 @@ module.exports = { ## Further Reading -- [messageIds API](https://eslint.org/docs/developer-guide/working-with-rules#messageids) +- [ESLint rule docs: `messageId`s](https://eslint.org/docs/latest/extend/custom-rules#messageids) - [no-invalid-message-ids](./no-invalid-message-ids.md) rule - [no-missing-message-ids](./no-missing-message-ids.md) rule diff --git a/docs/rules/prefer-object-rule.md b/docs/rules/prefer-object-rule.md index fa3df403..c0e0d9f0 100644 --- a/docs/rules/prefer-object-rule.md +++ b/docs/rules/prefer-object-rule.md @@ -6,7 +6,7 @@ -Prior to ESLint v9, ESLint supported both [function-style](https://eslint.org/docs/developer-guide/working-with-rules-deprecated) and [object-style](https://eslint.org/docs/developer-guide/working-with-rules) rules. However, function-style rules have been deprecated since 2016, and do not support newer features like autofixing and suggestions. +Prior to ESLint v9, ESLint supported both [function-style](https://eslint.org/docs/latest/extend/custom-rules-deprecated) and [object-style](https://eslint.org/docs/latest/extend/custom-rules) rules. However, function-style rules have been deprecated since 2016, and do not support newer features like autofixing and suggestions. As of [ESLint v9](https://github.com/eslint/rfcs/tree/main/designs/2021-schema-object-rules#motivation-for-requiring-object-style-rules), ESLint supports only object-style rules. diff --git a/docs/rules/prefer-placeholders.md b/docs/rules/prefer-placeholders.md index 20e29822..ca3b7b43 100644 --- a/docs/rules/prefer-placeholders.md +++ b/docs/rules/prefer-placeholders.md @@ -63,4 +63,4 @@ If you need to use string concatenation in your report messages for some reason, ## Further Reading -- [context.report() API](http://eslint.org/docs/developer-guide/working-with-rules#contextreport) +- [ESLint rule docs: Using Message Placeholders](https://eslint.org/docs/latest/extend/custom-rules#using-message-placeholders) diff --git a/docs/rules/prefer-replace-text.md b/docs/rules/prefer-replace-text.md index 7d233ae1..076665cf 100644 --- a/docs/rules/prefer-replace-text.md +++ b/docs/rules/prefer-replace-text.md @@ -53,4 +53,4 @@ module.exports = { ## Further Reading -- [Applying Fixes](https://eslint.org/docs/developer-guide/working-with-rules#applying-fixes) +- [ESLint rule docs: Applying Fixes](https://eslint.org/docs/latest/extend/custom-rules#applying-fixes) diff --git a/docs/rules/require-meta-docs-description.md b/docs/rules/require-meta-docs-description.md index 8de51bb9..1f37cb2f 100644 --- a/docs/rules/require-meta-docs-description.md +++ b/docs/rules/require-meta-docs-description.md @@ -59,4 +59,4 @@ module.exports = { ## Further Reading -- [working-with-rules#options-schemas](https://eslint.org/docs/developer-guide/working-with-rules#options-schemas) +- [ESLint rule docs: Options Schemas](https://eslint.org/docs/latest/extend/custom-rules#options-schemas) diff --git a/docs/rules/require-meta-docs-recommended.md b/docs/rules/require-meta-docs-recommended.md index 816a7b41..4b217c64 100644 --- a/docs/rules/require-meta-docs-recommended.md +++ b/docs/rules/require-meta-docs-recommended.md @@ -74,4 +74,4 @@ module.exports = { ## Further Reading -- [Rule Structure](https://eslint.org/docs/latest/extend/custom-rules#rule-structure) +- [ESLint rule docs: Rule Structure](https://eslint.org/docs/latest/extend/custom-rules#rule-structure) diff --git a/docs/rules/require-meta-fixable.md b/docs/rules/require-meta-fixable.md index e5f52ee9..8e55bbca 100644 --- a/docs/rules/require-meta-fixable.md +++ b/docs/rules/require-meta-fixable.md @@ -102,5 +102,5 @@ module.exports = { ## Further Reading -- [ESLint's autofix API](http://eslint.org/docs/developer-guide/working-with-rules#applying-fixes) -- [ESLint's rule basics mentioning `meta.fixable`](https://eslint.org/docs/developer-guide/working-with-rules#rule-basics) +- [ESLint rule docs: Applying Fixes](https://eslint.org/docs/latest/extend/custom-rules#applying-fixes) +- [ESLint rule docs: Rule Structure (mentioning `meta.fixable`)](https://eslint.org/docs/latest/extend/custom-rules#rule-structure) diff --git a/docs/rules/require-meta-has-suggestions.md b/docs/rules/require-meta-has-suggestions.md index 89c59e5a..ae765a3a 100644 --- a/docs/rules/require-meta-has-suggestions.md +++ b/docs/rules/require-meta-has-suggestions.md @@ -88,5 +88,5 @@ module.exports = { ## Further Reading -- [ESLint's suggestion API](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions) -- [ESLint rule basics describing the `meta.hasSuggestions` property](https://eslint.org/docs/developer-guide/working-with-rules#rule-basics) +- [ESLint rule docs: Providing Suggestions](https://eslint.org/docs/latest/extend/custom-rules#providing-suggestions) +- [ESLint rule docs: Rule Structure (mentioning `meta.hasSuggestions`)](https://eslint.org/docs/latest/extend/custom-rules#rule-structure) diff --git a/docs/rules/require-meta-schema-description.md b/docs/rules/require-meta-schema-description.md index 3ecc6c24..00a84e39 100644 --- a/docs/rules/require-meta-schema-description.md +++ b/docs/rules/require-meta-schema-description.md @@ -85,4 +85,4 @@ If your rule options are very simple and well-named, and your rule isn't used by ## Further Reading -- [working-with-rules#options-schemas](https://eslint.org/docs/developer-guide/working-with-rules#options-schemas) +- [ESLint rule docs: Options Schemas](https://eslint.org/docs/latest/extend/custom-rules#options-schemas) diff --git a/docs/rules/require-meta-schema.md b/docs/rules/require-meta-schema.md index c479d257..f3c72e59 100644 --- a/docs/rules/require-meta-schema.md +++ b/docs/rules/require-meta-schema.md @@ -89,4 +89,4 @@ As mentioned in the introduction, the need for this rule is reduced as of ESLint ## Further Reading -- [working-with-rules#options-schemas](https://eslint.org/docs/developer-guide/working-with-rules#options-schemas) +- [ESLint rule docs: Options Schemas](https://eslint.org/docs/latest/extend/custom-rules#options-schemas) diff --git a/docs/rules/require-meta-type.md b/docs/rules/require-meta-type.md index 92f18265..9dc21525 100644 --- a/docs/rules/require-meta-type.md +++ b/docs/rules/require-meta-type.md @@ -51,6 +51,6 @@ module.exports = { ## Further Reading -- [command-line-interface#--fix-type](https://eslint.org/docs/user-guide/command-line-interface#--fix-type) -- [working-with-rules#rule-basics](https://eslint.org/docs/developer-guide/working-with-rules#rule-basics) +- [ESLint CLI docs: `--fix-type`](https://eslint.org/docs/latest/use/command-line-interface#--fix-type) +- [ESLint rule docs: Rule Structure](https://eslint.org/docs/latest/extend/custom-rules#rule-structure) - [ESLint v5.9.0 released](https://eslint.org/blog/2018/11/eslint-v5.9.0-released#the-fix-type-option) diff --git a/docs/rules/test-case-shorthand-strings.md b/docs/rules/test-case-shorthand-strings.md index 0eb4acb8..9ff400a1 100644 --- a/docs/rules/test-case-shorthand-strings.md +++ b/docs/rules/test-case-shorthand-strings.md @@ -248,4 +248,4 @@ If you don't care about consistent usage of shorthand strings, you should not tu ## Further Reading -- [`RuleTester` documentation](http://eslint.org/docs/developer-guide/working-with-plugins#testing) +- [ESLint plugin docs: Testing a Plugin](https://eslint.org/docs/latest/extend/plugins#testing-a-plugin)