Skip to content

Commit

Permalink
docs: use relative links for internal links (#16631)
Browse files Browse the repository at this point in the history
  • Loading branch information
kecrily committed Dec 8, 2022
1 parent 75276c9 commit fa2c64b
Show file tree
Hide file tree
Showing 30 changed files with 204 additions and 204 deletions.
2 changes: 1 addition & 1 deletion docs/src/developer-guide/code-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Code conventions for ESLint are determined by

The rationales for the specific rules in use can be found by looking to the
project documentation for any given rule. If the rule is one of our own, see
our own [rule documentation](https://eslint.org/docs/rules/) and otherwise, see
our own [rule documentation](../rules/) and otherwise, see
the documentation of the plugin in which the rule can be found.

If you need to make changes to a `package.json` file, please see the
Expand Down
2 changes: 1 addition & 1 deletion docs/src/developer-guide/contributing/new-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Even though these are the formal criteria for inclusion, each rule is evaluated

## Proposing a Rule

If you want to propose a new rule, please see how to [create a pull request](/docs/developer-guide/contributing/pull-requests) or submit an issue by filling out a [new rule template](https://github.com/eslint/eslint/issues/new/choose).
If you want to propose a new rule, please see how to [create a pull request](pull-requests) or submit an issue by filling out a [new rule template](https://github.com/eslint/eslint/issues/new/choose).

We need all of this information in order to determine whether or not the rule is a good core rule candidate.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/developer-guide/contributing/reporting-bugs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Reporting Bugs

---

If you think you've found a bug in ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new/choose) or a [pull request](/docs/developer-guide/contributing/pull-requests) on GitHub.
If you think you've found a bug in ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new/choose) or a [pull request](pull-requests) on GitHub.

Please include as much detail as possible to help us properly address your issue. If we need to triage issues and constantly ask people for more detail, that's time taken away from actually fixing issues. Help us be as efficient as possible by including a lot of detail in your issues.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/developer-guide/contributing/rule-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Occasionally, a core ESLint rule needs to be changed. This is not necessarily a

## Proposing a Rule Change

To propose a change to an existing rule, [create a pull request](/docs/developer-guide/contributing/pull-requests) or [new issue](https://github.com/eslint/eslint/issues/new/choose) and fill out the template.
To propose a change to an existing rule, [create a pull request](pull-requests) or [new issue](https://github.com/eslint/eslint/issues/new/choose) and fill out the template.

We need all of this information in order to determine whether or not the change is a good candidate for inclusion.

Expand Down
4 changes: 2 additions & 2 deletions docs/src/developer-guide/contributing/working-on-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Our public [issues tracker](https://github.com/eslint/eslint/issues) lists all o

## Issue Labels

We use labels to indicate the status of issues. The most complete documentation on the labels is found in the [Maintainer Guide](https://eslint.org/docs/maintainer-guide/issues.html#when-an-issue-is-opened), but most contributors should find the information on this page sufficient. The most important questions that labels can help you, as a contributor, answer are:
We use labels to indicate the status of issues. The most complete documentation on the labels is found in the [Maintainer Guide](../../maintainer-guide/issues#when-an-issue-is-opened), but most contributors should find the information on this page sufficient. The most important questions that labels can help you, as a contributor, answer are:

1. Is this issue available for me to work on? If you have little or no experience contributing to ESLint, the [`good first issue`](https://github.com/eslint/eslint/labels/good%20first%20issue) label marks appropriate issues. Otherwise, the [`help wanted`](https://github.com/eslint/eslint/labels/help%20wanted) label is an invitation to work on the issue. If you have more experience, you can try working on other issues labeled [`accepted`](https://github.com/eslint/eslint/labels/accepted). Conversely, issues not yet ready to work on are labeled `triage`, `evaluating`, and/or `needs bikeshedding`, and issues that cannot currently be worked on because of something else, such as a bug in a dependency, are labeled `blocked`.
1. What is this issue about? Labels describing the nature of issues include `bug`, `enhancement`, `feature`, `question`, `rule`, `documentation`, `core`, `build`, `cli`, `infrastructure`, `breaking`, and `chore`. These are documented in the [Maintainer Guide](https://eslint.org/docs/maintainer-guide/issues.html#types-of-issues).
1. What is this issue about? Labels describing the nature of issues include `bug`, `enhancement`, `feature`, `question`, `rule`, `documentation`, `core`, `build`, `cli`, `infrastructure`, `breaking`, and `chore`. These are documented in the [Maintainer Guide](../../maintainer-guide/issues#types-of-issues).
1. What is the priority of this issue? Because we have a lot of issues, we prioritize certain issues above others. The following is the list of priorities, from highest to lowest:

1. **Bugs** - problems with the project are actively affecting users. We want to get these resolved as quickly as possible.
Expand Down
8 changes: 4 additions & 4 deletions docs/src/developer-guide/nodejs-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ The most important method on `Linter` is `verify()`, which initiates linting of
* **Note**: If you want to lint text and have your configuration be read and processed, use [`ESLint#lintFiles()`][eslint-lintfiles] or [`ESLint#lintText()`][eslint-linttext] instead.
* `options` - (optional) Additional options for this run.
* `filename` - (optional) the filename to associate with the source code.
* `preprocess` - (optional) A function that [Processors in Plugins](/docs/developer-guide/working-with-plugins#processors-in-plugins) documentation describes as the `preprocess` method.
* `postprocess` - (optional) A function that [Processors in Plugins](/docs/developer-guide/working-with-plugins#processors-in-plugins) documentation describes as the `postprocess` method.
* `preprocess` - (optional) A function that [Processors in Plugins](working-with-plugins#processors-in-plugins) documentation describes as the `preprocess` method.
* `postprocess` - (optional) A function that [Processors in Plugins](working-with-plugins#processors-in-plugins) documentation describes as the `postprocess` method.
* `filterCodeBlock` - (optional) A function that decides which code blocks the linter should adopt. The function receives two arguments. The first argument is the virtual filename of a code block. The second argument is the text of the code block. If the function returned `true` then the linter adopts the code block. If the function was omitted, the linter adopts only `*.js` code blocks. If you provided a `filterCodeBlock` function, it overrides this default behavior, so the linter doesn't adopt `*.js` code blocks automatically.
* `disableFixes` - (optional) when set to `true`, the linter doesn't make either the `fix` or `suggestions` property of the lint result.
* `allowInlineConfig` - (optional) set to `false` to disable inline comments from changing ESLint rules.
Expand Down Expand Up @@ -686,7 +686,7 @@ Map {
### Linter#defineParser

Each instance of `Linter` holds a map of custom parsers. If you want to define a parser programmatically, you can add this function
with the name of the parser as first argument and the [parser object](/docs/developer-guide/working-with-custom-parsers) as second argument. The default `"espree"` parser will already be loaded for every `Linter` instance.
with the name of the parser as first argument and the [parser object](working-with-custom-parsers) as second argument. The default `"espree"` parser will already be loaded for every `Linter` instance.

```js
const Linter = require("eslint").Linter;
Expand Down Expand Up @@ -918,7 +918,7 @@ ruleTester.run("my-rule", myRule, {
---

[configuration object]: ../user-guide/configuring/
[builtin-formatters]: https://eslint.org/docs/user-guide/formatters/
[builtin-formatters]: ../user-guide/formatters/
[third-party-formatters]: https://www.npmjs.com/search?q=eslintformatter
[eslint-lintfiles]: #-eslintlintfilespatterns
[eslint-linttext]: #-eslintlinttextcode-options
Expand Down
2 changes: 1 addition & 1 deletion docs/src/developer-guide/selectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ If multiple selectors have equal specificity, their listeners will be called in

### Restricting syntax with selectors

With the [no-restricted-syntax](/docs/rules/no-restricted-syntax) rule, you can restrict the usage of particular syntax in your code. For example, you can use the following configuration to disallow using `if` statements that do not have block statements as their body:
With the [no-restricted-syntax](../rules/no-restricted-syntax) rule, you can restrict the usage of particular syntax in your code. For example, you can use the following configuration to disallow using `if` statements that do not have block statements as their body:

```json
{
Expand Down
2 changes: 1 addition & 1 deletion docs/src/developer-guide/working-with-custom-formatters.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ error semi

### Complex Argument Passing

If you find the custom formatter pattern doesn't provide enough options for the way you'd like to format ESLint results, the best option is to use ESLint's built-in [JSON formatter](https://eslint.org/docs/user-guide/formatters/) and pipe the output to a second program. For example:
If you find the custom formatter pattern doesn't provide enough options for the way you'd like to format ESLint results, the best option is to use ESLint's built-in [JSON formatter](../user-guide/formatters/) and pipe the output to a second program. For example:

```bash
eslint -f json src/ | your-program-that-reads-JSON --option
Expand Down
2 changes: 1 addition & 1 deletion docs/src/developer-guide/working-with-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ The plugin support was introduced in ESLint version `0.8.0`. Ensure the `peerDep

### Testing

ESLint provides the [`RuleTester`](/docs/developer-guide/nodejs-api#ruletester) utility to make it easy to test the rules of your plugin.
ESLint provides the [`RuleTester`](nodejs-api#ruletester) utility to make it easy to test the rules of your plugin.

### Linting

Expand Down
8 changes: 4 additions & 4 deletions docs/src/developer-guide/working-with-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ The `context` object contains additional functionality that is helpful for rules

* `parserOptions` - the parser options configured for this run (more details [here](../user-guide/configuring/language-options#specifying-parser-options)).
* `id` - the rule ID.
* `options` - an array of the [configured options](/docs/user-guide/configuring/rules#configuring-rules) for this rule. This array does not include the rule severity. For more information, see [here](#contextoptions).
* `settings` - the [shared settings](/docs/user-guide/configuring/configuration-files#adding-shared-settings) from configuration.
* `options` - an array of the [configured options](../user-guide/configuring/rules#configuring-rules) for this rule. This array does not include the rule severity. For more information, see [here](#contextoptions).
* `settings` - the [shared settings](../user-guide/configuring/configuration-files#adding-shared-settings) from configuration.
* `parserPath` - the name of the `parser` from configuration.
* `parserServices` - an object containing parser-provided services for rules. The default parser does not provide any services. However, if a rule is intended to be used with a custom parser, it could use `parserServices` to access anything provided by that parser. (For example, a TypeScript parser could provide the ability to get the computed type of a given node.)

Expand Down Expand Up @@ -373,7 +373,7 @@ Best practices for fixes:
({ "foo": 1 })
```

* This fixer can just select a quote type arbitrarily. If it guesses wrong, the resulting code will be automatically reported and fixed by the [`quotes`](/docs/rules/quotes) rule.
* This fixer can just select a quote type arbitrarily. If it guesses wrong, the resulting code will be automatically reported and fixed by the [`quotes`](../rules/quotes) rule.

Note: Making fixes as small as possible is a best practice, but in some cases it may be correct to extend the range of the fix in order to intentionally prevent other rules from making fixes in a surrounding range in the same pass. For instance, if replacement text declares a new variable, it can be useful to prevent other changes in the scope of the variable as they might cause name collisions.

Expand Down Expand Up @@ -714,7 +714,7 @@ You can access that code path objects with five events related to code paths.

Each bundled rule for ESLint core must have a set of unit tests submitted with it to be accepted. The test file is named the same as the source file but lives in `tests/lib/`. For example, if the rule source file is `lib/rules/foo.js` then the test file should be `tests/lib/rules/foo.js`.

ESLint provides the [`RuleTester`](/docs/developer-guide/nodejs-api#ruletester) utility to make it easy to write tests for rules.
ESLint provides the [`RuleTester`](nodejs-api#ruletester) utility to make it easy to write tests for rules.

## Performance Testing

Expand Down
2 changes: 1 addition & 1 deletion docs/src/library/rule-categories.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Rule categories

## Rule categories

The rule categories—namely “recommended”, “fixable”, and “hasSuggestions”—are shown in the [rules page](/rules/). They are rendered using the `ruleCategories` macro (imported from `/components/rule-categories.macro.html`). There is also an individual macro for each category type.
The rule categories—namely “recommended”, “fixable”, and “hasSuggestions”—are shown in the [rules page](../rules/). They are rendered using the `ruleCategories` macro (imported from `/components/rule-categories.macro.html`). There is also an individual macro for each category type.

```html
{ % from 'components/rule-categories.macro.html' import ruleCategories % }
Expand Down
8 changes: 4 additions & 4 deletions docs/src/maintainer-guide/governance.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ Website Team Members are community members who have shown that they are committe
* Are expected to delete their public branches when they are no longer necessary.
* Must submit pull requests for all changes.
* Have their work reviewed by Reviewers and TSC members before acceptance into the repository.
* May label and close website-related issues (see [Managing Issues](issues.html))
* May merge some pull requests (see [Managing Pull Requests](pullrequests.html))
* May label and close website-related issues (see [Managing Issues](issues))
* May merge some pull requests (see [Managing Pull Requests](pullrequests))

To become a Website Team Member:

Expand All @@ -59,8 +59,8 @@ Committers:
* Are expected to delete their public branches when they are no longer necessary.
* Must submit pull requests for all changes.
* Have their work reviewed by TSC members before acceptance into the repository.
* May label and close issues (see [Managing Issues](issues.html))
* May merge some pull requests (see [Managing Pull Requests](pullrequests.html))
* May label and close issues (see [Managing Issues](issues))
* May merge some pull requests (see [Managing Pull Requests](pullrequests))

To become a Committer:

Expand Down
2 changes: 1 addition & 1 deletion docs/src/rules/id-denylist.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ For example, to restrict the use of common generic identifiers:
}
```

**Note:** The first element of the array is for the rule severity (see [configuring rules](/docs/latest/user-guide/configuring/rules). The other elements in the array are the identifiers that you want to disallow.
**Note:** The first element of the array is for the rule severity (see [configuring rules](../user-guide/configuring/rules). The other elements in the array are the identifiers that you want to disallow.

Examples of **incorrect** code for this rule with sample `"data", "callback"` restricted identifiers:

Expand Down
2 changes: 1 addition & 1 deletion docs/src/rules/indent-legacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ rule_type: layout

This rule was **deprecated** in ESLint v4.0.0.

ESLint 4.0.0 introduced a rewrite of the [`indent`](/docs/rules/indent) rule, which now reports more errors than it did in previous versions. To ease the process of migrating to 4.0.0, the `indent-legacy` rule was introduced as a snapshot of the `indent` rule from ESLint 3.x. If your build is failing after the upgrade to 4.0.0, you can disable `indent` and enable `indent-legacy` as a quick fix. Eventually, you should switch back to the `indent` rule to get bugfixes and improvements in future versions.
ESLint 4.0.0 introduced a rewrite of the [`indent`](indent) rule, which now reports more errors than it did in previous versions. To ease the process of migrating to 4.0.0, the `indent-legacy` rule was introduced as a snapshot of the `indent` rule from ESLint 3.x. If your build is failing after the upgrade to 4.0.0, you can disable `indent` and enable `indent-legacy` as a quick fix. Eventually, you should switch back to the `indent` rule to get bugfixes and improvements in future versions.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/src/rules/indent.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ if (a) {

This rule has an object option:

* `"ignoredNodes"` can be used to disable indentation checking for any AST node. This accepts an array of [selectors](/docs/developer-guide/selectors). If an AST node is matched by any of the selectors, the indentation of tokens which are direct children of that node will be ignored. This can be used as an escape hatch to relax the rule if you disagree with the indentation that it enforces for a particular syntactic pattern.
* `"ignoredNodes"` can be used to disable indentation checking for any AST node. This accepts an array of [selectors](../developer-guide/selectors). If an AST node is matched by any of the selectors, the indentation of tokens which are direct children of that node will be ignored. This can be used as an escape hatch to relax the rule if you disagree with the indentation that it enforces for a particular syntactic pattern.
* `"SwitchCase"` (default: 0) enforces indentation level for `case` clauses in `switch` statements
* `"VariableDeclarator"` (default: 1) enforces indentation level for `var` declarators; can also take an object to define separate rules for `var`, `let` and `const` declarations. It can also be `"first"`, indicating all the declarators should be aligned with the first declarator.
* `"outerIIFEBody"` (default: 1) enforces indentation level for file-level IIFEs. This can also be set to `"off"` to disable checking for file-level IIFEs.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/rules/nonblock-statement-body-position.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if (foo) bar();

This rule aims to enforce a consistent location for single-line statements.

Note that this rule does not enforce the usage of single-line statements in general. If you would like to disallow single-line statements, use the [`curly`](/docs/rules/curly) rule instead.
Note that this rule does not enforce the usage of single-line statements in general. If you would like to disallow single-line statements, use the [`curly`](curly) rule instead.

### Options

Expand Down Expand Up @@ -182,4 +182,4 @@ while (foo)

## When Not To Use It

If you're not concerned about consistent locations of single-line statements, you should not turn on this rule. You can also disable this rule if you're using the `"all"` option for the [`curly`](/docs/rules/curly) rule, because this will disallow single-line statements entirely.
If you're not concerned about consistent locations of single-line statements, you should not turn on this rule. You can also disable this rule if you're using the `"all"` option for the [`curly`](curly) rule, because this will disallow single-line statements entirely.
2 changes: 1 addition & 1 deletion docs/src/rules/rest-spread-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ This rule aims to enforce consistent spacing between rest and spread operators a
}
```

Please read the user guide's section on [configuring parser options](/docs/user-guide/configuring#specifying-parser-options) to learn more.
Please read the user guide's section on [configuring parser options](../user-guide/configuring#specifying-parser-options) to learn more.

## Options

Expand Down

0 comments on commit fa2c64b

Please sign in to comment.