Skip to content

docs: remove outdated info about environments #19296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs/src/rules/no-global-assign.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ This rule disallows modifications to read-only global variables.

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

* [Specifying Environments](../use/configure#specifying-environments)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linked docs no longer mentions environments.

* [Specifying Globals](../use/configure#specifying-globals)
See also: [Specifying Globals](../use/configure#specifying-globals)

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

Expand Down
7 changes: 2 additions & 5 deletions docs/src/rules/no-implicit-globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,9 @@ Bar.prototype.baz = function () {

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

A read-only global variable can be a built-in ES global (e.g. `Array`), an environment specific global
(e.g. `window` in the browser environment), or a global variable defined as `readonly` in the configuration file
or in a `/*global */` comment.
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.

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

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

Expand Down
3 changes: 1 addition & 2 deletions docs/src/rules/no-native-reassign.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ This rule disallows modifications to read-only global variables.

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/src/rules/no-restricted-globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ related_rules:


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

For instance, early Internet Explorer versions exposed the current DOM event as a global variable
`event`, but using this variable has been considered as a bad practice for a long time. Restricting
Expand Down
5 changes: 2 additions & 3 deletions docs/src/rules/no-unused-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ In environments outside of CommonJS or ECMAScript modules, you may use `var` to

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

* when the environment is `node` or `commonjs`
* when `parserOptions.sourceType` is `module`
* when `ecmaFeatures.globalReturn` is `true`
* when `languageOptions.sourceType` is `module` (default) or `commonjs`
* when `languageOptions.parserOptions.ecmaFeatures.globalReturn` is `true`

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

Expand Down
3 changes: 2 additions & 1 deletion docs/src/rules/strict.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ This rule has a string option:

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:

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

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.
Otherwise the `"safe"` option corresponds to the `"function"` option.

### global

Expand Down
2 changes: 1 addition & 1 deletion docs/src/use/configure/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Here are some of the options that you can configure in ESLint:

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/src/use/core-concepts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ For more information, refer to [Using a shareable configuration package](../conf

## Plugins

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).
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).

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.

Expand Down
Loading
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