From 21d647904dc30f9484b22acdd9243a6d0ecfba38 Mon Sep 17 00:00:00 2001 From: Milos Djermanovic Date: Thu, 9 Jun 2022 20:15:11 +0200 Subject: [PATCH] docs: change some absolute links to relative (#15970) --- docs/src/rules/no-undef.md | 2 +- docs/src/user-guide/command-line-interface.md | 2 +- docs/src/user-guide/configuring/ignoring-code.md | 2 +- docs/src/user-guide/configuring/index.md | 2 +- .../user-guide/configuring/language-options.md | 2 +- docs/src/user-guide/configuring/plugins.md | 2 +- docs/src/user-guide/configuring/rules.md | 16 ++++++++-------- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/src/rules/no-undef.md b/docs/src/rules/no-undef.md index 6f153b94de8..33f2abbfd19 100644 --- a/docs/src/rules/no-undef.md +++ b/docs/src/rules/no-undef.md @@ -16,7 +16,7 @@ This rule can help you locate potential ReferenceErrors resulting from misspelli ## Rule Details -Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a `/*global ...*/` comment, or specified in the [`globals` key in the configuration file](https://eslint.org/docs/user-guide/configuring#specifying-globals). A common use case for these is if you intentionally use globals that are defined elsewhere (e.g. in a script sourced from HTML). +Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a `/*global ...*/` comment, or specified in the [`globals` key in the configuration file](../user-guide/configuring/language-options#using-configuration-files-1). A common use case for these is if you intentionally use globals that are defined elsewhere (e.g. in a script sourced from HTML). Examples of **incorrect** code for this rule: diff --git a/docs/src/user-guide/command-line-interface.md b/docs/src/user-guide/command-line-interface.md index ca5cc4869a5..060e1750dff 100644 --- a/docs/src/user-guide/command-line-interface.md +++ b/docs/src/user-guide/command-line-interface.md @@ -10,7 +10,7 @@ eleventyNavigation: --- -ESLint requires Node.js for installation. Follow the instructions in the [Getting Started Guide](https://eslint.org/docs/user-guide/getting-started) to install ESLint. +ESLint requires Node.js for installation. Follow the instructions in the [Getting Started Guide](getting-started) to install ESLint. Most users use [`npx`](https://docs.npmjs.com/cli/v8/commands/npx) to run ESLint on the command line like this: diff --git a/docs/src/user-guide/configuring/ignoring-code.md b/docs/src/user-guide/configuring/ignoring-code.md index 7e02d38d265..db988459d5d 100644 --- a/docs/src/user-guide/configuring/ignoring-code.md +++ b/docs/src/user-guide/configuring/ignoring-code.md @@ -50,7 +50,7 @@ When ESLint is run, it looks in the current working directory to find an `.eslin Globs are matched using [node-ignore](https://github.com/kaelzhang/node-ignore), so a number of features are available: * Lines beginning with `#` are treated as comments and do not affect the ignore patterns. -* Paths are relative to the current working directory. This is also true of paths passed in via the `--ignore-pattern` [command](https://eslint.org/docs/user-guide/command-line-interface#--ignore-pattern). +* Paths are relative to the current working directory. This is also true of paths passed in via the `--ignore-pattern` [command](../command-line-interface#--ignore-pattern). * Lines preceded by `!` are negated patterns that re-include a pattern that was ignored by an earlier pattern. * Ignore patterns behave according to the `.gitignore` [specification](https://git-scm.com/docs/gitignore). diff --git a/docs/src/user-guide/configuring/index.md b/docs/src/user-guide/configuring/index.md index 76c9ed30a2c..f9351dd75f2 100644 --- a/docs/src/user-guide/configuring/index.md +++ b/docs/src/user-guide/configuring/index.md @@ -13,7 +13,7 @@ eleventyNavigation: ESLint is designed to be flexible and configurable for your use case. You can turn off every rule and run only with basic syntax validation or mix and match the bundled rules and your custom rules to fit the needs of your project. There are two primary ways to configure ESLint: 1. **Configuration Comments** - use JavaScript comments to embed configuration information directly into a file. -1. **Configuration Files** - use a JavaScript, JSON, or YAML file to specify configuration information for an entire directory and all of its subdirectories. This can be in the form of a [`.eslintrc.*`](./configuration-files#configuration-file-formats) file or an `eslintConfig` field in a [`package.json`](https://docs.npmjs.com/files/package.json) file, both of which ESLint will look for and read automatically, or you can specify a configuration file on the [command line](https://eslint.org/docs/user-guide/command-line-interface). +1. **Configuration Files** - use a JavaScript, JSON, or YAML file to specify configuration information for an entire directory and all of its subdirectories. This can be in the form of a [`.eslintrc.*`](./configuration-files#configuration-file-formats) file or an `eslintConfig` field in a [`package.json`](https://docs.npmjs.com/files/package.json) file, both of which ESLint will look for and read automatically, or you can specify a configuration file on the [command line](../command-line-interface). Here are some of the options that you can configure in ESLint: diff --git a/docs/src/user-guide/configuring/language-options.md b/docs/src/user-guide/configuring/language-options.md index 858114a838a..5397d8395e4 100644 --- a/docs/src/user-guide/configuring/language-options.md +++ b/docs/src/user-guide/configuring/language-options.md @@ -53,7 +53,7 @@ An environment provides predefined global variables. The available environments These environments are not mutually exclusive, so you can define more than one at a time. -Environments can be specified inside of a file, in configuration files or using the `--env` [command line](https://eslint.org/docs/user-guide/command-line-interface) flag. +Environments can be specified inside of a file, in configuration files or using the `--env` [command line](../command-line-interface) flag. ### Using configuration comments diff --git a/docs/src/user-guide/configuring/plugins.md b/docs/src/user-guide/configuring/plugins.md index a811076ee59..6b0bb9b8592 100644 --- a/docs/src/user-guide/configuring/plugins.md +++ b/docs/src/user-guide/configuring/plugins.md @@ -19,7 +19,7 @@ eleventyNavigation: By default, ESLint uses [Espree](https://github.com/eslint/espree) as its parser. You can optionally specify that a different parser should be used in your configuration file so long as the parser meets the following requirements: 1. It must be a Node module loadable from the config file where the parser is used. Usually, this means you should install the parser package separately using npm. -1. It must conform to the [parser interface](https://eslint.org/docs/developer-guide/working-with-custom-parsers). +1. It must conform to the [parser interface](../../developer-guide/working-with-custom-parsers). Note that even with these compatibilities, there are no guarantees that an external parser will work correctly with ESLint and ESLint will not fix bugs related to incompatibilities with other parsers. diff --git a/docs/src/user-guide/configuring/rules.md b/docs/src/user-guide/configuring/rules.md index 5529356c394..98b4645626c 100644 --- a/docs/src/user-guide/configuring/rules.md +++ b/docs/src/user-guide/configuring/rules.md @@ -29,7 +29,7 @@ To configure rules inside of a file using configuration comments, use a comment /* eslint eqeqeq: "off", curly: "error" */ ``` -In this example, [`eqeqeq`](https://eslint.org/docs/rules/eqeqeq) is turned off and [`curly`](https://eslint.org/docs/rules/curly) is turned on as an error. You can also use the numeric equivalent for the rule severity: +In this example, [`eqeqeq`](../../rules/eqeqeq) is turned off and [`curly`](../../rules/curly) is turned on as an error. You can also use the numeric equivalent for the rule severity: ```js /* eslint eqeqeq: 0, curly: 2 */ @@ -43,7 +43,7 @@ If a rule has additional options, you can specify them using array literal synta /* eslint quotes: ["error", "double"], curly: 2 */ ``` -This comment specifies the "double" option for the [`quotes`](https://eslint.org/docs/rules/quotes) rule. The first item in the array is always the rule severity (number or string). +This comment specifies the "double" option for the [`quotes`](../../rules/quotes) rule. The first item in the array is always the rule severity (number or string). Configuration comments can include descriptions to explain why the comment is necessary. The description must occur after the configuration and is separated from the configuration by two or more consecutive `-` characters. For example: @@ -221,10 +221,10 @@ alert('foo'); /* eslint-disable-line no-alert, quotes, semi */ /* eslint-disable-next-line no-alert, quotes, semi */ alert('foo'); -/* eslint-disable-next-line - no-alert, - quotes, - semi +/* eslint-disable-next-line + no-alert, + quotes, + semi */ alert('foo'); ``` @@ -280,7 +280,7 @@ To disable all inline config comments, use the `noInlineConfig` setting. For exa } ``` -This setting is similar to [--no-inline-config](https://eslint.org/docs/user-guide/command-line-interface#--no-inline-config) CLI option. +This setting is similar to [--no-inline-config](../command-line-interface#--no-inline-config) CLI option. #### Report unused `eslint-disable` comments @@ -293,4 +293,4 @@ To report unused `eslint-disable` comments, use the `reportUnusedDisableDirectiv } ``` -This setting is similar to [--report-unused-disable-directives](https://eslint.org/docs/user-guide/command-line-interface#--report-unused-disable-directives) CLI option, but doesn't fail linting (reports as `"warn"` severity). +This setting is similar to [--report-unused-disable-directives](../command-line-interface#--report-unused-disable-directives) CLI option, but doesn't fail linting (reports as `"warn"` severity).