Skip to content

Commit 5d64851

Browse files
authored
docs: remove outdated info about environments (#19296)
1 parent eec01f0 commit 5d64851

File tree

8 files changed

+11
-16
lines changed

8 files changed

+11
-16
lines changed

docs/src/rules/no-global-assign.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ This rule disallows modifications to read-only global variables.
2323

2424
ESLint has the capability to configure global variables as read-only.
2525

26-
* [Specifying Environments](../use/configure#specifying-environments)
27-
* [Specifying Globals](../use/configure#specifying-globals)
26+
See also: [Specifying Globals](../use/configure#specifying-globals)
2827

2928
Examples of **incorrect** code for this rule:
3029

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,9 @@ Bar.prototype.baz = function () {
118118

119119
This rule also disallows redeclarations of read-only global variables and assignments to read-only global variables.
120120

121-
A read-only global variable can be a built-in ES global (e.g. `Array`), an environment specific global
122-
(e.g. `window` in the browser environment), or a global variable defined as `readonly` in the configuration file
123-
or in a `/*global */` comment.
121+
A read-only global variable can be a built-in ES global (e.g. `Array`), or a global variable defined as `readonly` in the configuration file or in a `/*global */` comment.
124122

125-
* [Specifying Environments](../use/configure#specifying-environments)
126-
* [Specifying Globals](../use/configure#specifying-globals)
123+
See also: [Specifying Globals](../use/configure#specifying-globals)
127124

128125
Examples of **incorrect** code for this rule:
129126

docs/src/rules/no-native-reassign.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ This rule disallows modifications to read-only global variables.
2424

2525
ESLint has the capability to configure global variables as read-only.
2626

27-
* [Specifying Environments](../use/configure#specifying-environments)
28-
* [Specifying Globals](../use/configure#specifying-globals)
27+
See also: [Specifying Globals](../use/configure#specifying-globals)
2928

3029
Examples of **incorrect** code for this rule:
3130

docs/src/rules/no-restricted-globals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ related_rules:
88

99

1010
Disallowing usage of specific global variables can be useful if you want to allow a set of global
11-
variables by enabling an environment, but still want to disallow some of those.
11+
variables, but still want to disallow some of those.
1212

1313
For instance, early Internet Explorer versions exposed the current DOM event as a global variable
1414
`event`, but using this variable has been considered as a bad practice for a long time. Restricting

docs/src/rules/no-unused-vars.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,8 @@ In environments outside of CommonJS or ECMAScript modules, you may use `var` to
103103

104104
Note that `/* exported */` has no effect for any of the following:
105105

106-
* when the environment is `node` or `commonjs`
107-
* when `parserOptions.sourceType` is `module`
108-
* when `ecmaFeatures.globalReturn` is `true`
106+
* when `languageOptions.sourceType` is `module` (default) or `commonjs`
107+
* when `languageOptions.parserOptions.ecmaFeatures.globalReturn` is `true`
109108

110109
The line comment `// exported variableName` will not work as `exported` is not line-specific.
111110

docs/src/rules/strict.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ This rule has a string option:
7373

7474
The `"safe"` option corresponds to the `"global"` option if ESLint considers a file to be a **Node.js** or **CommonJS** module because the configuration specifies either of the following:
7575

76+
* `"sourceType": "commonjs"` in [language options](../use/configure/language-options#specifying-javascript-options)
7677
* `"globalReturn": true` property in the `ecmaFeatures` object of [parser options](../use/configure/language-options#specifying-parser-options)
7778

78-
Otherwise the `"safe"` option corresponds to the `"function"` option. Note that if `"globalReturn": false` is explicitly specified in the configuration, the `"safe"` option will correspond to the `"function"` option regardless of the specified environment.
79+
Otherwise the `"safe"` option corresponds to the `"function"` option.
7980

8081
### global
8182

docs/src/use/configure/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Here are some of the options that you can configure in ESLint:
1717

1818
* [**Globals**](./language-options#specifying-globals) - the additional global variables your script accesses during execution.
1919
* [**Rules**](rules) - which rules are enabled and at what error level.
20-
* [**Plugins**](plugins) - which third-party plugins define additional rules, environments, configs, etc. for ESLint to use.
20+
* [**Plugins**](plugins) - which third-party plugins define additional rules, languages, configs, etc. for ESLint to use.
2121

2222
All of these options give you fine-grained control over how ESLint treats your code.
2323

docs/src/use/core-concepts/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ For more information, refer to [Using a shareable configuration package](../conf
5656

5757
## Plugins
5858

59-
An ESLint plugin is an npm module that can contain a set of ESLint rules, configurations, processors, and environments. Often plugins include custom rules. Plugins can be used to enforce a style guide and support JavaScript extensions (like TypeScript), libraries (like React), and frameworks (Angular).
59+
An ESLint plugin is an npm module that can contain a set of ESLint rules, configurations, processors, and languages. Often plugins include custom rules. Plugins can be used to enforce a style guide and support JavaScript extensions (like TypeScript), libraries (like React), and frameworks (Angular).
6060

6161
A popular use case for plugins is to enforce best practices for a framework. For example, [@angular-eslint/eslint-plugin](https://www.npmjs.com/package/@angular-eslint/eslint-plugin) contains best practices for using the Angular framework.
6262

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy