diff --git a/_11ty/filters/index.js b/_11ty/filters/index.js index 01085d0cad..feaee08503 100644 --- a/_11ty/filters/index.js +++ b/_11ty/filters/index.js @@ -3,5 +3,6 @@ module.exports = { dateFormat: require("./date-format"), numberOfWords: require("./number-of-words"), - xmlEscape: require("./xml-escape") + xmlEscape: require("./xml-escape"), + regexMatch: require("./regex-match") }; diff --git a/_11ty/filters/regex-match.js b/_11ty/filters/regex-match.js new file mode 100644 index 0000000000..b2d9f8f5d4 --- /dev/null +++ b/_11ty/filters/regex-match.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function regexMatch(text, regex) { + return new RegExp(regex, "u").test(text); +}; diff --git a/_layouts/doc.liquid b/_layouts/doc.liquid index 8722792c3c..6decb91c89 100644 --- a/_layouts/doc.liquid +++ b/_layouts/doc.liquid @@ -16,6 +16,13 @@ {% include ad %} {% endif %} + + {% comment %}Versioned pages didn't have title in front matter{% endcomment %} + {% assign versioned = page.url | regexMatch: "\/docs/\d" %} + {% unless versioned %} +

{{ title }}

+ {% endunless %} + {{ content | replace: '

Examples of incorrect code', '

Examples of incorrect code' | replace: '

Example of incorrect code', '

Example of incorrect code' diff --git a/docs/about/index.md b/docs/about/index.md index 343746fbd8..5b3b359b45 100644 --- a/docs/about/index.md +++ b/docs/about/index.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/about/index.md --- - - -# About ESLint is an open source JavaScript linting utility originally created by Nicholas C. Zakas in June 2013. Code [linting][] is a type of static analysis that is frequently used to find problematic patterns or code that doesn't adhere to certain style guidelines. There are code linters for most programming languages, and compilers sometimes incorporate linting into the compilation process. diff --git a/docs/developer-guide/README.md b/docs/developer-guide/README.md index a5e6592786..ea1bc20bd8 100644 --- a/docs/developer-guide/README.md +++ b/docs/developer-guide/README.md @@ -1,4 +1,9 @@ -# Developer Guide +--- +title: Developer Guide +layout: doc +edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/README.md + +--- This guide is intended for those who wish to: @@ -14,31 +19,31 @@ In order to work with ESLint as a developer, it's recommended that: If that sounds like you, then continue reading to get started. -## Section 1: Get the [Source Code](source-code.md) +## Section 1: Get the [Source Code](source-code) Before you can get started, you'll need to get a copy of the ESLint source code. This section explains how to do that and a little about the source code structure. -## Section 2: Set up a [Development Environment](development-environment.md) +## Section 2: Set up a [Development Environment](development-environment) Developing for ESLint is a bit different than running it on the command line. This section shows you how to set up a development environment and get you ready to write code. -## Section 3: Run the [Unit Tests](unit-tests.md) +## Section 3: Run the [Unit Tests](unit-tests) There are a lot of unit tests included with ESLint to make sure that we're keeping on top of code quality. This section explains how to run the unit tests. -## Section 4: [Working with Rules](working-with-rules.md) +## Section 4: [Working with Rules](working-with-rules) You're finally ready to start working with rules. You may want to fix an existing rule or create a new one. This section explains how to do all of that. -## Section 5: [Working with Plugins](working-with-plugins.md) +## Section 5: [Working with Plugins](working-with-plugins) You've developed library-specific rules for ESLint and you want to share them with the community. You can publish an ESLint plugin on npm. -## Section 6: [Working with Custom Parsers](working-with-custom-parsers.md) +## Section 6: [Working with Custom Parsers](working-with-custom-parsers) If you aren't going to use the default parser of ESLint, this section explains about using custom parsers. -## Section 7: [Node.js API](nodejs-api.md) +## Section 7: [Node.js API](nodejs-api) If you're interested in writing a tool that uses ESLint, then you can use the Node.js API to get programmatic access to functionality. diff --git a/docs/developer-guide/architecture.md b/docs/developer-guide/architecture.md deleted file mode 100644 index d723ea2b6c..0000000000 --- a/docs/developer-guide/architecture.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: Architecture -layout: doc -edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/architecture.md - ---- - - -# Architecture - -

dependency graph
- -At a high level, there are a few key parts to ESLint: - -* `bin/eslint.js` - this is the file that actually gets executed with the command line utility. It's a dumb wrapper that does nothing more than bootstrap ESLint, passing the command line arguments to `cli`. This is intentionally small so as not to require heavy testing. -* `lib/api.js` - this is the entry point of `require("eslint")`. This file exposes an object that contains public classes `Linter`, `ESLint`, `RuleTester`, and `SourceCode`. -* `lib/cli.js` - this is the heart of the ESLint CLI. It takes an array of arguments and then uses `eslint` to execute the commands. By keeping this as a separate utility, it allows others to effectively call ESLint from within another Node.js program as if it were done on the command line. The main call is `cli.execute()`. This is also the part that does all the file reading, directory traversing, input, and output. -* `lib/cli-engine/` - this module is `CLIEngine` class that finds source code files and configuration files then does code verifying with the `Linter` class. This includes the loading logic of configuration files, parsers, plugins, and formatters. -* `lib/linter/` - this module is the core `Linter` class that does code verifying based on configuration options. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly. -* `lib/rule-tester/` - this module is `RuleTester` class that is a wrapper around Mocha so that rules can be unit tested. This class lets us write consistently formatted tests for each rule that is implemented and be confident that each of the rules work. The RuleTester interface was modeled after Mocha and works with Mocha's global testing methods. RuleTester can also be modified to work with other testing frameworks. -* `lib/source-code/` - this module is `SourceCode` class that is used to represent the parsed source code. It takes in source code and the Program node of the AST representing the code. -* `lib/rules/` - this contains built-in rules that verify source code. - -## The `cli` object - -The `cli` object is the API for the command line interface. Literally, the `bin/eslint.js` file simply passes arguments to the `cli` object and then sets `process.exitCode` to the returned exit code. - -The main method is `cli.execute()`, which accepts an array of strings that represent the command line options (as if `process.argv` were passed without the first two arguments). If you want to run ESLint from inside of another program and have it act like the CLI, then `cli` is the object to use. - -This object's responsibilities include: - -* Interpreting command line arguments -* Reading from the file system -* Outputting to the console -* Outputting to the filesystem -* Use a formatter -* Returning the correct exit code - -This object may not: - -* Call `process.exit()` directly -* Perform any asynchronous operations - -## The `CLIEngine` object - -The `CLIEngine` type represents the core functionality of the CLI except that it reads nothing from the command line and doesn't output anything by default. Instead, it accepts many (but not all) of the arguments that are passed into the CLI. It reads both configuration and source files as well as managing the environment that is passed into the `Linter` object. - -The main method of the `CLIEngine` is `executeOnFiles()`, which accepts an array of file and directory names to run the linter on. - -This object's responsibilities include: - -* Managing the execution environment for `Linter` -* Reading from the file system -* Reading configuration information from config files (including `.eslintrc` and `package.json`) - -This object may not: - -* Call `process.exit()` directly -* Perform any asynchronous operations -* Output to the console -* Use formatters - -## The `Linter` object - -The main method of the `Linter` object is `verify()` and accepts two arguments: the source text to verify and a configuration object (the baked configuration of the given configuration file plus command line options). The method first parses the given text with `espree` (or whatever the configured parser is) and retrieves the AST. The AST is produced with both line/column and range locations which are useful for reporting location of issues and retrieving the source text related to an AST node, respectively. - -Once the AST is available, `estraverse` is used to traverse the AST from top to bottom. At each node, the `Linter` object emits an event that has the same name as the node type (i.e., "Identifier", "WithStatement", etc.). On the way back up the subtree, an event is emitted with the AST type name and suffixed with ":exit", such as "Identifier:exit" - this allows rules to take action both on the way down and on the way up in the traversal. Each event is emitted with the appropriate AST node available. - -This object's responsibilities include: - -* Inspecting JavaScript code strings -* Creating an AST for the code -* Executing rules on the AST -* Reporting back the results of the execution - -This object may not: - -* Call `process.exit()` directly -* Perform any asynchronous operations -* Use Node.js-specific features -* Access the file system -* Call `console.log()` or any other similar method - -## Rules - -Individual rules are the most specialized part of the ESLint architecture. Rules can do very little, they are simply a set of instructions executed against an AST that is provided. They do get some context information passed in, but the primary responsibility of a rule is to inspect the AST and report warnings. - -These objects' responsibilities are: - -* Inspect the AST for specific patterns -* Reporting warnings when certain patterns are found - -These objects may not: - -* Call `process.exit()` directly -* Perform any asynchronous operations -* Use Node.js-specific features -* Access the file system -* Call `console.log()` or any other similar method diff --git a/docs/developer-guide/architecture/index.md b/docs/developer-guide/architecture/index.md index e23eae3bf2..b2ec2bc194 100644 --- a/docs/developer-guide/architecture/index.md +++ b/docs/developer-guide/architecture/index.md @@ -1,21 +1,17 @@ --- title: Architecture layout: doc -edit_link: https://github.com/eslint/eslint/edit/master/docs/developer-guide/architecture.md +edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/architecture/index.md --- - - -# Architecture
dependency graph
At a high level, there are a few key parts to ESLint: * `bin/eslint.js` - this is the file that actually gets executed with the command line utility. It's a dumb wrapper that does nothing more than bootstrap ESLint, passing the command line arguments to `cli`. This is intentionally small so as not to require heavy testing. -* `lib/api.js` - this is the entry point of `require("eslint")`. This file exposes an object that contains public classes `Linter`, `CLIEngine`, `RuleTester`, and `SourceCode`. +* `lib/api.js` - this is the entry point of `require("eslint")`. This file exposes an object that contains public classes `Linter`, `ESLint`, `RuleTester`, and `SourceCode`. * `lib/cli.js` - this is the heart of the ESLint CLI. It takes an array of arguments and then uses `eslint` to execute the commands. By keeping this as a separate utility, it allows others to effectively call ESLint from within another Node.js program as if it were done on the command line. The main call is `cli.execute()`. This is also the part that does all the file reading, directory traversing, input, and output. -* `lib/init/` - this module contains `--init` functionality that set up a configuration file for end users. * `lib/cli-engine/` - this module is `CLIEngine` class that finds source code files and configuration files then does code verifying with the `Linter` class. This includes the loading logic of configuration files, parsers, plugins, and formatters. * `lib/linter/` - this module is the core `Linter` class that does code verifying based on configuration options. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly. * `lib/rule-tester/` - this module is `RuleTester` class that is a wrapper around Mocha so that rules can be unit tested. This class lets us write consistently formatted tests for each rule that is implemented and be confident that each of the rules work. The RuleTester interface was modeled after Mocha and works with Mocha's global testing methods. RuleTester can also be modified to work with other testing frameworks. diff --git a/docs/developer-guide/code-conventions.md b/docs/developer-guide/code-conventions.md index a5ba510994..9b639c36cb 100644 --- a/docs/developer-guide/code-conventions.md +++ b/docs/developer-guide/code-conventions.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/code-conventions.md --- - - -# Code Conventions Code conventions for ESLint are determined by [eslint-config-eslint](https://www.npmjs.com/package/eslint-config-eslint). diff --git a/docs/developer-guide/code-path-analysis.md b/docs/developer-guide/code-path-analysis.md index 910492721c..68348f3e7a 100644 --- a/docs/developer-guide/code-path-analysis.md +++ b/docs/developer-guide/code-path-analysis.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/code-path-analysis.md --- - - -# Code Path Analysis Details ESLint's rules can use code paths. The code path is execution routes of programs. diff --git a/docs/developer-guide/code-path-analysis/README.md b/docs/developer-guide/code-path-analysis/README.md index 2b6fd7486f..6f48c80972 100644 --- a/docs/developer-guide/code-path-analysis/README.md +++ b/docs/developer-guide/code-path-analysis/README.md @@ -1 +1,8 @@ -[Code Path Analysis Details](../code-path-analysis.md) +--- +title: Code Path Analysis Details +layout: doc +edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/code-path-analysis/README.md + +--- + +[Code Path Analysis Details](../code-path-analysis) diff --git a/docs/developer-guide/code-path-analysis/index.md b/docs/developer-guide/code-path-analysis/index.md index 43af8b3039..6f48c80972 100644 --- a/docs/developer-guide/code-path-analysis/index.md +++ b/docs/developer-guide/code-path-analysis/index.md @@ -1,9 +1,8 @@ --- -title: Documentation +title: Code Path Analysis Details layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/code-path-analysis/README.md --- - [Code Path Analysis Details](../code-path-analysis) diff --git a/docs/developer-guide/contributing/README.md b/docs/developer-guide/contributing/README.md index 050953957e..84ef50e945 100644 --- a/docs/developer-guide/contributing/README.md +++ b/docs/developer-guide/contributing/README.md @@ -1,4 +1,9 @@ -# Contributing +--- +title: Contributing +layout: doc +edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/contributing/README.md + +--- One of the great things about open source projects is that anyone can contribute in any number of meaningful ways. ESLint couldn't exist without the help of the many contributors it's had since the project began, and we want you to feel like you can contribute and make a difference as well. @@ -12,15 +17,15 @@ ESLint welcomes contributions from everyone and adheres to the [OpenJS Foundatio Think you found a problem? We'd love to hear about it. This section explains how to submit a bug, the type of information we need to properly verify it, and the overall process. -## Proposing a [New Rule](new-rules.md) +## Proposing a [New Rule](new-rules) We get a lot of proposals for new rules in ESLint. This section explains how we determine which rules are accepted and what information you should provide to help us evaluate your proposal. -## Proposing a [Rule Change](rule-changes.md) +## Proposing a [Rule Change](rule-changes) Want to make a change to an existing rule? This section explains the process and how we evaluate such proposals. -## Requesting a [Change](changes.md) +## Requesting a [Change](changes) If you'd like to request a change other than a bug fix or new rule, this section explains that process. @@ -28,11 +33,11 @@ If you'd like to request a change other than a bug fix or new rule, this section To report a security vulnerability in ESLint, please use our [HackerOne program](https://hackerone.com/eslint). -## [Working on Issues](working-on-issues.md) +## [Working on Issues](working-on-issues) Have some extra time and want to contribute? This section talks about the process of working on issues. -## Submitting a [Pull Request](pull-requests.md) +## Submitting a [Pull Request](pull-requests) We're always looking for contributions from the community. This section explains the requirements for pull requests and the process of contributing code. diff --git a/docs/developer-guide/contributing/changes.md b/docs/developer-guide/contributing/changes.md index df23e290ce..b6059676e1 100644 --- a/docs/developer-guide/contributing/changes.md +++ b/docs/developer-guide/contributing/changes.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/contributing/changes.md --- - - -# Change Requests If you'd like to request a change to ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new/choose) on GitHub. Be sure to include the following information: diff --git a/docs/developer-guide/contributing/index.md b/docs/developer-guide/contributing/index.md index 7033ab8cb8..84ef50e945 100644 --- a/docs/developer-guide/contributing/index.md +++ b/docs/developer-guide/contributing/index.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/contributing/README.md --- - - -# Contributing One of the great things about open source projects is that anyone can contribute in any number of meaningful ways. ESLint couldn't exist without the help of the many contributors it's had since the project began, and we want you to feel like you can contribute and make a difference as well. diff --git a/docs/developer-guide/contributing/new-rules.md b/docs/developer-guide/contributing/new-rules.md index 9ddb746f79..9288618c98 100644 --- a/docs/developer-guide/contributing/new-rules.md +++ b/docs/developer-guide/contributing/new-rules.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/contributing/new-rules.md --- - - -# New Rules ESLint is all about rules. For most of the project's lifetime, we've had over 200 rules, and that list continues to grow. However, we can't just accept any proposed rule because all rules need to work cohesively together. As such, we have some guidelines around which rules can be part of the ESLint core and which are better off as custom rules and plugins. diff --git a/docs/developer-guide/contributing/pull-requests.md b/docs/developer-guide/contributing/pull-requests.md index f06bc992ad..8c9ede4d00 100644 --- a/docs/developer-guide/contributing/pull-requests.md +++ b/docs/developer-guide/contributing/pull-requests.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/contributing/pull-requests.md --- - - -# Pull Requests If you want to contribute to an ESLint repo, please use a GitHub pull request. This is the fastest way for us to evaluate your code and to merge it into the code base. Please don't file an issue with snippets of code. Doing so means that we need to manually merge the changes in and update any appropriate tests. That decreases the likelihood that your code is going to get included in a timely manner. Please use pull requests. diff --git a/docs/developer-guide/contributing/reporting-bugs.md b/docs/developer-guide/contributing/reporting-bugs.md index 240bc7e382..8d713c4600 100644 --- a/docs/developer-guide/contributing/reporting-bugs.md +++ b/docs/developer-guide/contributing/reporting-bugs.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/contributing/reporting-bugs.md --- - - -# 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. diff --git a/docs/developer-guide/contributing/rule-changes.md b/docs/developer-guide/contributing/rule-changes.md index 35df493a24..d6c07562e8 100644 --- a/docs/developer-guide/contributing/rule-changes.md +++ b/docs/developer-guide/contributing/rule-changes.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/contributing/rule-changes.md --- - - -# Rule Changes Occasionally, a core ESLint rule needs to be changed. This is not necessarily a bug, but rather, an enhancement that makes a rule more configurable. In those situations, we will consider making changes to rules. diff --git a/docs/developer-guide/contributing/working-on-issues.md b/docs/developer-guide/contributing/working-on-issues.md index 559f7475f8..0065db77c0 100644 --- a/docs/developer-guide/contributing/working-on-issues.md +++ b/docs/developer-guide/contributing/working-on-issues.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/contributing/working-on-issues.md --- - - -# Working on Issues Our public [issues tracker](https://github.com/eslint/eslint/issues) lists all of the things we plan on doing as well as suggestions from the community. Before starting to work on an issue, be sure you read through the rest of this page. diff --git a/docs/developer-guide/development-environment.md b/docs/developer-guide/development-environment.md index a80832c569..cd5f40febd 100644 --- a/docs/developer-guide/development-environment.md +++ b/docs/developer-guide/development-environment.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/development-environment.md --- - - -# Development Environment ESLint has a very lightweight development environment that makes updating code fast and easy. This is a step-by-step guide to setting up a local development environment that will let you contribute back to the project. diff --git a/docs/developer-guide/index.md b/docs/developer-guide/index.md index 98c4c347dd..ea1bc20bd8 100644 --- a/docs/developer-guide/index.md +++ b/docs/developer-guide/index.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/README.md --- - - -# Developer Guide This guide is intended for those who wish to: diff --git a/docs/developer-guide/nodejs-api.md b/docs/developer-guide/nodejs-api.md index 635337e887..8622326aa5 100644 --- a/docs/developer-guide/nodejs-api.md +++ b/docs/developer-guide/nodejs-api.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/nodejs-api.md --- - - -# Node.js API While ESLint is designed to be run on the command line, it's possible to use ESLint programmatically through the Node.js API. The purpose of the Node.js API is to allow plugin and tool authors to use the ESLint functionality directly, without going through the command line interface. diff --git a/docs/developer-guide/scope-manager-interface.md b/docs/developer-guide/scope-manager-interface.md index d054ef5d87..4a6dc3302b 100644 --- a/docs/developer-guide/scope-manager-interface.md +++ b/docs/developer-guide/scope-manager-interface.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/scope-manager-interface.md --- - - -# ScopeManager This document was written based on the implementation of [eslint-scope](https://github.com/eslint/eslint-scope), a fork of [escope](https://github.com/estools/escope), and deprecates some members ESLint is not using. diff --git a/docs/developer-guide/selectors.md b/docs/developer-guide/selectors.md index d4bcac01ac..1ee40c7d6c 100644 --- a/docs/developer-guide/selectors.md +++ b/docs/developer-guide/selectors.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/selectors.md --- - - -# Selectors Some rules and APIs allow the use of selectors to query an AST. This page is intended to: diff --git a/docs/developer-guide/shareable-configs.md b/docs/developer-guide/shareable-configs.md index 62b8efd06c..bdee9e10ca 100644 --- a/docs/developer-guide/shareable-configs.md +++ b/docs/developer-guide/shareable-configs.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/shareable-configs.md --- - - -# Shareable Configs The configuration that you have in your `.eslintrc` file is an important part of your project, and as such, you may want to share it with other projects or people. Shareable configs allow you to publish your configuration settings on [npm](https://www.npmjs.com/) and have others download and use it in their ESLint projects. diff --git a/docs/developer-guide/source-code.md b/docs/developer-guide/source-code.md index f959917e23..5ee58ffeb2 100644 --- a/docs/developer-guide/source-code.md +++ b/docs/developer-guide/source-code.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/source-code.md --- - - -# Source Code ESLint is hosted at [GitHub](https://github.com/eslint/eslint) and uses [Git](https://git-scm.com/) for source control. In order to obtain the source code, you must first install Git on your system. Instructions for installing and setting up Git can be found at [https://help.github.com/articles/set-up-git/](https://help.github.com/articles/set-up-git/). diff --git a/docs/developer-guide/unit-tests.md b/docs/developer-guide/unit-tests.md index 7e320a9b59..0d318495fb 100644 --- a/docs/developer-guide/unit-tests.md +++ b/docs/developer-guide/unit-tests.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/unit-tests.md --- - - -# Unit Tests Most parts of ESLint have unit tests associated with them. Unit tests are written using [Mocha](https://mochajs.org/) and are required when making contributions to ESLint. You'll find all of the unit tests in the `tests` directory. diff --git a/docs/developer-guide/working-with-custom-formatters.md b/docs/developer-guide/working-with-custom-formatters.md index 4a482650e7..d9fd89356c 100644 --- a/docs/developer-guide/working-with-custom-formatters.md +++ b/docs/developer-guide/working-with-custom-formatters.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/working-with-custom-formatters.md --- - - -# Working with Custom Formatters While ESLint has some built-in formatters available to format the linting results, it's also possible to create and distribute your own custom formatters. You can include custom formatters in your project directly or create an npm package to distribute them separately. diff --git a/docs/developer-guide/working-with-custom-parsers.md b/docs/developer-guide/working-with-custom-parsers.md index f6be657bb6..71a67eb0ed 100644 --- a/docs/developer-guide/working-with-custom-parsers.md +++ b/docs/developer-guide/working-with-custom-parsers.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/working-with-custom-parsers.md --- - - -# Working with Custom Parsers If you want to use your own parser and provide additional capabilities for your rules, you can specify your own custom parser. If a `parseForESLint` method is exposed on the parser, this method will be used to parse the code. Otherwise, the `parse` method will be used. Both methods should take in the source code as the first argument, and an optional configuration object as the second argument (provided as `parserOptions` in a config file). The `parse` method should simply return the AST. The `parseForESLint` method should return an object that contains the required property `ast` and optional properties `services`, `scopeManager`, and `visitorKeys`. diff --git a/docs/developer-guide/working-with-plugins.md b/docs/developer-guide/working-with-plugins.md index afb268c8a8..68519d28b4 100644 --- a/docs/developer-guide/working-with-plugins.md +++ b/docs/developer-guide/working-with-plugins.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/working-with-plugins.md --- - - -# Working with Plugins Each plugin is an npm module with a name in the format of `eslint-plugin-`, such as `eslint-plugin-jquery`. You can also use scoped packages in the format of `@/eslint-plugin-` such as `@jquery/eslint-plugin-jquery` or even `@/eslint-plugin` such as `@jquery/eslint-plugin`. diff --git a/docs/developer-guide/working-with-rules-deprecated.md b/docs/developer-guide/working-with-rules-deprecated.md index 30c13fedf1..a700780a85 100644 --- a/docs/developer-guide/working-with-rules-deprecated.md +++ b/docs/developer-guide/working-with-rules-deprecated.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/working-with-rules-deprecated.md --- - - -# Working with Rules (Deprecated) **Note:** This page covers the deprecated rule format for ESLint <= 2.13.1. [This is the most recent rule format](./working-with-rules). diff --git a/docs/developer-guide/working-with-rules.md b/docs/developer-guide/working-with-rules.md index 6d7550bde6..f1330ac129 100644 --- a/docs/developer-guide/working-with-rules.md +++ b/docs/developer-guide/working-with-rules.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/working-with-rules.md --- - - -# Working with Rules **Note:** This page covers the most recent rule format for ESLint >= 3.0.0. There is also a [deprecated rule format](./working-with-rules-deprecated). diff --git a/docs/index.md b/docs/index.md index 0bcfb2b10e..fa9f617f17 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,12 +1,8 @@ --- title: Documentation layout: doc -edit_link: https://github.com/eslint/eslint/edit/main/docs/src/index.md - +edit_link: https://github.com/eslint/eslint/edit/main/docs/src/pages/index.md --- - - -# Documentation Welcome to our documentation pages! What would you like to view? diff --git a/docs/maintainer-guide/README.md b/docs/maintainer-guide/README.md index 941ad55994..52ed8a9e5c 100644 --- a/docs/maintainer-guide/README.md +++ b/docs/maintainer-guide/README.md @@ -1,23 +1,28 @@ -# Maintainer Guide +--- +title: Maintainer Guide +layout: doc +edit_link: https://github.com/eslint/eslint/edit/main/docs/src/maintainer-guide/README.md + +--- This guide is intended for those who work as part of the ESLint project team. -## [Managing Issues](issues.md) +## [Managing Issues](issues) Describes how to deal with issues when they're opened, when interacting with users, and how to close them effectively. -## [Reviewing Pull Requests](pullrequests.md) +## [Reviewing Pull Requests](pullrequests) Describes how to review incoming pull requests. -## [Managing Releases](releases.md) +## [Managing Releases](releases) Describes how to do an ESLint project release. -## [Governance](governance.md) +## [Governance](governance) Describes the governance policy for ESLint, including the rights and privileges of individuals inside the project. -## [Working Groups](working-groups.md) +## [Working Groups](working-groups) Describes how working groups are created and how they function within the ESLint project. diff --git a/docs/maintainer-guide/governance.md b/docs/maintainer-guide/governance.md index c040d49ff0..5ce0c3fa57 100644 --- a/docs/maintainer-guide/governance.md +++ b/docs/maintainer-guide/governance.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/maintainer-guide/governance.md --- - - -# Governance ESLint is an open source project that depends on contributions from the community. Anyone may contribute to the project at any time by submitting code, participating in discussions, making suggestions, or any other contribution they see fit. This document describes how various types of contributors work within the ESLint project. diff --git a/docs/maintainer-guide/index.md b/docs/maintainer-guide/index.md index 9d7dce8e32..52ed8a9e5c 100644 --- a/docs/maintainer-guide/index.md +++ b/docs/maintainer-guide/index.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/maintainer-guide/README.md --- - - -# Maintainer Guide This guide is intended for those who work as part of the ESLint project team. diff --git a/docs/maintainer-guide/issues.md b/docs/maintainer-guide/issues.md index 2663346821..17d072cb27 100644 --- a/docs/maintainer-guide/issues.md +++ b/docs/maintainer-guide/issues.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/maintainer-guide/issues.md --- - - -# Managing Issues New issues are filed frequently, and how we respond to those issues directly affects the success of the project. Being part of the project team means helping to triage and address issues as they come in so the project can continue to run smoothly. diff --git a/docs/maintainer-guide/npm-2fa.md b/docs/maintainer-guide/npm-2fa.md deleted file mode 100644 index 23b5da5d3b..0000000000 --- a/docs/maintainer-guide/npm-2fa.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: npm two-factor authentication -layout: doc -edit_link: https://github.com/eslint/eslint/edit/master/docs/maintainer-guide/npm-2fa.md - ---- - - -# npm two-factor authentication - -The `eslint` npm account has two-factor authentication (2FA) enabled. The 2FA secret is distributed using a team on [Keybase](https://keybase.io). Anyone doing a release of a package from the Jenkins server needs to have access to the 2FA secret. - -If you're on ESLint's TSC, you should perform the following steps to obtain the 2FA secret: - -1. Download the [Keybase app](https://keybase.io/download) on a smartphone. -1. Open the app and create an account. -1. From the app, link your Keybase username with your GitHub username. (At the time of writing, the UI for this is to tap the face icon in the bottom-left of the app, then the profile picture in the top-right, then tap "Prove your GitHub" and follow the instructions.) -1. Mention your Keybase username in the team chatroom, and wait for someone to add you to the Keybase team. -1. Download an authenticator app like [Google Authenticator](https://support.google.com/accounts/answer/1066447) or [Authy](https://authy.com/), if you don't have one installed already. -1. In the Keybase app, navigate to the Keybase filesystem (at the time of writing, the UI for this is to tap the hamburger icon in the bottom-right, then tap "Files") and then navigate to `/team/eslint/auth`. - * If your authenticator app is downloaded on the same device as your Keybase app (this will usually be the case if you're using the Keybase mobile app), then open `npm_2fa_code.txt` and copy the contents to the clipboard. Open your authenticator app, and paste the contents as a new key (by selecting something like "Enter a provided key" or "Enter key manually"). - * If your authenticator app is downloaded on a *different* device from your Keybase app (e.g. if you're using a Keybase desktop app), then open `npm_2fa_code.png` and scan it as a QR code from your authenticator app. - -You should now be able to generate 6-digit 2FA codes for the `eslint` npm account using your authenticator app. diff --git a/docs/maintainer-guide/pullrequests.md b/docs/maintainer-guide/pullrequests.md index 514b029130..719c8dc013 100644 --- a/docs/maintainer-guide/pullrequests.md +++ b/docs/maintainer-guide/pullrequests.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/maintainer-guide/pullrequests.md --- - - -# Reviewing Pull Requests Pull requests are submitted frequently and represent our best opportunity to interact with the community. As such, it's important that pull requests are well-reviewed before being merged and that interactions on pull requests are positive. diff --git a/docs/maintainer-guide/releases.md b/docs/maintainer-guide/releases.md index 38f38fd063..5b8cdfbb4f 100644 --- a/docs/maintainer-guide/releases.md +++ b/docs/maintainer-guide/releases.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/maintainer-guide/releases.md --- - - -# Managing Releases Releases are when a project formally publishes a new version so the community can use it. There are two types of releases: diff --git a/docs/maintainer-guide/working-groups.md b/docs/maintainer-guide/working-groups.md index bf52411b34..1f6d43a675 100644 --- a/docs/maintainer-guide/working-groups.md +++ b/docs/maintainer-guide/working-groups.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/maintainer-guide/working-groups.md --- - - -# Working Groups The ESLint TSC may form working groups to focus on a specific area of the project. diff --git a/docs/rules/README.md b/docs/rules/README.md deleted file mode 100644 index 02dde724b6..0000000000 --- a/docs/rules/README.md +++ /dev/null @@ -1,287 +0,0 @@ -# Rules - -Rules in ESLint are grouped by category to help you understand their purpose. Each rule has emojis denoting: - -* (recommended) if the `"extends": "eslint:recommended"` property in a [configuration file](../user-guide/configuring#extending-configuration-files) enables the rule -* (fixable) if some problems reported by the rule are automatically fixable by the `--fix` [command line](../user-guide/command-line-interface#--fix) option -* (hasSuggestions) if some problems reported by the rule are manually fixable by editor [suggestions](../developer-guide/working-with-rules#providing-suggestions) - -## Possible Errors - -These rules relate to possible syntax or logic errors in JavaScript code: - -* [no-cond-assign](no-cond-assign.md): disallow assignment operators in conditional expressions (recommended) -* [no-console](no-console.md): disallow the use of `console` (recommended) -* [no-constant-condition](no-constant-condition.md): disallow constant expressions in conditions (recommended) -* [no-control-regex](no-control-regex.md): disallow control characters in regular expressions (recommended) -* [no-debugger](no-debugger.md): disallow the use of `debugger` (recommended) -* [no-dupe-args](no-dupe-args.md): disallow duplicate arguments in `function` definitions (recommended) -* [no-dupe-keys](no-dupe-keys.md): disallow duplicate keys in object literals (recommended) -* [no-duplicate-case](no-duplicate-case.md): disallow duplicate case labels (recommended) -* [no-empty](no-empty.md): disallow empty block statements (recommended) -* [no-empty-character-class](no-empty-character-class.md): disallow empty character classes in regular expressions (recommended) -* [no-ex-assign](no-ex-assign.md): disallow reassigning exceptions in `catch` clauses (recommended) -* [no-extra-boolean-cast](no-extra-boolean-cast.md): disallow unnecessary boolean casts (recommended) -* [no-extra-parens](no-extra-parens.md): disallow unnecessary parentheses -* [no-extra-semi](no-extra-semi.md): disallow unnecessary semicolons (recommended) (fixable) -* [no-func-assign](no-func-assign.md): disallow reassigning `function` declarations (recommended) -* [no-inner-declarations](no-inner-declarations.md): disallow `function` or `var` declarations in nested blocks (recommended) -* [no-invalid-regexp](no-invalid-regexp.md): disallow invalid regular expression strings in `RegExp` constructors (recommended) -* [no-irregular-whitespace](no-irregular-whitespace.md): disallow irregular whitespace outside of strings and comments (recommended) -* [no-negated-in-lhs](no-negated-in-lhs.md): disallow negating the left operand in `in` expressions (recommended) -* [no-obj-calls](no-obj-calls.md): disallow calling global object properties as functions (recommended) -* [no-prototype-builtins](no-prototype-builtins.md): Disallow use of `Object.prototypes` builtins directly -* [no-regex-spaces](no-regex-spaces.md): disallow multiple spaces in regular expression literals (recommended) -* [no-sparse-arrays](no-sparse-arrays.md): disallow sparse arrays (recommended) -* [no-unexpected-multiline](no-unexpected-multiline.md): disallow confusing multiline expressions (recommended) -* [no-unreachable](no-unreachable.md): disallow unreachable code after `return`, `throw`, `continue`, and `break` statements (recommended) -* [no-unsafe-finally](no-unsafe-finally.md): disallow control flow statements in `finally` blocks (recommended) -* [use-isnan](use-isnan.md): require calls to `isNaN()` when checking for `NaN` (recommended) -* [valid-jsdoc](valid-jsdoc.md): enforce valid JSDoc comments -* [valid-typeof](valid-typeof.md): enforce comparing `typeof` expressions against valid strings (recommended) - -## Best Practices - -These rules relate to better ways of doing things to help you avoid problems: - -* [accessor-pairs](accessor-pairs.md): enforce getter and setter pairs in objects -* [array-callback-return](array-callback-return.md): enforce `return` statements in callbacks of array methods -* [block-scoped-var](block-scoped-var.md): enforce the use of variables within the scope they are defined -* [complexity](complexity.md): enforce a maximum cyclomatic complexity allowed in a program -* [consistent-return](consistent-return.md): require `return` statements to either always or never specify values -* [curly](curly.md): enforce consistent brace style for all control statements -* [default-case](default-case.md): require `default` cases in `switch` statements -* [dot-location](dot-location.md): enforce consistent newlines before and after dots -* [dot-notation](dot-notation.md): enforce dot notation whenever possible -* [eqeqeq](eqeqeq.md): require the use of `===` and `!==` -* [guard-for-in](guard-for-in.md): require `for-in` loops to include an `if` statement -* [no-alert](no-alert.md): disallow the use of `alert`, `confirm`, and `prompt` -* [no-caller](no-caller.md): disallow the use of `arguments.caller` or `arguments.callee` -* [no-case-declarations](no-case-declarations.md): disallow lexical declarations in case clauses (recommended) -* [no-div-regex](no-div-regex.md): disallow division operators explicitly at the beginning of regular expressions -* [no-else-return](no-else-return.md): disallow `else` blocks after `return` statements in `if` statements -* [no-empty-function](no-empty-function.md): disallow empty functions -* [no-empty-pattern](no-empty-pattern.md): disallow empty destructuring patterns (recommended) -* [no-eq-null](no-eq-null.md): disallow `null` comparisons without type-checking operators -* [no-eval](no-eval.md): disallow the use of `eval()` -* [no-extend-native](no-extend-native.md): disallow extending native types -* [no-extra-bind](no-extra-bind.md): disallow unnecessary calls to `.bind()` -* [no-extra-label](no-extra-label.md): disallow unnecessary labels -* [no-fallthrough](no-fallthrough.md): disallow fallthrough of `case` statements (recommended) -* [no-floating-decimal](no-floating-decimal.md): disallow leading or trailing decimal points in numeric literals -* [no-implicit-coercion](no-implicit-coercion.md): disallow shorthand type conversions -* [no-implicit-globals](no-implicit-globals.md): disallow `var` and named `function` declarations in the global scope -* [no-implied-eval](no-implied-eval.md): disallow the use of `eval()`-like methods -* [no-invalid-this](no-invalid-this.md): disallow `this` keywords outside of classes or class-like objects -* [no-iterator](no-iterator.md): disallow the use of the `__iterator__` property -* [no-labels](no-labels.md): disallow labeled statements -* [no-lone-blocks](no-lone-blocks.md): disallow unnecessary nested blocks -* [no-loop-func](no-loop-func.md): disallow `function` declarations and expressions inside loop statements -* [no-magic-numbers](no-magic-numbers.md): disallow magic numbers -* [no-multi-spaces](no-multi-spaces.md): disallow multiple spaces (fixable) -* [no-multi-str](no-multi-str.md): disallow multiline strings -* [no-native-reassign](no-native-reassign.md): disallow assignments to native objects or read-only global variables (recommended) -* [no-new](no-new.md): disallow `new` operators outside of assignments or comparisons -* [no-new-func](no-new-func.md): disallow `new` operators with the `Function` object -* [no-new-wrappers](no-new-wrappers.md): disallow `new` operators with the `String`, `Number`, and `Boolean` objects -* [no-octal](no-octal.md): disallow octal literals (recommended) -* [no-octal-escape](no-octal-escape.md): disallow octal escape sequences in string literals -* [no-param-reassign](no-param-reassign.md): disallow reassigning `function` parameters -* [no-proto](no-proto.md): disallow the use of the `__proto__` property -* [no-redeclare](no-redeclare.md): disallow `var` redeclaration (recommended) -* [no-return-assign](no-return-assign.md): disallow assignment operators in `return` statements -* [no-script-url](no-script-url.md): disallow `javascript:` urls -* [no-self-assign](no-self-assign.md): disallow assignments where both sides are exactly the same (recommended) -* [no-self-compare](no-self-compare.md): disallow comparisons where both sides are exactly the same -* [no-sequences](no-sequences.md): disallow comma operators -* [no-throw-literal](no-throw-literal.md): disallow throwing literals as exceptions -* [no-unmodified-loop-condition](no-unmodified-loop-condition.md): disallow unmodified loop conditions -* [no-unused-expressions](no-unused-expressions.md): disallow unused expressions -* [no-unused-labels](no-unused-labels.md): disallow unused labels (recommended) -* [no-useless-call](no-useless-call.md): disallow unnecessary calls to `.call()` and `.apply()` -* [no-useless-concat](no-useless-concat.md): disallow unnecessary concatenation of literals or template literals -* [no-useless-escape](no-useless-escape.md): disallow unnecessary escape characters -* [no-void](no-void.md): disallow `void` operators -* [no-warning-comments](no-warning-comments.md): disallow specified warning terms in comments -* [no-with](no-with.md): disallow `with` statements -* [radix](radix.md): enforce the consistent use of the radix argument when using `parseInt()` -* [vars-on-top](vars-on-top.md): require `var` declarations be placed at the top of their containing scope -* [wrap-iife](wrap-iife.md): require parentheses around immediate `function` invocations -* [yoda](yoda.md): require or disallow "Yoda" conditions - -## Strict Mode - -These rules relate to strict mode directives: - -* [strict](strict.md): require or disallow strict mode directives - -## Variables - -These rules relate to variable declarations: - -* [init-declarations](init-declarations.md): require or disallow initialization in `var` declarations -* [no-catch-shadow](no-catch-shadow.md): disallow `catch` clause parameters from shadowing variables in the outer scope -* [no-delete-var](no-delete-var.md): disallow deleting variables (recommended) -* [no-label-var](no-label-var.md): disallow labels that share a name with a variable -* [no-restricted-globals](no-restricted-globals.md): disallow specified global variables -* [no-shadow](no-shadow.md): disallow `var` declarations from shadowing variables in the outer scope -* [no-shadow-restricted-names](no-shadow-restricted-names.md): disallow identifiers from shadowing restricted names -* [no-undef](no-undef.md): disallow the use of undeclared variables unless mentioned in `/*global */` comments (recommended) -* [no-undef-init](no-undef-init.md): disallow initializing variables to `undefined` -* [no-undefined](no-undefined.md): disallow the use of `undefined` as an identifier -* [no-unused-vars](no-unused-vars.md): disallow unused variables (recommended) -* [no-use-before-define](no-use-before-define.md): disallow the use of variables before they are defined - -## Node.js and CommonJS - -These rules relate to code running in Node.js, or in browsers with CommonJS: - -* [callback-return](callback-return.md): require `return` statements after callbacks -* [global-require](global-require.md): require `require()` calls to be placed at top-level module scope -* [handle-callback-err](handle-callback-err.md): require error handling in callbacks -* [no-mixed-requires](no-mixed-requires.md): disallow `require` calls to be mixed with regular `var` declarations -* [no-new-require](no-new-require.md): disallow `new` operators with calls to `require` -* [no-path-concat](no-path-concat.md): disallow string concatenation with `__dirname` and `__filename` -* [no-process-env](no-process-env.md): disallow the use of `process.env` -* [no-process-exit](no-process-exit.md): disallow the use of `process.exit()` -* [no-restricted-modules](no-restricted-modules.md): disallow specified modules when loaded by `require` -* [no-sync](no-sync.md): disallow synchronous methods - -## Stylistic Issues - -These rules relate to style guidelines, and are therefore quite subjective: - -* [array-bracket-spacing](array-bracket-spacing.md): enforce consistent spacing inside array brackets (fixable) -* [block-spacing](block-spacing.md): enforce consistent spacing inside single-line blocks (fixable) -* [brace-style](brace-style.md): enforce consistent brace style for blocks -* [camelcase](camelcase.md): enforce camelcase naming convention -* [comma-dangle](comma-dangle.md): require or disallow trailing commas (fixable) -* [comma-spacing](comma-spacing.md): enforce consistent spacing before and after commas (fixable) -* [comma-style](comma-style.md): enforce consistent comma style -* [computed-property-spacing](computed-property-spacing.md): enforce consistent spacing inside computed property brackets (fixable) -* [consistent-this](consistent-this.md): enforce consistent naming when capturing the current execution context -* [eol-last](eol-last.md): enforce at least one newline at the end of files (fixable) -* [func-names](func-names.md): require or disallow named `function` expressions -* [func-style](func-style.md): enforce the consistent use of either `function` declarations or expressions -* [id-blacklist](id-blacklist.md): disallow specified identifiers -* [id-length](id-length.md): enforce minimum and maximum identifier lengths -* [id-match](id-match.md): require identifiers to match a specified regular expression -* [indent](indent.md): enforce consistent indentation (fixable) -* [jsx-quotes](jsx-quotes.md): enforce the consistent use of either double or single quotes in JSX attributes (fixable) -* [key-spacing](key-spacing.md): enforce consistent spacing between keys and values in object literal properties (fixable) -* [keyword-spacing](keyword-spacing.md): enforce consistent spacing before and after keywords (fixable) -* [linebreak-style](linebreak-style.md): enforce consistent linebreak style (fixable) -* [lines-around-comment](lines-around-comment.md): require empty lines around comments -* [max-depth](max-depth.md): enforce a maximum depth that blocks can be nested -* [max-len](max-len.md): enforce a maximum line length -* [max-lines](max-lines.md): enforce a maximum file length -* [max-nested-callbacks](max-nested-callbacks.md): enforce a maximum depth that callbacks can be nested -* [max-params](max-params.md): enforce a maximum number of parameters in `function` definitions -* [max-statements](max-statements.md): enforce a maximum number of statements allowed in `function` blocks -* [max-statements-per-line](max-statements-per-line.md): enforce a maximum number of statements allowed per line -* [multiline-ternary](multiline-ternary.md): enforce newlines between operands of ternary expressions -* [new-cap](new-cap.md): require constructor `function` names to begin with a capital letter -* [new-parens](new-parens.md): require parentheses when invoking a constructor with no arguments -* [newline-after-var](newline-after-var.md): require or disallow an empty line after `var` declarations -* [newline-before-return](newline-before-return.md): require an empty line before `return` statements -* [newline-per-chained-call](newline-per-chained-call.md): require a newline after each call in a method chain -* [no-array-constructor](no-array-constructor.md): disallow `Array` constructors -* [no-bitwise](no-bitwise.md): disallow bitwise operators -* [no-continue](no-continue.md): disallow `continue` statements -* [no-inline-comments](no-inline-comments.md): disallow inline comments after code -* [no-lonely-if](no-lonely-if.md): disallow `if` statements as the only statement in `else` blocks -* [no-mixed-operators](no-mixed-operators.md): disallow mixes of different operators -* [no-mixed-spaces-and-tabs](no-mixed-spaces-and-tabs.md): disallow mixed spaces and tabs for indentation (recommended) -* [no-multiple-empty-lines](no-multiple-empty-lines.md): disallow multiple empty lines (fixable) -* [no-negated-condition](no-negated-condition.md): disallow negated conditions -* [no-nested-ternary](no-nested-ternary.md): disallow nested ternary expressions -* [no-new-object](no-new-object.md): disallow `Object` constructors -* [no-plusplus](no-plusplus.md): disallow the unary operators `++` and `--` -* [no-restricted-syntax](no-restricted-syntax.md): disallow specified syntax -* [no-spaced-func](no-spaced-func.md): disallow spacing between `function` identifiers and their applications (fixable) -* [no-ternary](no-ternary.md): disallow ternary operators -* [no-trailing-spaces](no-trailing-spaces.md): disallow trailing whitespace at the end of lines (fixable) -* [no-underscore-dangle](no-underscore-dangle.md): disallow dangling underscores in identifiers -* [no-unneeded-ternary](no-unneeded-ternary.md): disallow ternary operators when simpler alternatives exist -* [no-whitespace-before-property](no-whitespace-before-property.md): disallow whitespace before properties (fixable) -* [object-curly-newline](object-curly-newline.md): enforce consistent line breaks inside braces (fixable) -* [object-curly-spacing](object-curly-spacing.md): enforce consistent spacing inside braces (fixable) -* [object-property-newline](object-property-newline.md): enforce placing object properties on separate lines -* [one-var](one-var.md): enforce variables to be declared either together or separately in functions -* [one-var-declaration-per-line](one-var-declaration-per-line.md): require or disallow newlines around `var` declarations -* [operator-assignment](operator-assignment.md): require or disallow assignment operator shorthand where possible -* [operator-linebreak](operator-linebreak.md): enforce consistent linebreak style for operators -* [padded-blocks](padded-blocks.md): require or disallow padding within blocks (fixable) -* [quote-props](quote-props.md): require quotes around object literal property names -* [quotes](quotes.md): enforce the consistent use of either backticks, double, or single quotes (fixable) -* [require-jsdoc](require-jsdoc.md): require JSDoc comments -* [semi](semi.md): require or disallow semicolons instead of ASI (fixable) -* [semi-spacing](semi-spacing.md): enforce consistent spacing before and after semicolons (fixable) -* [sort-vars](sort-vars.md): require variables within the same declaration block to be sorted -* [space-before-blocks](space-before-blocks.md): enforce consistent spacing before blocks (fixable) -* [space-before-function-paren](space-before-function-paren.md): enforce consistent spacing before `function` definition opening parenthesis (fixable) -* [space-in-parens](space-in-parens.md): enforce consistent spacing inside parentheses (fixable) -* [space-infix-ops](space-infix-ops.md): require spacing around operators (fixable) -* [space-unary-ops](space-unary-ops.md): enforce consistent spacing before or after unary operators (fixable) -* [spaced-comment](spaced-comment.md): enforce consistent spacing after the `//` or `/*` in a comment (fixable) -* [unicode-bom](unicode-bom.md): require or disallow the Unicode BOM (fixable) -* [wrap-regex](wrap-regex.md): require parenthesis around regex literals - -## ECMAScript 6 - -These rules relate to ES6, also known as ES2015: - -* [arrow-body-style](arrow-body-style.md): require braces around arrow function bodies -* [arrow-parens](arrow-parens.md): require parentheses around arrow function arguments (fixable) -* [arrow-spacing](arrow-spacing.md): enforce consistent spacing before and after the arrow in arrow functions (fixable) -* [constructor-super](constructor-super.md): require `super()` calls in constructors (recommended) -* [generator-star-spacing](generator-star-spacing.md): enforce consistent spacing around `*` operators in generator functions (fixable) -* [no-class-assign](no-class-assign.md): disallow reassigning class members (recommended) -* [no-confusing-arrow](no-confusing-arrow.md): disallow arrow functions where they could be confused with comparisons -* [no-const-assign](no-const-assign.md): disallow reassigning `const` variables (recommended) -* [no-dupe-class-members](no-dupe-class-members.md): disallow duplicate class members (recommended) -* [no-duplicate-imports](no-duplicate-imports.md): disallow duplicate module imports -* [no-new-symbol](no-new-symbol.md): disallow `new` operators with the `Symbol` object (recommended) -* [no-restricted-imports](no-restricted-imports.md): disallow specified modules when loaded by `import` -* [no-this-before-super](no-this-before-super.md): disallow `this`/`super` before calling `super()` in constructors (recommended) -* [no-useless-computed-key](no-useless-computed-key.md): disallow unnecessary computed property keys in object literals -* [no-useless-constructor](no-useless-constructor.md): disallow unnecessary constructors -* [no-useless-rename](no-useless-rename.md): disallow renaming import, export, and destructured assignments to the same name (fixable) -* [no-var](no-var.md): require `let` or `const` instead of `var` (fixable) -* [object-shorthand](object-shorthand.md): require or disallow method and property shorthand syntax for object literals (fixable) -* [prefer-arrow-callback](prefer-arrow-callback.md): require arrow functions as callbacks -* [prefer-const](prefer-const.md): require `const` declarations for variables that are never reassigned after declared (fixable) -* [prefer-reflect](prefer-reflect.md): require `Reflect` methods where applicable -* [prefer-rest-params](prefer-rest-params.md): require rest parameters instead of `arguments` -* [prefer-spread](prefer-spread.md): require spread operators instead of `.apply()` -* [prefer-template](prefer-template.md): require template literals instead of string concatenation -* [require-yield](require-yield.md): require generator functions to contain `yield` (recommended) -* [rest-spread-spacing](rest-spread-spacing.md): enforce spacing between rest and spread operators and their expressions (fixable) -* [sort-imports](sort-imports.md): enforce sorted import declarations within modules -* [template-curly-spacing](template-curly-spacing.md): require or disallow spacing around embedded expressions of template strings (fixable) -* [yield-star-spacing](yield-star-spacing.md): require or disallow spacing around the `*` in `yield*` expressions (fixable) - -## Removed - -These rules from older versions of ESLint have been replaced by newer rules: - -|Removed rule|Replaced by -|---|--- -|[generator-star](generator-star.md)|[generator-star-spacing](generator-star-spacing.md) -|[global-strict](global-strict.md)|[strict](strict.md) -|[no-arrow-condition](no-arrow-condition.md)|[no-confusing-arrow](no-confusing-arrow.md) and [no-constant-condition](no-constant-condition.md) -|[no-comma-dangle](no-comma-dangle.md)|[comma-dangle](comma-dangle.md) -|[no-empty-class](no-empty-class.md)|[no-empty-character-class](no-empty-character-class.md) -|[no-empty-label](no-empty-label.md)|[no-labels](no-labels.md) -|[no-extra-strict](no-extra-strict.md)|[strict](strict.md) -|[no-reserved-keys](no-reserved-keys.md)|[quote-props](quote-props.md) -|[no-space-before-semi](no-space-before-semi.md)|[semi-spacing](semi-spacing.md) -|[no-wrap-func](no-wrap-func.md)|[no-extra-parens](no-extra-parens.md) -|[space-after-function-name](space-after-function-name.md)|[space-before-function-paren](space-before-function-paren.md) -|[space-after-keywords](space-after-keywords.md)|[keyword-spacing](keyword-spacing.md) -|[space-before-function-parentheses](space-before-function-parentheses.md)|[space-before-function-paren](space-before-function-paren.md) -|[space-before-keywords](space-before-keywords.md)|[keyword-spacing](keyword-spacing.md) -|[space-in-brackets](space-in-brackets.md)|[object-curly-spacing](object-curly-spacing.md) and [array-bracket-spacing](array-bracket-spacing.md) -|[space-return-throw-case](space-return-throw-case.md)|[keyword-spacing](keyword-spacing.md) -|[space-unary-word-ops](space-unary-word-ops.md)|[space-unary-ops](space-unary-ops.md) -|[spaced-line-comment](spaced-line-comment.md)|[spaced-comment](spaced-comment.md) diff --git a/docs/rules/accessor-pairs.md b/docs/rules/accessor-pairs.md index 0ea27f0ccd..7578586db1 100644 --- a/docs/rules/accessor-pairs.md +++ b/docs/rules/accessor-pairs.md @@ -1,12 +1,9 @@ --- -title: accessor-pairs - Rules +title: accessor-pairs layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/accessor-pairs.md rule_type: suggestion --- - - -# accessor-pairs Enforces getter/setter pairs in objects and classes. diff --git a/docs/rules/array-bracket-newline.md b/docs/rules/array-bracket-newline.md index ccd49df93c..53966da6e1 100644 --- a/docs/rules/array-bracket-newline.md +++ b/docs/rules/array-bracket-newline.md @@ -1,12 +1,11 @@ --- -title: array-bracket-newline - Rules +title: array-bracket-newline layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/array-bracket-newline.md rule_type: layout --- - -# array-bracket-newline + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/array-bracket-spacing.md b/docs/rules/array-bracket-spacing.md index ce261a84df..89380a5804 100644 --- a/docs/rules/array-bracket-spacing.md +++ b/docs/rules/array-bracket-spacing.md @@ -1,12 +1,11 @@ --- -title: array-bracket-spacing - Rules +title: array-bracket-spacing layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/array-bracket-spacing.md rule_type: layout --- - -# array-bracket-spacing + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/array-callback-return.md b/docs/rules/array-callback-return.md index 521cc9f37a..7856c88c6c 100644 --- a/docs/rules/array-callback-return.md +++ b/docs/rules/array-callback-return.md @@ -1,12 +1,9 @@ --- -title: array-callback-return - Rules +title: array-callback-return layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/array-callback-return.md rule_type: problem --- - - -# array-callback-return Enforces return statements in callbacks of array's methods. diff --git a/docs/rules/array-element-newline.md b/docs/rules/array-element-newline.md index 10b19964d4..bd44e33986 100644 --- a/docs/rules/array-element-newline.md +++ b/docs/rules/array-element-newline.md @@ -1,12 +1,11 @@ --- -title: array-element-newline - Rules +title: array-element-newline layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/array-element-newline.md rule_type: layout --- - -# array-element-newline + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/arrow-body-style.md b/docs/rules/arrow-body-style.md index ef5cd05ab8..a0e8decf28 100644 --- a/docs/rules/arrow-body-style.md +++ b/docs/rules/arrow-body-style.md @@ -1,12 +1,11 @@ --- -title: arrow-body-style - Rules +title: arrow-body-style layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/arrow-body-style.md rule_type: suggestion --- - -# arrow-body-style + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/arrow-parens.md b/docs/rules/arrow-parens.md index a4542f8b51..d00783989f 100644 --- a/docs/rules/arrow-parens.md +++ b/docs/rules/arrow-parens.md @@ -1,12 +1,11 @@ --- -title: arrow-parens - Rules +title: arrow-parens layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/arrow-parens.md rule_type: layout --- - -# arrow-parens + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/arrow-spacing.md b/docs/rules/arrow-spacing.md index ecbf1b6733..b5998b6b31 100644 --- a/docs/rules/arrow-spacing.md +++ b/docs/rules/arrow-spacing.md @@ -1,12 +1,11 @@ --- -title: arrow-spacing - Rules +title: arrow-spacing layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/arrow-spacing.md rule_type: layout --- - -# arrow-spacing + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/block-scoped-var.md b/docs/rules/block-scoped-var.md index 2de76189a6..f1d8ca59dd 100644 --- a/docs/rules/block-scoped-var.md +++ b/docs/rules/block-scoped-var.md @@ -1,12 +1,9 @@ --- -title: block-scoped-var - Rules +title: block-scoped-var layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/block-scoped-var.md rule_type: suggestion --- - - -# block-scoped-var Enforces treating `var` as block scoped. diff --git a/docs/rules/block-spacing.md b/docs/rules/block-spacing.md index 263fc9e02c..0ae5f178e5 100644 --- a/docs/rules/block-spacing.md +++ b/docs/rules/block-spacing.md @@ -1,12 +1,11 @@ --- -title: block-spacing - Rules +title: block-spacing layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/block-spacing.md rule_type: layout --- - -# block-spacing + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/brace-style.md b/docs/rules/brace-style.md index c2d38080d7..a30f7954d2 100644 --- a/docs/rules/brace-style.md +++ b/docs/rules/brace-style.md @@ -1,12 +1,11 @@ --- -title: brace-style - Rules +title: brace-style layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/brace-style.md rule_type: layout --- - -# brace-style + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/callback-return.md b/docs/rules/callback-return.md index 1698bf82e9..9996c41ceb 100644 --- a/docs/rules/callback-return.md +++ b/docs/rules/callback-return.md @@ -1,12 +1,9 @@ --- -title: callback-return - Rules +title: callback-return layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/callback-return.md rule_type: suggestion --- - - -# callback-return Enforces return after callback. diff --git a/docs/rules/camelcase.md b/docs/rules/camelcase.md index efb2f2b979..3ef3d129f4 100644 --- a/docs/rules/camelcase.md +++ b/docs/rules/camelcase.md @@ -1,12 +1,9 @@ --- -title: camelcase - Rules +title: camelcase layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/camelcase.md rule_type: suggestion --- - - -# camelcase Enforces camelcase naming convention. diff --git a/docs/rules/capitalized-comments.md b/docs/rules/capitalized-comments.md index 47a5df261d..809cb27a53 100644 --- a/docs/rules/capitalized-comments.md +++ b/docs/rules/capitalized-comments.md @@ -1,12 +1,11 @@ --- -title: capitalized-comments - Rules +title: capitalized-comments layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/capitalized-comments.md rule_type: suggestion --- - -# capitalized-comments + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/class-methods-use-this.md b/docs/rules/class-methods-use-this.md index 6a15d9e191..b314da6419 100644 --- a/docs/rules/class-methods-use-this.md +++ b/docs/rules/class-methods-use-this.md @@ -1,12 +1,9 @@ --- -title: class-methods-use-this - Rules +title: class-methods-use-this layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/class-methods-use-this.md rule_type: suggestion --- - - -# class-methods-use-this Enforces that class methods utilize `this`. diff --git a/docs/rules/comma-dangle.md b/docs/rules/comma-dangle.md index fad23350a4..cb69ef1949 100644 --- a/docs/rules/comma-dangle.md +++ b/docs/rules/comma-dangle.md @@ -1,12 +1,11 @@ --- -title: comma-dangle - Rules +title: comma-dangle layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/comma-dangle.md rule_type: layout --- - -# comma-dangle + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/comma-spacing.md b/docs/rules/comma-spacing.md index 16eee8c39a..d09a9b561d 100644 --- a/docs/rules/comma-spacing.md +++ b/docs/rules/comma-spacing.md @@ -1,12 +1,11 @@ --- -title: comma-spacing - Rules +title: comma-spacing layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/comma-spacing.md rule_type: layout --- - -# comma-spacing + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/comma-style.md b/docs/rules/comma-style.md index b803e3d24d..0e6dd17f44 100644 --- a/docs/rules/comma-style.md +++ b/docs/rules/comma-style.md @@ -1,12 +1,11 @@ --- -title: comma-style - Rules +title: comma-style layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/comma-style.md rule_type: layout --- - -# comma-style + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/complexity.md b/docs/rules/complexity.md index cf0e9448d8..f505f78d17 100644 --- a/docs/rules/complexity.md +++ b/docs/rules/complexity.md @@ -1,12 +1,9 @@ --- -title: complexity - Rules +title: complexity layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/complexity.md rule_type: suggestion --- - - -# complexity Enforces a maximum cyclomatic complexity. diff --git a/docs/rules/computed-property-spacing.md b/docs/rules/computed-property-spacing.md index 7e527c3360..29704419b3 100644 --- a/docs/rules/computed-property-spacing.md +++ b/docs/rules/computed-property-spacing.md @@ -1,12 +1,11 @@ --- -title: computed-property-spacing - Rules +title: computed-property-spacing layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/computed-property-spacing.md rule_type: layout --- - -# computed-property-spacing + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/consistent-return.md b/docs/rules/consistent-return.md index c1f7a9b25a..1a4294d821 100644 --- a/docs/rules/consistent-return.md +++ b/docs/rules/consistent-return.md @@ -1,12 +1,9 @@ --- -title: consistent-return - Rules +title: consistent-return layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/consistent-return.md rule_type: suggestion --- - - -# consistent-return Requires `return` statements to either always or never specify values. diff --git a/docs/rules/consistent-this.md b/docs/rules/consistent-this.md index 67a5e8e50d..31f1a23f4d 100644 --- a/docs/rules/consistent-this.md +++ b/docs/rules/consistent-this.md @@ -1,12 +1,9 @@ --- -title: consistent-this - Rules +title: consistent-this layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/consistent-this.md rule_type: suggestion --- - - -# consistent-this Enforces consistent naming when capturing the current execution context. diff --git a/docs/rules/constructor-super.md b/docs/rules/constructor-super.md index f416bb6f3c..59d5e23e77 100644 --- a/docs/rules/constructor-super.md +++ b/docs/rules/constructor-super.md @@ -1,12 +1,11 @@ --- -title: constructor-super - Rules +title: constructor-super layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/constructor-super.md rule_type: problem --- - -# constructor-super + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/curly.md b/docs/rules/curly.md index d330b3c14f..95f96322b6 100644 --- a/docs/rules/curly.md +++ b/docs/rules/curly.md @@ -1,12 +1,11 @@ --- -title: curly - Rules +title: curly layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/curly.md rule_type: suggestion --- - -# curly + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/default-case-last.md b/docs/rules/default-case-last.md index 3e9daa731f..b5386ba77c 100644 --- a/docs/rules/default-case-last.md +++ b/docs/rules/default-case-last.md @@ -1,12 +1,9 @@ --- -title: default-case-last - Rules +title: default-case-last layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/default-case-last.md rule_type: suggestion --- - - -# default-case-last Enforces default clauses in switch statements to be last. diff --git a/docs/rules/default-case.md b/docs/rules/default-case.md index 6a538755b7..3e350d2a16 100644 --- a/docs/rules/default-case.md +++ b/docs/rules/default-case.md @@ -1,12 +1,9 @@ --- -title: default-case - Rules +title: default-case layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/default-case.md rule_type: suggestion --- - - -# default-case Requires a `default` case in switch statements. @@ -79,7 +76,6 @@ switch (a) { break; } - switch (a) { case 1: /* code */ diff --git a/docs/rules/default-param-last.md b/docs/rules/default-param-last.md index 17cd2c12d9..1a5ca5c9b9 100644 --- a/docs/rules/default-param-last.md +++ b/docs/rules/default-param-last.md @@ -1,12 +1,9 @@ --- -title: default-param-last - Rules +title: default-param-last layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/default-param-last.md rule_type: suggestion --- - - -# default-param-last Enforces default parameters to be last. diff --git a/docs/rules/dot-location.md b/docs/rules/dot-location.md index eca9f00de1..9f34c39e47 100644 --- a/docs/rules/dot-location.md +++ b/docs/rules/dot-location.md @@ -1,12 +1,11 @@ --- -title: dot-location - Rules +title: dot-location layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/dot-location.md rule_type: layout --- - -# dot-location + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/dot-notation.md b/docs/rules/dot-notation.md index fdb355e807..91b983526f 100644 --- a/docs/rules/dot-notation.md +++ b/docs/rules/dot-notation.md @@ -1,12 +1,11 @@ --- -title: dot-notation - Rules +title: dot-notation layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/dot-notation.md rule_type: suggestion --- - -# dot-notation + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/eol-last.md b/docs/rules/eol-last.md index d5db47c3ba..68f5e91656 100644 --- a/docs/rules/eol-last.md +++ b/docs/rules/eol-last.md @@ -1,12 +1,11 @@ --- -title: eol-last - Rules +title: eol-last layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/eol-last.md rule_type: layout --- - -# eol-last + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/eqeqeq.md b/docs/rules/eqeqeq.md index 80b0d54ed9..7403d3b629 100644 --- a/docs/rules/eqeqeq.md +++ b/docs/rules/eqeqeq.md @@ -1,12 +1,11 @@ --- -title: eqeqeq - Rules +title: eqeqeq layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/eqeqeq.md rule_type: suggestion --- - -# eqeqeq + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/for-direction.md b/docs/rules/for-direction.md index aca4f71244..44a651fef1 100644 --- a/docs/rules/for-direction.md +++ b/docs/rules/for-direction.md @@ -1,12 +1,11 @@ --- -title: for-direction - Rules +title: for-direction layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/for-direction.md rule_type: problem --- - -# for-direction + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/func-call-spacing.md b/docs/rules/func-call-spacing.md index f57ce612ce..9a02f11585 100644 --- a/docs/rules/func-call-spacing.md +++ b/docs/rules/func-call-spacing.md @@ -1,12 +1,11 @@ --- -title: func-call-spacing - Rules +title: func-call-spacing layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/func-call-spacing.md rule_type: layout --- - -# func-call-spacing + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/func-name-matching.md b/docs/rules/func-name-matching.md index f9b619020f..3068496d15 100644 --- a/docs/rules/func-name-matching.md +++ b/docs/rules/func-name-matching.md @@ -1,12 +1,9 @@ --- -title: func-name-matching - Rules +title: func-name-matching layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/func-name-matching.md rule_type: suggestion --- - - -# func-name-matching Requires function names to match the name of the variable or property to which they are assigned. diff --git a/docs/rules/func-names.md b/docs/rules/func-names.md index bc59aa3c22..ab86818eec 100644 --- a/docs/rules/func-names.md +++ b/docs/rules/func-names.md @@ -1,12 +1,9 @@ --- -title: func-names - Rules +title: func-names layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/func-names.md rule_type: suggestion --- - - -# func-names Requires or disallows named `function` expressions. diff --git a/docs/rules/func-style.md b/docs/rules/func-style.md index a88df6ae26..723a0447e8 100644 --- a/docs/rules/func-style.md +++ b/docs/rules/func-style.md @@ -1,12 +1,9 @@ --- -title: func-style - Rules +title: func-style layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/func-style.md rule_type: suggestion --- - - -# func-style Enforces the consistent use of either `function` declarations or expressions. diff --git a/docs/rules/function-call-argument-newline.md b/docs/rules/function-call-argument-newline.md index 52d66200fa..9923a7f66d 100644 --- a/docs/rules/function-call-argument-newline.md +++ b/docs/rules/function-call-argument-newline.md @@ -1,12 +1,11 @@ --- -title: function-call-argument-newline - Rules +title: function-call-argument-newline layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/function-call-argument-newline.md rule_type: layout --- - -# function-call-argument-newline + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/function-paren-newline.md b/docs/rules/function-paren-newline.md index e33c4480e5..47454bffb2 100644 --- a/docs/rules/function-paren-newline.md +++ b/docs/rules/function-paren-newline.md @@ -1,12 +1,11 @@ --- -title: function-paren-newline - Rules +title: function-paren-newline layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/function-paren-newline.md rule_type: layout --- - -# function-paren-newline + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/generator-star-spacing.md b/docs/rules/generator-star-spacing.md index 4c7996005f..872272319a 100644 --- a/docs/rules/generator-star-spacing.md +++ b/docs/rules/generator-star-spacing.md @@ -1,12 +1,11 @@ --- -title: generator-star-spacing - Rules +title: generator-star-spacing layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/generator-star-spacing.md rule_type: layout --- - -# generator-star-spacing + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/generator-star.md b/docs/rules/generator-star.md index 32870027be..f394e45fe5 100644 --- a/docs/rules/generator-star.md +++ b/docs/rules/generator-star.md @@ -1,12 +1,8 @@ --- -title: generator-star - Rules +title: generator-star layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/generator-star.md - --- - - -# generator-star Enforces consistent spacing around the asterisk in generator functions. diff --git a/docs/rules/getter-return.md b/docs/rules/getter-return.md index 6706bc8ed1..2834e347f9 100644 --- a/docs/rules/getter-return.md +++ b/docs/rules/getter-return.md @@ -1,12 +1,11 @@ --- -title: getter-return - Rules +title: getter-return layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/getter-return.md rule_type: problem --- - -# getter-return + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/global-require.md b/docs/rules/global-require.md index 57c8528611..8224e80384 100644 --- a/docs/rules/global-require.md +++ b/docs/rules/global-require.md @@ -1,12 +1,9 @@ --- -title: global-require - Rules +title: global-require layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/global-require.md rule_type: suggestion --- - - -# global-require Enforces `require()` on the top-level module scope. diff --git a/docs/rules/global-strict.md b/docs/rules/global-strict.md index 9f5a1bdb3c..f66b26f45a 100644 --- a/docs/rules/global-strict.md +++ b/docs/rules/global-strict.md @@ -1,12 +1,9 @@ --- -title: global-strict - Rules +title: global-strict layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/global-strict.md --- - - -# global-strict Requires or disallows strict mode directives in the global scope. diff --git a/docs/rules/grouped-accessor-pairs.md b/docs/rules/grouped-accessor-pairs.md index 9214f37db4..af2b33ed91 100644 --- a/docs/rules/grouped-accessor-pairs.md +++ b/docs/rules/grouped-accessor-pairs.md @@ -1,12 +1,9 @@ --- -title: grouped-accessor-pairs - Rules +title: grouped-accessor-pairs layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/grouped-accessor-pairs.md rule_type: suggestion --- - - -# grouped-accessor-pairs Requires grouped accessor pairs in object literals and classes. diff --git a/docs/rules/guard-for-in.md b/docs/rules/guard-for-in.md index 77c9184be7..5daf1fee16 100644 --- a/docs/rules/guard-for-in.md +++ b/docs/rules/guard-for-in.md @@ -1,12 +1,9 @@ --- -title: guard-for-in - Rules +title: guard-for-in layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/guard-for-in.md rule_type: suggestion --- - - -# guard-for-in Requires `for in` loops to include an `if` statement. diff --git a/docs/rules/handle-callback-err.md b/docs/rules/handle-callback-err.md index 0d570ef134..536209bb15 100644 --- a/docs/rules/handle-callback-err.md +++ b/docs/rules/handle-callback-err.md @@ -1,12 +1,9 @@ --- -title: handle-callback-err - Rules +title: handle-callback-err layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/handle-callback-err.md rule_type: suggestion --- - - -# handle-callback-err Enforces callback error handling. diff --git a/docs/rules/id-blacklist.md b/docs/rules/id-blacklist.md index 91fc170a80..f810738c19 100644 --- a/docs/rules/id-blacklist.md +++ b/docs/rules/id-blacklist.md @@ -1,12 +1,9 @@ --- -title: id-blacklist - Rules +title: id-blacklist layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/id-blacklist.md rule_type: suggestion --- - - -# id-blacklist Disallows specified identifiers. diff --git a/docs/rules/id-denylist.md b/docs/rules/id-denylist.md index 65c4a0b029..61d28d2072 100644 --- a/docs/rules/id-denylist.md +++ b/docs/rules/id-denylist.md @@ -1,12 +1,9 @@ --- -title: id-denylist - Rules +title: id-denylist layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/id-denylist.md rule_type: suggestion --- - - -# id-denylist Disallows specified identifiers. diff --git a/docs/rules/id-length.md b/docs/rules/id-length.md index d2d4cecabe..8f8972af04 100644 --- a/docs/rules/id-length.md +++ b/docs/rules/id-length.md @@ -1,12 +1,9 @@ --- -title: id-length - Rules +title: id-length layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/id-length.md rule_type: suggestion --- - - -# id-length Enforces minimum and maximum identifier lengths. diff --git a/docs/rules/id-match.md b/docs/rules/id-match.md index d752a861ab..d701209f36 100644 --- a/docs/rules/id-match.md +++ b/docs/rules/id-match.md @@ -1,12 +1,9 @@ --- -title: id-match - Rules +title: id-match layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/id-match.md rule_type: suggestion --- - - -# id-match Requires identifiers to match a specified regular expression. diff --git a/docs/rules/implicit-arrow-linebreak.md b/docs/rules/implicit-arrow-linebreak.md index c924baf6dc..6c4a11e87e 100644 --- a/docs/rules/implicit-arrow-linebreak.md +++ b/docs/rules/implicit-arrow-linebreak.md @@ -1,12 +1,11 @@ --- -title: implicit-arrow-linebreak - Rules +title: implicit-arrow-linebreak layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/implicit-arrow-linebreak.md rule_type: layout --- - -# implicit-arrow-linebreak + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. @@ -90,7 +89,6 @@ Examples of **correct** code for this rule with the `"below"` option: ```js /* eslint implicit-arrow-linebreak: ["error", "below"] */ - (foo) => bar; diff --git a/docs/rules/indent-legacy.md b/docs/rules/indent-legacy.md index d4aa5b10a1..2bbc06747f 100644 --- a/docs/rules/indent-legacy.md +++ b/docs/rules/indent-legacy.md @@ -1,12 +1,11 @@ --- -title: indent-legacy - Rules +title: indent-legacy layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/indent-legacy.md rule_type: layout --- - -# indent-legacy + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. @@ -259,7 +258,6 @@ Examples of **incorrect** code for this rule with the options `2, { "outerIIFEBo })(); - if(y) { console.log('foo'); } @@ -278,7 +276,6 @@ function foo(x) { })(); - if(y) { console.log('foo'); } diff --git a/docs/rules/indent.md b/docs/rules/indent.md index 820e6468be..b8b4d519f5 100644 --- a/docs/rules/indent.md +++ b/docs/rules/indent.md @@ -1,12 +1,11 @@ --- -title: indent - Rules +title: indent layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/indent.md rule_type: layout --- - -# indent + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. @@ -329,7 +328,6 @@ Examples of **incorrect** code for this rule with the options `2, { "outerIIFEBo })(); - if (y) { console.log('foo'); } @@ -348,7 +346,6 @@ function foo(x) { })(); - if (y) { console.log('foo'); } diff --git a/docs/rules/index.liquid b/docs/rules/index.liquid index 9e4c1cf1cd..89146ac22f 100644 --- a/docs/rules/index.liquid +++ b/docs/rules/index.liquid @@ -1,9 +1,8 @@ --- -title: List of available rules +title: Rules layout: doc --- -

Rules

Rules in ESLint are grouped by type to help you understand their purpose. Each rule has emojis denoting:

(recommended) if the "extends": "eslint:recommended" property in a configuration file enables the rule

(fixable) if some problems reported by the rule are automatically fixable by the --fix command line option

diff --git a/docs/rules/init-declarations.md b/docs/rules/init-declarations.md index b609f50878..367915f4c2 100644 --- a/docs/rules/init-declarations.md +++ b/docs/rules/init-declarations.md @@ -1,12 +1,9 @@ --- -title: init-declarations - Rules +title: init-declarations layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/init-declarations.md rule_type: suggestion --- - - -# init-declarations Requires or disallows initialization in variable declarations. diff --git a/docs/rules/jsx-quotes.md b/docs/rules/jsx-quotes.md index 4c22c7bdd5..d62b904aea 100644 --- a/docs/rules/jsx-quotes.md +++ b/docs/rules/jsx-quotes.md @@ -1,12 +1,11 @@ --- -title: jsx-quotes - Rules +title: jsx-quotes layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/jsx-quotes.md rule_type: layout --- - -# jsx-quotes + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/key-spacing.md b/docs/rules/key-spacing.md index 026b32f40f..0f7e73c429 100644 --- a/docs/rules/key-spacing.md +++ b/docs/rules/key-spacing.md @@ -1,12 +1,11 @@ --- -title: key-spacing - Rules +title: key-spacing layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/key-spacing.md rule_type: layout --- - -# key-spacing + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/keyword-spacing.md b/docs/rules/keyword-spacing.md index 1258787347..f43057a285 100644 --- a/docs/rules/keyword-spacing.md +++ b/docs/rules/keyword-spacing.md @@ -1,12 +1,11 @@ --- -title: keyword-spacing - Rules +title: keyword-spacing layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/keyword-spacing.md rule_type: layout --- - -# keyword-spacing + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/line-comment-position.md b/docs/rules/line-comment-position.md index 08c41e970f..f690200d88 100644 --- a/docs/rules/line-comment-position.md +++ b/docs/rules/line-comment-position.md @@ -1,12 +1,9 @@ --- -title: line-comment-position - Rules +title: line-comment-position layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/line-comment-position.md rule_type: layout --- - - -# line-comment-position Enforces position of line comments. diff --git a/docs/rules/linebreak-style.md b/docs/rules/linebreak-style.md index 90faab5565..ee0aa3c30f 100644 --- a/docs/rules/linebreak-style.md +++ b/docs/rules/linebreak-style.md @@ -1,12 +1,11 @@ --- -title: linebreak-style - Rules +title: linebreak-style layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/linebreak-style.md rule_type: layout --- - -# linebreak-style + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/lines-around-comment.md b/docs/rules/lines-around-comment.md index 27bc2679ab..28b0dfed9b 100644 --- a/docs/rules/lines-around-comment.md +++ b/docs/rules/lines-around-comment.md @@ -1,12 +1,11 @@ --- -title: lines-around-comment - Rules +title: lines-around-comment layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/lines-around-comment.md rule_type: layout --- - -# lines-around-comment + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. @@ -539,7 +538,6 @@ foo(); /* eslint mentioned in this comment */, bar(); - /*eslint lines-around-comment: ["error", { "ignorePattern": "pragma" }] */ foo(); diff --git a/docs/rules/lines-around-directive.md b/docs/rules/lines-around-directive.md index 19a9709d4f..9e414b7d0f 100644 --- a/docs/rules/lines-around-directive.md +++ b/docs/rules/lines-around-directive.md @@ -1,12 +1,11 @@ --- -title: lines-around-directive - Rules +title: lines-around-directive layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/lines-around-directive.md rule_type: layout --- - -# lines-around-directive + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. @@ -137,7 +136,6 @@ Examples of **incorrect** code for this rule with the `"never"` option: var foo; - /* Top of file */ // comment @@ -146,7 +144,6 @@ var foo; var foo; - function foo() { "use strict"; "use asm"; @@ -154,7 +151,6 @@ function foo() { var bar; } - function foo() { // comment diff --git a/docs/rules/lines-between-class-members.md b/docs/rules/lines-between-class-members.md index 8d75d8eb43..cc953cc409 100644 --- a/docs/rules/lines-between-class-members.md +++ b/docs/rules/lines-between-class-members.md @@ -1,12 +1,11 @@ --- -title: lines-between-class-members - Rules +title: lines-between-class-members layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/lines-between-class-members.md rule_type: layout --- - -# lines-between-class-members + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/max-classes-per-file.md b/docs/rules/max-classes-per-file.md index 546da8331e..b1e2c727fc 100644 --- a/docs/rules/max-classes-per-file.md +++ b/docs/rules/max-classes-per-file.md @@ -1,12 +1,9 @@ --- -title: max-classes-per-file - Rules +title: max-classes-per-file layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/max-classes-per-file.md rule_type: suggestion --- - - -# max-classes-per-file Enforces a maximum number of classes per file. diff --git a/docs/rules/max-depth.md b/docs/rules/max-depth.md index f5b7fe0fbc..febbab8336 100644 --- a/docs/rules/max-depth.md +++ b/docs/rules/max-depth.md @@ -1,12 +1,9 @@ --- -title: max-depth - Rules +title: max-depth layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/max-depth.md rule_type: suggestion --- - - -# max-depth Enforces a maximum depth that blocks can be nested. diff --git a/docs/rules/max-len.md b/docs/rules/max-len.md index 11f3357540..4f9b503712 100644 --- a/docs/rules/max-len.md +++ b/docs/rules/max-len.md @@ -1,12 +1,9 @@ --- -title: max-len - Rules +title: max-len layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/max-len.md rule_type: layout --- - - -# max-len Enforces a maximum line length. diff --git a/docs/rules/max-lines-per-function.md b/docs/rules/max-lines-per-function.md index d6227d93ae..a70665f96e 100644 --- a/docs/rules/max-lines-per-function.md +++ b/docs/rules/max-lines-per-function.md @@ -1,12 +1,9 @@ --- -title: max-lines-per-function - Rules +title: max-lines-per-function layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/max-lines-per-function.md rule_type: suggestion --- - - -# max-lines-per-function Enforces a maximum function length. diff --git a/docs/rules/max-lines.md b/docs/rules/max-lines.md index a0afc9ff9d..ae5ff3e23a 100644 --- a/docs/rules/max-lines.md +++ b/docs/rules/max-lines.md @@ -1,12 +1,9 @@ --- -title: max-lines - Rules +title: max-lines layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/max-lines.md rule_type: suggestion --- - - -# max-lines Enforces a maximum file length. diff --git a/docs/rules/max-nested-callbacks.md b/docs/rules/max-nested-callbacks.md index 83e1be828c..8f149082da 100644 --- a/docs/rules/max-nested-callbacks.md +++ b/docs/rules/max-nested-callbacks.md @@ -1,12 +1,9 @@ --- -title: max-nested-callbacks - Rules +title: max-nested-callbacks layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/max-nested-callbacks.md rule_type: suggestion --- - - -# max-nested-callbacks Enforces a maximum depth that callbacks can be nested. diff --git a/docs/rules/max-params.md b/docs/rules/max-params.md index d4d9f77391..839bbe2afc 100644 --- a/docs/rules/max-params.md +++ b/docs/rules/max-params.md @@ -1,12 +1,9 @@ --- -title: max-params - Rules +title: max-params layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/max-params.md rule_type: suggestion --- - - -# max-params Enforces a maximum number of parameters in function definitions. diff --git a/docs/rules/max-statements-per-line.md b/docs/rules/max-statements-per-line.md index 0327a57215..ac719c2a75 100644 --- a/docs/rules/max-statements-per-line.md +++ b/docs/rules/max-statements-per-line.md @@ -1,12 +1,9 @@ --- -title: max-statements-per-line - Rules +title: max-statements-per-line layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/max-statements-per-line.md rule_type: layout --- - - -# max-statements-per-line Enforces a maximum number of statements allowed per line. diff --git a/docs/rules/max-statements.md b/docs/rules/max-statements.md index 584c38120f..34ee535c0e 100644 --- a/docs/rules/max-statements.md +++ b/docs/rules/max-statements.md @@ -1,12 +1,9 @@ --- -title: max-statements - Rules +title: max-statements layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/max-statements.md rule_type: suggestion --- - - -# max-statements Enforces a maximum number of statements allowed in function blocks. diff --git a/docs/rules/multiline-comment-style.md b/docs/rules/multiline-comment-style.md index f6443d4490..f342ce0629 100644 --- a/docs/rules/multiline-comment-style.md +++ b/docs/rules/multiline-comment-style.md @@ -1,12 +1,11 @@ --- -title: multiline-comment-style - Rules +title: multiline-comment-style layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/multiline-comment-style.md rule_type: suggestion --- - -# multiline-comment-style + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. @@ -127,7 +126,6 @@ Examples of **correct** code for this rule with the `"separate-lines"` option: // calls foo() foo(); - ``` ## When Not To Use It diff --git a/docs/rules/multiline-ternary.md b/docs/rules/multiline-ternary.md index ba9634bbaf..5a7f89be3b 100644 --- a/docs/rules/multiline-ternary.md +++ b/docs/rules/multiline-ternary.md @@ -1,12 +1,11 @@ --- -title: multiline-ternary - Rules +title: multiline-ternary layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/multiline-ternary.md rule_type: layout --- - -# multiline-ternary + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/new-cap.md b/docs/rules/new-cap.md index d3c802c6b8..050914f057 100644 --- a/docs/rules/new-cap.md +++ b/docs/rules/new-cap.md @@ -1,12 +1,9 @@ --- -title: new-cap - Rules +title: new-cap layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/new-cap.md rule_type: suggestion --- - - -# new-cap Requires constructor names to begin with a capital letter. diff --git a/docs/rules/new-parens.md b/docs/rules/new-parens.md index 8f0c042369..8dd1f2fbb7 100644 --- a/docs/rules/new-parens.md +++ b/docs/rules/new-parens.md @@ -1,12 +1,11 @@ --- -title: new-parens - Rules +title: new-parens layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/new-parens.md rule_type: layout --- - -# new-parens + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/newline-after-var.md b/docs/rules/newline-after-var.md index fdad8291cd..a57bb2a383 100644 --- a/docs/rules/newline-after-var.md +++ b/docs/rules/newline-after-var.md @@ -1,12 +1,11 @@ --- -title: newline-after-var - Rules +title: newline-after-var layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/newline-after-var.md rule_type: layout --- - -# newline-after-var + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/newline-before-return.md b/docs/rules/newline-before-return.md index 772badb415..6638b15d60 100644 --- a/docs/rules/newline-before-return.md +++ b/docs/rules/newline-before-return.md @@ -1,12 +1,11 @@ --- -title: newline-before-return - Rules +title: newline-before-return layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/newline-before-return.md rule_type: layout --- - -# newline-before-return + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/newline-per-chained-call.md b/docs/rules/newline-per-chained-call.md index a088133a0e..f6e06d6e09 100644 --- a/docs/rules/newline-per-chained-call.md +++ b/docs/rules/newline-per-chained-call.md @@ -1,12 +1,11 @@ --- -title: newline-per-chained-call - Rules +title: newline-per-chained-call layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/newline-per-chained-call.md rule_type: layout --- - -# newline-per-chained-call + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-alert.md b/docs/rules/no-alert.md index f6d3aeb634..5aafa16513 100644 --- a/docs/rules/no-alert.md +++ b/docs/rules/no-alert.md @@ -1,12 +1,9 @@ --- -title: no-alert - Rules +title: no-alert layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-alert.md rule_type: suggestion --- - - -# no-alert Disallows the use of `alert`, `confirm`, and `prompt`. diff --git a/docs/rules/no-array-constructor.md b/docs/rules/no-array-constructor.md index 6a688ad966..8c88f0ddac 100644 --- a/docs/rules/no-array-constructor.md +++ b/docs/rules/no-array-constructor.md @@ -1,12 +1,9 @@ --- -title: no-array-constructor - Rules +title: no-array-constructor layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-array-constructor.md rule_type: suggestion --- - - -# no-array-constructor Disallows `Array` constructors. diff --git a/docs/rules/no-arrow-condition.md b/docs/rules/no-arrow-condition.md index 978a4cf1ae..180241d39b 100644 --- a/docs/rules/no-arrow-condition.md +++ b/docs/rules/no-arrow-condition.md @@ -1,12 +1,9 @@ --- -title: no-arrow-condition - Rules +title: no-arrow-condition layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-arrow-condition.md --- - - -# no-arrow-condition Disallows arrow functions where test conditions are expected. diff --git a/docs/rules/no-async-promise-executor.md b/docs/rules/no-async-promise-executor.md index be45749f63..1a1ceb285d 100644 --- a/docs/rules/no-async-promise-executor.md +++ b/docs/rules/no-async-promise-executor.md @@ -1,12 +1,11 @@ --- -title: no-async-promise-executor - Rules +title: no-async-promise-executor layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-async-promise-executor.md rule_type: problem --- - -# no-async-promise-executor + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-await-in-loop.md b/docs/rules/no-await-in-loop.md index a3c76c07ab..3e9d7bcda3 100644 --- a/docs/rules/no-await-in-loop.md +++ b/docs/rules/no-await-in-loop.md @@ -1,12 +1,9 @@ --- -title: no-await-in-loop - Rules +title: no-await-in-loop layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-await-in-loop.md rule_type: problem --- - - -# no-await-in-loop Disallows `await` inside of loops. diff --git a/docs/rules/no-bitwise.md b/docs/rules/no-bitwise.md index 26ac062d2b..9d451acbcc 100644 --- a/docs/rules/no-bitwise.md +++ b/docs/rules/no-bitwise.md @@ -1,12 +1,9 @@ --- -title: no-bitwise - Rules +title: no-bitwise layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-bitwise.md rule_type: suggestion --- - - -# no-bitwise Disallows bitwise operators. diff --git a/docs/rules/no-buffer-constructor.md b/docs/rules/no-buffer-constructor.md index 6008046513..10563a32d1 100644 --- a/docs/rules/no-buffer-constructor.md +++ b/docs/rules/no-buffer-constructor.md @@ -1,12 +1,9 @@ --- -title: no-buffer-constructor - Rules +title: no-buffer-constructor layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-buffer-constructor.md rule_type: problem --- - - -# no-buffer-constructor Disallows use of the `Buffer()` constructor. diff --git a/docs/rules/no-caller.md b/docs/rules/no-caller.md index c03b013c97..dabee933d9 100644 --- a/docs/rules/no-caller.md +++ b/docs/rules/no-caller.md @@ -1,12 +1,9 @@ --- -title: no-caller - Rules +title: no-caller layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-caller.md rule_type: suggestion --- - - -# no-caller Disallows use of `caller`/`callee`. diff --git a/docs/rules/no-case-declarations.md b/docs/rules/no-case-declarations.md index ae8a97f6ec..04cef649d9 100644 --- a/docs/rules/no-case-declarations.md +++ b/docs/rules/no-case-declarations.md @@ -1,12 +1,11 @@ --- -title: no-case-declarations - Rules +title: no-case-declarations layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-case-declarations.md rule_type: suggestion --- - -# no-case-declarations + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-catch-shadow.md b/docs/rules/no-catch-shadow.md index ba8f18795f..6b27885c49 100644 --- a/docs/rules/no-catch-shadow.md +++ b/docs/rules/no-catch-shadow.md @@ -1,12 +1,9 @@ --- -title: no-catch-shadow - Rules +title: no-catch-shadow layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-catch-shadow.md rule_type: suggestion --- - - -# no-catch-shadow Disallows shadowing of variables inside of catch. diff --git a/docs/rules/no-class-assign.md b/docs/rules/no-class-assign.md index f7280dc1a1..464a3cd83d 100644 --- a/docs/rules/no-class-assign.md +++ b/docs/rules/no-class-assign.md @@ -1,12 +1,11 @@ --- -title: no-class-assign - Rules +title: no-class-assign layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-class-assign.md rule_type: problem --- - -# no-class-assign + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-comma-dangle.md b/docs/rules/no-comma-dangle.md index 9392aed322..62ea552464 100644 --- a/docs/rules/no-comma-dangle.md +++ b/docs/rules/no-comma-dangle.md @@ -1,12 +1,9 @@ --- -title: no-comma-dangle - Rules +title: no-comma-dangle layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-comma-dangle.md --- - - -# no-comma-dangle Disallows trailing commas in object and array literals. diff --git a/docs/rules/no-compare-neg-zero.md b/docs/rules/no-compare-neg-zero.md index 2c8319254d..f3d8012eb0 100644 --- a/docs/rules/no-compare-neg-zero.md +++ b/docs/rules/no-compare-neg-zero.md @@ -1,12 +1,11 @@ --- -title: no-compare-neg-zero - Rules +title: no-compare-neg-zero layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-compare-neg-zero.md rule_type: problem --- - -# no-compare-neg-zero + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-cond-assign.md b/docs/rules/no-cond-assign.md index 6946be82e4..44d030e6aa 100644 --- a/docs/rules/no-cond-assign.md +++ b/docs/rules/no-cond-assign.md @@ -1,12 +1,11 @@ --- -title: no-cond-assign - Rules +title: no-cond-assign layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-cond-assign.md rule_type: problem --- - -# no-cond-assign + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-confusing-arrow.md b/docs/rules/no-confusing-arrow.md index 39777a8af0..b5b9729c44 100644 --- a/docs/rules/no-confusing-arrow.md +++ b/docs/rules/no-confusing-arrow.md @@ -1,12 +1,11 @@ --- -title: no-confusing-arrow - Rules +title: no-confusing-arrow layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-confusing-arrow.md rule_type: suggestion --- - -# no-confusing-arrow + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-console.md b/docs/rules/no-console.md index 244433a53e..a7a0215d9a 100644 --- a/docs/rules/no-console.md +++ b/docs/rules/no-console.md @@ -1,12 +1,9 @@ --- -title: no-console - Rules +title: no-console layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-console.md rule_type: suggestion --- - - -# no-console Disallows the use of `console`. diff --git a/docs/rules/no-const-assign.md b/docs/rules/no-const-assign.md index b2eb797ce7..90bf28147b 100644 --- a/docs/rules/no-const-assign.md +++ b/docs/rules/no-const-assign.md @@ -1,12 +1,11 @@ --- -title: no-const-assign - Rules +title: no-const-assign layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-const-assign.md rule_type: problem --- - -# no-const-assign + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-constant-condition.md b/docs/rules/no-constant-condition.md index 9196e239b2..4105cb8aad 100644 --- a/docs/rules/no-constant-condition.md +++ b/docs/rules/no-constant-condition.md @@ -1,12 +1,11 @@ --- -title: no-constant-condition - Rules +title: no-constant-condition layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-constant-condition.md rule_type: problem --- - -# no-constant-condition + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-constructor-return.md b/docs/rules/no-constructor-return.md index 7b6aa6ddb8..5c44dc9856 100644 --- a/docs/rules/no-constructor-return.md +++ b/docs/rules/no-constructor-return.md @@ -1,12 +1,9 @@ --- -title: no-constructor-return - Rules +title: no-constructor-return layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-constructor-return.md rule_type: problem --- - - -# no-constructor-return Disallows returning values in constructor. diff --git a/docs/rules/no-continue.md b/docs/rules/no-continue.md index c0e4bd68f5..761f828b47 100644 --- a/docs/rules/no-continue.md +++ b/docs/rules/no-continue.md @@ -1,12 +1,9 @@ --- -title: no-continue - Rules +title: no-continue layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-continue.md rule_type: suggestion --- - - -# no-continue Disallows `continue` statements. diff --git a/docs/rules/no-control-regex.md b/docs/rules/no-control-regex.md index 1b9fcf2050..1c04178bea 100644 --- a/docs/rules/no-control-regex.md +++ b/docs/rules/no-control-regex.md @@ -1,12 +1,11 @@ --- -title: no-control-regex - Rules +title: no-control-regex layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-control-regex.md rule_type: problem --- - -# no-control-regex + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-debugger.md b/docs/rules/no-debugger.md index 9650d4a51c..55459b3b0c 100644 --- a/docs/rules/no-debugger.md +++ b/docs/rules/no-debugger.md @@ -1,12 +1,11 @@ --- -title: no-debugger - Rules +title: no-debugger layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-debugger.md rule_type: problem --- - -# no-debugger + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-delete-var.md b/docs/rules/no-delete-var.md index 05d245707f..a9f0fc599f 100644 --- a/docs/rules/no-delete-var.md +++ b/docs/rules/no-delete-var.md @@ -1,12 +1,11 @@ --- -title: no-delete-var - Rules +title: no-delete-var layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-delete-var.md rule_type: suggestion --- - -# no-delete-var + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-div-regex.md b/docs/rules/no-div-regex.md index d377926bea..c944e8444c 100644 --- a/docs/rules/no-div-regex.md +++ b/docs/rules/no-div-regex.md @@ -1,12 +1,11 @@ --- -title: no-div-regex - Rules +title: no-div-regex layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-div-regex.md rule_type: suggestion --- - -# no-div-regex + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-dupe-args.md b/docs/rules/no-dupe-args.md index 91bede2c56..4d9e919ee7 100644 --- a/docs/rules/no-dupe-args.md +++ b/docs/rules/no-dupe-args.md @@ -1,12 +1,11 @@ --- -title: no-dupe-args - Rules +title: no-dupe-args layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-dupe-args.md rule_type: problem --- - -# no-dupe-args + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-dupe-class-members.md b/docs/rules/no-dupe-class-members.md index ec3be14b40..2aebe139b5 100644 --- a/docs/rules/no-dupe-class-members.md +++ b/docs/rules/no-dupe-class-members.md @@ -1,12 +1,11 @@ --- -title: no-dupe-class-members - Rules +title: no-dupe-class-members layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-dupe-class-members.md rule_type: problem --- - -# no-dupe-class-members + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-dupe-else-if.md b/docs/rules/no-dupe-else-if.md index 0cac30e744..993904c321 100644 --- a/docs/rules/no-dupe-else-if.md +++ b/docs/rules/no-dupe-else-if.md @@ -1,12 +1,11 @@ --- -title: no-dupe-else-if - Rules +title: no-dupe-else-if layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-dupe-else-if.md rule_type: problem --- - -# no-dupe-else-if + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-dupe-keys.md b/docs/rules/no-dupe-keys.md index 3e9d2bf602..31dea7d47f 100644 --- a/docs/rules/no-dupe-keys.md +++ b/docs/rules/no-dupe-keys.md @@ -1,12 +1,11 @@ --- -title: no-dupe-keys - Rules +title: no-dupe-keys layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-dupe-keys.md rule_type: problem --- - -# no-dupe-keys + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-duplicate-case.md b/docs/rules/no-duplicate-case.md index ad4a28d5f9..501e880676 100644 --- a/docs/rules/no-duplicate-case.md +++ b/docs/rules/no-duplicate-case.md @@ -1,12 +1,11 @@ --- -title: no-duplicate-case - Rules +title: no-duplicate-case layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-duplicate-case.md rule_type: problem --- - -# no-duplicate-case + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-duplicate-imports.md b/docs/rules/no-duplicate-imports.md index c3a9933190..88773e3ad4 100644 --- a/docs/rules/no-duplicate-imports.md +++ b/docs/rules/no-duplicate-imports.md @@ -1,12 +1,9 @@ --- -title: no-duplicate-imports - Rules +title: no-duplicate-imports layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-duplicate-imports.md rule_type: problem --- - - -# no-duplicate-imports Disallows duplicate imports. diff --git a/docs/rules/no-else-return.md b/docs/rules/no-else-return.md index 05a6481885..01569e6590 100644 --- a/docs/rules/no-else-return.md +++ b/docs/rules/no-else-return.md @@ -1,12 +1,11 @@ --- -title: no-else-return - Rules +title: no-else-return layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-else-return.md rule_type: suggestion --- - -# no-else-return + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-empty-character-class.md b/docs/rules/no-empty-character-class.md index decd58baae..1b1d6e1be1 100644 --- a/docs/rules/no-empty-character-class.md +++ b/docs/rules/no-empty-character-class.md @@ -1,12 +1,11 @@ --- -title: no-empty-character-class - Rules +title: no-empty-character-class layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-empty-character-class.md rule_type: problem --- - -# no-empty-character-class + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-empty-class.md b/docs/rules/no-empty-class.md index 9d6f3a0a9c..78553ce6b5 100644 --- a/docs/rules/no-empty-class.md +++ b/docs/rules/no-empty-class.md @@ -1,12 +1,9 @@ --- -title: no-empty-class - Rules +title: no-empty-class layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-empty-class.md --- - - -# no-empty-class Disallows empty character classes in regular expressions. diff --git a/docs/rules/no-empty-function.md b/docs/rules/no-empty-function.md index 4bbace4227..f34e8e4c68 100644 --- a/docs/rules/no-empty-function.md +++ b/docs/rules/no-empty-function.md @@ -1,12 +1,9 @@ --- -title: no-empty-function - Rules +title: no-empty-function layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-empty-function.md rule_type: suggestion --- - - -# no-empty-function Disallows empty functions. diff --git a/docs/rules/no-empty-label.md b/docs/rules/no-empty-label.md index 60074b30f5..7db31b4c18 100644 --- a/docs/rules/no-empty-label.md +++ b/docs/rules/no-empty-label.md @@ -1,12 +1,9 @@ --- -title: no-empty-label - Rules +title: no-empty-label layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-empty-label.md --- - - -# no-empty-label Disallows labels for anything other than loops and switches. diff --git a/docs/rules/no-empty-pattern.md b/docs/rules/no-empty-pattern.md index d28a64de94..c1af9d99da 100644 --- a/docs/rules/no-empty-pattern.md +++ b/docs/rules/no-empty-pattern.md @@ -1,12 +1,11 @@ --- -title: no-empty-pattern - Rules +title: no-empty-pattern layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-empty-pattern.md rule_type: problem --- - -# no-empty-pattern + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-empty.md b/docs/rules/no-empty.md index f2ba44fcce..2a928a6edc 100644 --- a/docs/rules/no-empty.md +++ b/docs/rules/no-empty.md @@ -1,12 +1,11 @@ --- -title: no-empty - Rules +title: no-empty layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-empty.md rule_type: suggestion --- - -# no-empty + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-eq-null.md b/docs/rules/no-eq-null.md index 8cce89e4f7..1ae05be98f 100644 --- a/docs/rules/no-eq-null.md +++ b/docs/rules/no-eq-null.md @@ -1,12 +1,9 @@ --- -title: no-eq-null - Rules +title: no-eq-null layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-eq-null.md rule_type: suggestion --- - - -# no-eq-null Disallows `null` comparisons without type-checking operators, diff --git a/docs/rules/no-eval.md b/docs/rules/no-eval.md index 209d192b50..8efd9cc79a 100644 --- a/docs/rules/no-eval.md +++ b/docs/rules/no-eval.md @@ -1,12 +1,9 @@ --- -title: no-eval - Rules +title: no-eval layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-eval.md rule_type: suggestion --- - - -# no-eval Disallows eval(). diff --git a/docs/rules/no-ex-assign.md b/docs/rules/no-ex-assign.md index c7e21d1082..f3c8ad763f 100644 --- a/docs/rules/no-ex-assign.md +++ b/docs/rules/no-ex-assign.md @@ -1,12 +1,11 @@ --- -title: no-ex-assign - Rules +title: no-ex-assign layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-ex-assign.md rule_type: problem --- - -# no-ex-assign + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-extend-native.md b/docs/rules/no-extend-native.md index 2e60460be7..5159c3d66c 100644 --- a/docs/rules/no-extend-native.md +++ b/docs/rules/no-extend-native.md @@ -1,12 +1,9 @@ --- -title: no-extend-native - Rules +title: no-extend-native layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-extend-native.md rule_type: suggestion --- - - -# no-extend-native Disallows extending of native objects. diff --git a/docs/rules/no-extra-bind.md b/docs/rules/no-extra-bind.md index 9a0c31320a..9b5c6355a9 100644 --- a/docs/rules/no-extra-bind.md +++ b/docs/rules/no-extra-bind.md @@ -1,12 +1,11 @@ --- -title: no-extra-bind - Rules +title: no-extra-bind layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-extra-bind.md rule_type: suggestion --- - -# no-extra-bind + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-extra-boolean-cast.md b/docs/rules/no-extra-boolean-cast.md index 03f90a3193..5dc49dabda 100644 --- a/docs/rules/no-extra-boolean-cast.md +++ b/docs/rules/no-extra-boolean-cast.md @@ -1,15 +1,16 @@ --- -title: no-extra-boolean-cast - Rules +title: no-extra-boolean-cast layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-extra-boolean-cast.md rule_type: suggestion --- - -# no-extra-boolean-cast + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. + + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. Disallows unnecessary boolean casts. diff --git a/docs/rules/no-extra-label.md b/docs/rules/no-extra-label.md index e2098021f0..1467f1a9cf 100644 --- a/docs/rules/no-extra-label.md +++ b/docs/rules/no-extra-label.md @@ -1,12 +1,11 @@ --- -title: no-extra-label - Rules +title: no-extra-label layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-extra-label.md rule_type: suggestion --- - -# no-extra-label + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-extra-parens.md b/docs/rules/no-extra-parens.md index 7a6243f987..936e0a7a67 100644 --- a/docs/rules/no-extra-parens.md +++ b/docs/rules/no-extra-parens.md @@ -1,12 +1,11 @@ --- -title: no-extra-parens - Rules +title: no-extra-parens layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-extra-parens.md rule_type: layout --- - -# no-extra-parens + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-extra-semi.md b/docs/rules/no-extra-semi.md index c3f8b54790..e7e6b3aa71 100644 --- a/docs/rules/no-extra-semi.md +++ b/docs/rules/no-extra-semi.md @@ -1,15 +1,16 @@ --- -title: no-extra-semi - Rules +title: no-extra-semi layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-extra-semi.md rule_type: suggestion --- - -# no-extra-semi + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. + + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. Disallows unnecessary semicolons. diff --git a/docs/rules/no-extra-strict.md b/docs/rules/no-extra-strict.md index 63fca96a46..8d69efd025 100644 --- a/docs/rules/no-extra-strict.md +++ b/docs/rules/no-extra-strict.md @@ -1,12 +1,9 @@ --- -title: no-extra-strict - Rules +title: no-extra-strict layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-extra-strict.md --- - - -# no-extra-strict Disallows strict mode directives when already in strict mode. diff --git a/docs/rules/no-fallthrough.md b/docs/rules/no-fallthrough.md index 651a659c13..c82e88b603 100644 --- a/docs/rules/no-fallthrough.md +++ b/docs/rules/no-fallthrough.md @@ -1,12 +1,11 @@ --- -title: no-fallthrough - Rules +title: no-fallthrough layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-fallthrough.md rule_type: problem --- - -# no-fallthrough + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-floating-decimal.md b/docs/rules/no-floating-decimal.md index 209696554b..ef8d0040fe 100644 --- a/docs/rules/no-floating-decimal.md +++ b/docs/rules/no-floating-decimal.md @@ -1,12 +1,11 @@ --- -title: no-floating-decimal - Rules +title: no-floating-decimal layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-floating-decimal.md rule_type: suggestion --- - -# no-floating-decimal + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-func-assign.md b/docs/rules/no-func-assign.md index 932526f0fc..fbdaf835bb 100644 --- a/docs/rules/no-func-assign.md +++ b/docs/rules/no-func-assign.md @@ -1,12 +1,11 @@ --- -title: no-func-assign - Rules +title: no-func-assign layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-func-assign.md rule_type: problem --- - -# no-func-assign + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-global-assign.md b/docs/rules/no-global-assign.md index f454b0b7aa..2f8bc2aad0 100644 --- a/docs/rules/no-global-assign.md +++ b/docs/rules/no-global-assign.md @@ -1,12 +1,11 @@ --- -title: no-global-assign - Rules +title: no-global-assign layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-global-assign.md rule_type: suggestion --- - -# no-global-assign + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-implicit-coercion.md b/docs/rules/no-implicit-coercion.md index 224534dee8..72ae4374c6 100644 --- a/docs/rules/no-implicit-coercion.md +++ b/docs/rules/no-implicit-coercion.md @@ -1,12 +1,11 @@ --- -title: no-implicit-coercion - Rules +title: no-implicit-coercion layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-implicit-coercion.md rule_type: suggestion --- - -# no-implicit-coercion + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-implicit-globals.md b/docs/rules/no-implicit-globals.md index 11b3f0d95f..428568f1f8 100644 --- a/docs/rules/no-implicit-globals.md +++ b/docs/rules/no-implicit-globals.md @@ -1,12 +1,9 @@ --- -title: no-implicit-globals - Rules +title: no-implicit-globals layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-implicit-globals.md rule_type: suggestion --- - - -# no-implicit-globals Disallows declarations in the global scope. diff --git a/docs/rules/no-implied-eval.md b/docs/rules/no-implied-eval.md index 433e71f0b9..401f7966ad 100644 --- a/docs/rules/no-implied-eval.md +++ b/docs/rules/no-implied-eval.md @@ -1,12 +1,9 @@ --- -title: no-implied-eval - Rules +title: no-implied-eval layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-implied-eval.md rule_type: suggestion --- - - -# no-implied-eval Disallows the use of `eval()`-like methods. diff --git a/docs/rules/no-import-assign.md b/docs/rules/no-import-assign.md index 06feca76fe..5d0a60207a 100644 --- a/docs/rules/no-import-assign.md +++ b/docs/rules/no-import-assign.md @@ -1,12 +1,11 @@ --- -title: no-import-assign - Rules +title: no-import-assign layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-import-assign.md rule_type: problem --- - -# no-import-assign + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-inline-comments.md b/docs/rules/no-inline-comments.md index f722de789f..d7bb3f6b05 100644 --- a/docs/rules/no-inline-comments.md +++ b/docs/rules/no-inline-comments.md @@ -1,12 +1,9 @@ --- -title: no-inline-comments - Rules +title: no-inline-comments layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-inline-comments.md rule_type: suggestion --- - - -# no-inline-comments Disallows inline comments after code. diff --git a/docs/rules/no-inner-declarations.md b/docs/rules/no-inner-declarations.md index 84ed056820..e5e60e33dd 100644 --- a/docs/rules/no-inner-declarations.md +++ b/docs/rules/no-inner-declarations.md @@ -1,12 +1,11 @@ --- -title: no-inner-declarations - Rules +title: no-inner-declarations layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-inner-declarations.md rule_type: problem --- - -# no-inner-declarations + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-invalid-regexp.md b/docs/rules/no-invalid-regexp.md index d49a2dd243..53189d6bef 100644 --- a/docs/rules/no-invalid-regexp.md +++ b/docs/rules/no-invalid-regexp.md @@ -1,12 +1,11 @@ --- -title: no-invalid-regexp - Rules +title: no-invalid-regexp layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-invalid-regexp.md rule_type: problem --- - -# no-invalid-regexp + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-invalid-this.md b/docs/rules/no-invalid-this.md index 8d88a10396..6dd53ec7d2 100644 --- a/docs/rules/no-invalid-this.md +++ b/docs/rules/no-invalid-this.md @@ -1,12 +1,9 @@ --- -title: no-invalid-this - Rules +title: no-invalid-this layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-invalid-this.md rule_type: suggestion --- - - -# no-invalid-this Disallows use of `this` in contexts where the value of `this` is `undefined`. diff --git a/docs/rules/no-irregular-whitespace.md b/docs/rules/no-irregular-whitespace.md index 703e631535..45e0d56646 100644 --- a/docs/rules/no-irregular-whitespace.md +++ b/docs/rules/no-irregular-whitespace.md @@ -1,12 +1,11 @@ --- -title: no-irregular-whitespace - Rules +title: no-irregular-whitespace layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-irregular-whitespace.md rule_type: problem --- - -# no-irregular-whitespace + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-iterator.md b/docs/rules/no-iterator.md index 02693b6f75..0469253860 100644 --- a/docs/rules/no-iterator.md +++ b/docs/rules/no-iterator.md @@ -1,12 +1,9 @@ --- -title: no-iterator - Rules +title: no-iterator layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-iterator.md rule_type: suggestion --- - - -# no-iterator Disallows the use of the `__iterator__` property. diff --git a/docs/rules/no-label-var.md b/docs/rules/no-label-var.md index 82996d567c..ae8b10bc6d 100644 --- a/docs/rules/no-label-var.md +++ b/docs/rules/no-label-var.md @@ -1,12 +1,9 @@ --- -title: no-label-var - Rules +title: no-label-var layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-label-var.md rule_type: suggestion --- - - -# no-label-var Disallows labels that are variable names. diff --git a/docs/rules/no-labels.md b/docs/rules/no-labels.md index 2672b85e27..cb9853dcd5 100644 --- a/docs/rules/no-labels.md +++ b/docs/rules/no-labels.md @@ -1,12 +1,9 @@ --- -title: no-labels - Rules +title: no-labels layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-labels.md rule_type: suggestion --- - - -# no-labels Disallows labeled statements. diff --git a/docs/rules/no-lone-blocks.md b/docs/rules/no-lone-blocks.md index 28b9563c01..fec87decb3 100644 --- a/docs/rules/no-lone-blocks.md +++ b/docs/rules/no-lone-blocks.md @@ -1,12 +1,9 @@ --- -title: no-lone-blocks - Rules +title: no-lone-blocks layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-lone-blocks.md rule_type: suggestion --- - - -# no-lone-blocks Disallows unnecessary nested blocks. diff --git a/docs/rules/no-lonely-if.md b/docs/rules/no-lonely-if.md index dc6dcdec37..793c1775c2 100644 --- a/docs/rules/no-lonely-if.md +++ b/docs/rules/no-lonely-if.md @@ -1,12 +1,11 @@ --- -title: no-lonely-if - Rules +title: no-lonely-if layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-lonely-if.md rule_type: suggestion --- - -# no-lonely-if + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-loop-func.md b/docs/rules/no-loop-func.md index fb96c133b4..18b8441547 100644 --- a/docs/rules/no-loop-func.md +++ b/docs/rules/no-loop-func.md @@ -1,12 +1,9 @@ --- -title: no-loop-func - Rules +title: no-loop-func layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-loop-func.md rule_type: suggestion --- - - -# no-loop-func Disallows functions in loops. diff --git a/docs/rules/no-loss-of-precision.md b/docs/rules/no-loss-of-precision.md index db6f56724e..6ca95b736f 100644 --- a/docs/rules/no-loss-of-precision.md +++ b/docs/rules/no-loss-of-precision.md @@ -1,12 +1,11 @@ --- -title: no-loss-of-precision - Rules +title: no-loss-of-precision layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-loss-of-precision.md rule_type: problem --- - -# no-loss-of-precision + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-magic-numbers.md b/docs/rules/no-magic-numbers.md index f03c002f9c..c3bd96cccc 100644 --- a/docs/rules/no-magic-numbers.md +++ b/docs/rules/no-magic-numbers.md @@ -1,12 +1,9 @@ --- -title: no-magic-numbers - Rules +title: no-magic-numbers layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-magic-numbers.md rule_type: suggestion --- - - -# no-magic-numbers Disallows magic numbers. diff --git a/docs/rules/no-misleading-character-class.md b/docs/rules/no-misleading-character-class.md index 02ab4b7cc0..8fef99be3a 100644 --- a/docs/rules/no-misleading-character-class.md +++ b/docs/rules/no-misleading-character-class.md @@ -1,12 +1,11 @@ --- -title: no-misleading-character-class - Rules +title: no-misleading-character-class layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-misleading-character-class.md rule_type: problem --- - -# no-misleading-character-class + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-mixed-operators.md b/docs/rules/no-mixed-operators.md index ab5042f798..b773c62108 100644 --- a/docs/rules/no-mixed-operators.md +++ b/docs/rules/no-mixed-operators.md @@ -1,12 +1,9 @@ --- -title: no-mixed-operators - Rules +title: no-mixed-operators layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-mixed-operators.md rule_type: suggestion --- - - -# no-mixed-operators Disallows mixes of different operators. diff --git a/docs/rules/no-mixed-requires.md b/docs/rules/no-mixed-requires.md index 2441464da6..4a74b5c678 100644 --- a/docs/rules/no-mixed-requires.md +++ b/docs/rules/no-mixed-requires.md @@ -1,12 +1,9 @@ --- -title: no-mixed-requires - Rules +title: no-mixed-requires layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-mixed-requires.md rule_type: suggestion --- - - -# no-mixed-requires Disallows `require` calls to be mixed with regular variable declarations. diff --git a/docs/rules/no-mixed-spaces-and-tabs.md b/docs/rules/no-mixed-spaces-and-tabs.md index b1f9bdd45b..ef513bbc6b 100644 --- a/docs/rules/no-mixed-spaces-and-tabs.md +++ b/docs/rules/no-mixed-spaces-and-tabs.md @@ -1,12 +1,11 @@ --- -title: no-mixed-spaces-and-tabs - Rules +title: no-mixed-spaces-and-tabs layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-mixed-spaces-and-tabs.md rule_type: layout --- - -# no-mixed-spaces-and-tabs + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-multi-assign.md b/docs/rules/no-multi-assign.md index fc383f684e..95dfb78210 100644 --- a/docs/rules/no-multi-assign.md +++ b/docs/rules/no-multi-assign.md @@ -1,12 +1,9 @@ --- -title: no-multi-assign - Rules +title: no-multi-assign layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-multi-assign.md rule_type: suggestion --- - - -# no-multi-assign Disallows use of chained assignment expressions. diff --git a/docs/rules/no-multi-spaces.md b/docs/rules/no-multi-spaces.md index 8f8b5d577c..095ca3f636 100644 --- a/docs/rules/no-multi-spaces.md +++ b/docs/rules/no-multi-spaces.md @@ -1,12 +1,11 @@ --- -title: no-multi-spaces - Rules +title: no-multi-spaces layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-multi-spaces.md rule_type: layout --- - -# no-multi-spaces + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-multi-str.md b/docs/rules/no-multi-str.md index 3ee0b6206a..16969566bc 100644 --- a/docs/rules/no-multi-str.md +++ b/docs/rules/no-multi-str.md @@ -1,12 +1,9 @@ --- -title: no-multi-str - Rules +title: no-multi-str layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-multi-str.md rule_type: suggestion --- - - -# no-multi-str Disallows multiline strings. diff --git a/docs/rules/no-multiple-empty-lines.md b/docs/rules/no-multiple-empty-lines.md index 707aebd675..a5627cf633 100644 --- a/docs/rules/no-multiple-empty-lines.md +++ b/docs/rules/no-multiple-empty-lines.md @@ -1,12 +1,11 @@ --- -title: no-multiple-empty-lines - Rules +title: no-multiple-empty-lines layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-multiple-empty-lines.md rule_type: layout --- - -# no-multiple-empty-lines + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. @@ -36,7 +35,6 @@ Examples of **incorrect** code for this rule with the default `{ "max": 2 }` opt var foo = 5; - var bar = 3; ``` @@ -47,7 +45,6 @@ Examples of **correct** code for this rule with the default `{ "max": 2 }` optio var foo = 5; - var bar = 3; ``` @@ -60,10 +57,8 @@ Examples of **incorrect** code for this rule with the `{ max: 2, maxEOF: 0 }` op var foo = 5; - var bar = 3; - ``` Examples of **correct** code for this rule with the `{ max: 2, maxEOF: 0 }` options: @@ -73,7 +68,6 @@ Examples of **correct** code for this rule with the `{ max: 2, maxEOF: 0 }` opti var foo = 5; - var bar = 3; ``` @@ -111,10 +105,8 @@ Examples of **incorrect** code for this rule with the `{ max: 2, maxBOF: 1 }` op ```js /*eslint no-multiple-empty-lines: ["error", { "max": 2, "maxBOF": 1 }]*/ - var foo = 5; - var bar = 3; ``` @@ -125,7 +117,6 @@ Examples of **correct** code for this rule with the `{ max: 2, maxBOF: 1 }` opti var foo = 5; - var bar = 3; ``` diff --git a/docs/rules/no-native-reassign.md b/docs/rules/no-native-reassign.md index 7440d6bd0f..06e132e5b8 100644 --- a/docs/rules/no-native-reassign.md +++ b/docs/rules/no-native-reassign.md @@ -1,12 +1,9 @@ --- -title: no-native-reassign - Rules +title: no-native-reassign layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-native-reassign.md rule_type: suggestion --- - - -# no-native-reassign Disallows reassignment of native objects. diff --git a/docs/rules/no-negated-condition.md b/docs/rules/no-negated-condition.md index 0ff9841d9c..bd91a66ea1 100644 --- a/docs/rules/no-negated-condition.md +++ b/docs/rules/no-negated-condition.md @@ -1,12 +1,9 @@ --- -title: no-negated-condition - Rules +title: no-negated-condition layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-negated-condition.md rule_type: suggestion --- - - -# no-negated-condition Disallows negated conditions. diff --git a/docs/rules/no-negated-in-lhs.md b/docs/rules/no-negated-in-lhs.md index fe044c07e3..7eff7c112a 100644 --- a/docs/rules/no-negated-in-lhs.md +++ b/docs/rules/no-negated-in-lhs.md @@ -1,12 +1,9 @@ --- -title: no-negated-in-lhs - Rules +title: no-negated-in-lhs layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-negated-in-lhs.md rule_type: problem --- - - -# no-negated-in-lhs Disallows negating the left operand in `in` expressions. diff --git a/docs/rules/no-nested-ternary.md b/docs/rules/no-nested-ternary.md index 1ba2c7d56c..ac59726198 100644 --- a/docs/rules/no-nested-ternary.md +++ b/docs/rules/no-nested-ternary.md @@ -1,12 +1,9 @@ --- -title: no-nested-ternary - Rules +title: no-nested-ternary layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-nested-ternary.md rule_type: suggestion --- - - -# no-nested-ternary Disallows nested ternary expressions. diff --git a/docs/rules/no-new-func.md b/docs/rules/no-new-func.md index ee7b88f24a..d3dc8277d8 100644 --- a/docs/rules/no-new-func.md +++ b/docs/rules/no-new-func.md @@ -1,12 +1,9 @@ --- -title: no-new-func - Rules +title: no-new-func layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-new-func.md rule_type: suggestion --- - - -# no-new-func Disallows `new` operators with the `Function` object. diff --git a/docs/rules/no-new-object.md b/docs/rules/no-new-object.md index 8a5a468a98..d469789011 100644 --- a/docs/rules/no-new-object.md +++ b/docs/rules/no-new-object.md @@ -1,12 +1,9 @@ --- -title: no-new-object - Rules +title: no-new-object layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-new-object.md rule_type: suggestion --- - - -# no-new-object Disallows `new` operators with the `Object` object. diff --git a/docs/rules/no-new-require.md b/docs/rules/no-new-require.md index 12bc325d1a..cfbbdaea5b 100644 --- a/docs/rules/no-new-require.md +++ b/docs/rules/no-new-require.md @@ -1,12 +1,9 @@ --- -title: no-new-require - Rules +title: no-new-require layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-new-require.md rule_type: suggestion --- - - -# no-new-require Disallows `new` operators with calls to `require`. diff --git a/docs/rules/no-new-symbol.md b/docs/rules/no-new-symbol.md index ebeeb6a989..558e414ed2 100644 --- a/docs/rules/no-new-symbol.md +++ b/docs/rules/no-new-symbol.md @@ -1,12 +1,11 @@ --- -title: no-new-symbol - Rules +title: no-new-symbol layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-new-symbol.md rule_type: problem --- - -# no-new-symbol + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. @@ -43,7 +42,6 @@ Examples of **correct** code for this rule: var foo = Symbol('foo'); - // Ignores shadowed Symbol. function bar(Symbol) { const baz = new Symbol("baz"); diff --git a/docs/rules/no-new-wrappers.md b/docs/rules/no-new-wrappers.md index 238e7f82cd..052a4254e3 100644 --- a/docs/rules/no-new-wrappers.md +++ b/docs/rules/no-new-wrappers.md @@ -1,12 +1,9 @@ --- -title: no-new-wrappers - Rules +title: no-new-wrappers layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-new-wrappers.md rule_type: suggestion --- - - -# no-new-wrappers Disallows `new` operators with the `String`, `Number`, and `Boolean` objects. diff --git a/docs/rules/no-new.md b/docs/rules/no-new.md index 9c62f5cd2e..b8e200b3fc 100644 --- a/docs/rules/no-new.md +++ b/docs/rules/no-new.md @@ -1,12 +1,9 @@ --- -title: no-new - Rules +title: no-new layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-new.md rule_type: suggestion --- - - -# no-new Disallows `new` operators outside of assignments or comparisons. diff --git a/docs/rules/no-nonoctal-decimal-escape.md b/docs/rules/no-nonoctal-decimal-escape.md index d800cf8b04..4ad40fa738 100644 --- a/docs/rules/no-nonoctal-decimal-escape.md +++ b/docs/rules/no-nonoctal-decimal-escape.md @@ -1,15 +1,16 @@ --- -title: no-nonoctal-decimal-escape - Rules +title: no-nonoctal-decimal-escape layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-nonoctal-decimal-escape.md rule_type: suggestion --- - -# no-nonoctal-decimal-escape + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. + + (hasSuggestions) Some problems reported by this rule are manually fixable by editor [suggestions](../developer-guide/working-with-rules#providing-suggestions). Disallows `\8` and `\9` escape sequences in string literals. diff --git a/docs/rules/no-obj-calls.md b/docs/rules/no-obj-calls.md index 7ab322d1c5..6398cf60af 100644 --- a/docs/rules/no-obj-calls.md +++ b/docs/rules/no-obj-calls.md @@ -1,12 +1,11 @@ --- -title: no-obj-calls - Rules +title: no-obj-calls layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-obj-calls.md rule_type: problem --- - -# no-obj-calls + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-octal-escape.md b/docs/rules/no-octal-escape.md index b00b742f60..0d2c3abede 100644 --- a/docs/rules/no-octal-escape.md +++ b/docs/rules/no-octal-escape.md @@ -1,12 +1,9 @@ --- -title: no-octal-escape - Rules +title: no-octal-escape layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-octal-escape.md rule_type: suggestion --- - - -# no-octal-escape Disallows octal escape sequences in string literals. diff --git a/docs/rules/no-octal.md b/docs/rules/no-octal.md index 0048009515..54f51540e7 100644 --- a/docs/rules/no-octal.md +++ b/docs/rules/no-octal.md @@ -1,12 +1,11 @@ --- -title: no-octal - Rules +title: no-octal layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-octal.md rule_type: suggestion --- - -# no-octal + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-param-reassign.md b/docs/rules/no-param-reassign.md index 281a3bb069..6c5e6367cb 100644 --- a/docs/rules/no-param-reassign.md +++ b/docs/rules/no-param-reassign.md @@ -1,12 +1,9 @@ --- -title: no-param-reassign - Rules +title: no-param-reassign layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-param-reassign.md rule_type: suggestion --- - - -# no-param-reassign Disallows reassignment of function parameters. diff --git a/docs/rules/no-path-concat.md b/docs/rules/no-path-concat.md index aa3417bd1b..a3b3f60dd6 100644 --- a/docs/rules/no-path-concat.md +++ b/docs/rules/no-path-concat.md @@ -1,12 +1,9 @@ --- -title: no-path-concat - Rules +title: no-path-concat layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-path-concat.md rule_type: suggestion --- - - -# no-path-concat Disallows string concatenation when using `__dirname` and `__filename`. diff --git a/docs/rules/no-plusplus.md b/docs/rules/no-plusplus.md index eedc7d46e7..5a4bd70783 100644 --- a/docs/rules/no-plusplus.md +++ b/docs/rules/no-plusplus.md @@ -1,12 +1,9 @@ --- -title: no-plusplus - Rules +title: no-plusplus layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-plusplus.md rule_type: suggestion --- - - -# no-plusplus Disallows the unary operators `++` and `--`. diff --git a/docs/rules/no-process-env.md b/docs/rules/no-process-env.md index 1c0adf6c2a..5b3c013ef8 100644 --- a/docs/rules/no-process-env.md +++ b/docs/rules/no-process-env.md @@ -1,12 +1,9 @@ --- -title: no-process-env - Rules +title: no-process-env layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-process-env.md rule_type: suggestion --- - - -# no-process-env Disallows the use of `process.env`. diff --git a/docs/rules/no-process-exit.md b/docs/rules/no-process-exit.md index 974c3ca2fc..225ee38046 100644 --- a/docs/rules/no-process-exit.md +++ b/docs/rules/no-process-exit.md @@ -1,12 +1,9 @@ --- -title: no-process-exit - Rules +title: no-process-exit layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-process-exit.md rule_type: suggestion --- - - -# no-process-exit Disallows the use of `process.exit()`. diff --git a/docs/rules/no-promise-executor-return.md b/docs/rules/no-promise-executor-return.md index fe7f5d8a68..fa6ac2e87c 100644 --- a/docs/rules/no-promise-executor-return.md +++ b/docs/rules/no-promise-executor-return.md @@ -1,12 +1,9 @@ --- -title: no-promise-executor-return - Rules +title: no-promise-executor-return layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-promise-executor-return.md rule_type: problem --- - - -# no-promise-executor-return Disallows returning values from Promise executor functions. diff --git a/docs/rules/no-proto.md b/docs/rules/no-proto.md index ae741a5498..64f4735a5b 100644 --- a/docs/rules/no-proto.md +++ b/docs/rules/no-proto.md @@ -1,12 +1,9 @@ --- -title: no-proto - Rules +title: no-proto layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-proto.md rule_type: suggestion --- - - -# no-proto Disallows the use of the `__proto__` property. diff --git a/docs/rules/no-prototype-builtins.md b/docs/rules/no-prototype-builtins.md index bec3f0f990..1469c56666 100644 --- a/docs/rules/no-prototype-builtins.md +++ b/docs/rules/no-prototype-builtins.md @@ -1,12 +1,11 @@ --- -title: no-prototype-builtins - Rules +title: no-prototype-builtins layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-prototype-builtins.md rule_type: problem --- - -# no-prototype-builtins + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-redeclare.md b/docs/rules/no-redeclare.md index 6183998f9a..5366992eec 100644 --- a/docs/rules/no-redeclare.md +++ b/docs/rules/no-redeclare.md @@ -1,12 +1,11 @@ --- -title: no-redeclare - Rules +title: no-redeclare layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-redeclare.md rule_type: suggestion --- - -# no-redeclare + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-regex-spaces.md b/docs/rules/no-regex-spaces.md index d585c81b5c..0a3f604db0 100644 --- a/docs/rules/no-regex-spaces.md +++ b/docs/rules/no-regex-spaces.md @@ -1,15 +1,16 @@ --- -title: no-regex-spaces - Rules +title: no-regex-spaces layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-regex-spaces.md rule_type: suggestion --- - -# no-regex-spaces + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. + + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. Disallows multiple spaces in regular expression literals. diff --git a/docs/rules/no-reserved-keys.md b/docs/rules/no-reserved-keys.md index 30449823e2..cd7dc0ad62 100644 --- a/docs/rules/no-reserved-keys.md +++ b/docs/rules/no-reserved-keys.md @@ -1,12 +1,9 @@ --- -title: no-reserved-keys - Rules +title: no-reserved-keys layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-reserved-keys.md --- - - -# no-reserved-keys Disallows unquoted reserved words as property names in object literals. diff --git a/docs/rules/no-restricted-exports.md b/docs/rules/no-restricted-exports.md index 9b3c557530..4be8cb8149 100644 --- a/docs/rules/no-restricted-exports.md +++ b/docs/rules/no-restricted-exports.md @@ -1,12 +1,9 @@ --- -title: no-restricted-exports - Rules +title: no-restricted-exports layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-restricted-exports.md rule_type: suggestion --- - - -# no-restricted-exports Disallows specified names in exports. diff --git a/docs/rules/no-restricted-globals.md b/docs/rules/no-restricted-globals.md index b622fd31f0..b95d416fd7 100644 --- a/docs/rules/no-restricted-globals.md +++ b/docs/rules/no-restricted-globals.md @@ -1,12 +1,9 @@ --- -title: no-restricted-globals - Rules +title: no-restricted-globals layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-restricted-globals.md rule_type: suggestion --- - - -# no-restricted-globals Disallows specific global variables. diff --git a/docs/rules/no-restricted-imports.md b/docs/rules/no-restricted-imports.md index 6866f14b4d..3da677ca7c 100644 --- a/docs/rules/no-restricted-imports.md +++ b/docs/rules/no-restricted-imports.md @@ -1,12 +1,9 @@ --- -title: no-restricted-imports - Rules +title: no-restricted-imports layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-restricted-imports.md rule_type: suggestion --- - - -# no-restricted-imports Disallows specific imports. diff --git a/docs/rules/no-restricted-modules.md b/docs/rules/no-restricted-modules.md index 4a43da4010..e7892f8e47 100644 --- a/docs/rules/no-restricted-modules.md +++ b/docs/rules/no-restricted-modules.md @@ -1,12 +1,9 @@ --- -title: no-restricted-modules - Rules +title: no-restricted-modules layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-restricted-modules.md rule_type: suggestion --- - - -# no-restricted-modules Disallows Node.js modules. diff --git a/docs/rules/no-restricted-properties.md b/docs/rules/no-restricted-properties.md index fb5f6772bf..85c519a05e 100644 --- a/docs/rules/no-restricted-properties.md +++ b/docs/rules/no-restricted-properties.md @@ -1,12 +1,9 @@ --- -title: no-restricted-properties - Rules +title: no-restricted-properties layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-restricted-properties.md rule_type: suggestion --- - - -# no-restricted-properties Disallows certain object properties. diff --git a/docs/rules/no-restricted-syntax.md b/docs/rules/no-restricted-syntax.md index 467cda6dc6..faa73c113d 100644 --- a/docs/rules/no-restricted-syntax.md +++ b/docs/rules/no-restricted-syntax.md @@ -1,12 +1,9 @@ --- -title: no-restricted-syntax - Rules +title: no-restricted-syntax layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-restricted-syntax.md rule_type: suggestion --- - - -# no-restricted-syntax Disallows specified syntax. diff --git a/docs/rules/no-return-assign.md b/docs/rules/no-return-assign.md index 0a7f19bcee..43f640d1dd 100644 --- a/docs/rules/no-return-assign.md +++ b/docs/rules/no-return-assign.md @@ -1,12 +1,9 @@ --- -title: no-return-assign - Rules +title: no-return-assign layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-return-assign.md rule_type: suggestion --- - - -# no-return-assign Disallows assignment operators in `return` statements. diff --git a/docs/rules/no-return-await.md b/docs/rules/no-return-await.md index 5abbc1c702..da331412f4 100644 --- a/docs/rules/no-return-await.md +++ b/docs/rules/no-return-await.md @@ -1,12 +1,9 @@ --- -title: no-return-await - Rules +title: no-return-await layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-return-await.md rule_type: suggestion --- - - -# no-return-await Disallows unnecessary `return await`. diff --git a/docs/rules/no-script-url.md b/docs/rules/no-script-url.md index 0060bec22a..52dbad99b1 100644 --- a/docs/rules/no-script-url.md +++ b/docs/rules/no-script-url.md @@ -1,12 +1,9 @@ --- -title: no-script-url - Rules +title: no-script-url layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-script-url.md rule_type: suggestion --- - - -# no-script-url Disallows `javascript:` URLs. diff --git a/docs/rules/no-self-assign.md b/docs/rules/no-self-assign.md index 281517f305..7cef669d30 100644 --- a/docs/rules/no-self-assign.md +++ b/docs/rules/no-self-assign.md @@ -1,12 +1,11 @@ --- -title: no-self-assign - Rules +title: no-self-assign layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-self-assign.md rule_type: problem --- - -# no-self-assign + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-self-compare.md b/docs/rules/no-self-compare.md index 3344f61f99..6bfadeea53 100644 --- a/docs/rules/no-self-compare.md +++ b/docs/rules/no-self-compare.md @@ -1,12 +1,9 @@ --- -title: no-self-compare - Rules +title: no-self-compare layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-self-compare.md rule_type: problem --- - - -# no-self-compare Disallows comparisons where both sides are exactly the same. diff --git a/docs/rules/no-sequences.md b/docs/rules/no-sequences.md index 43360d1e29..7d40b97bc6 100644 --- a/docs/rules/no-sequences.md +++ b/docs/rules/no-sequences.md @@ -1,12 +1,9 @@ --- -title: no-sequences - Rules +title: no-sequences layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-sequences.md rule_type: suggestion --- - - -# no-sequences Disallows use of the comma operator. diff --git a/docs/rules/no-setter-return.md b/docs/rules/no-setter-return.md index e0bf139707..a9f6eda0f1 100644 --- a/docs/rules/no-setter-return.md +++ b/docs/rules/no-setter-return.md @@ -1,12 +1,11 @@ --- -title: no-setter-return - Rules +title: no-setter-return layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-setter-return.md rule_type: problem --- - -# no-setter-return + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-shadow-restricted-names.md b/docs/rules/no-shadow-restricted-names.md index 08830cf852..643dcbaa84 100644 --- a/docs/rules/no-shadow-restricted-names.md +++ b/docs/rules/no-shadow-restricted-names.md @@ -1,12 +1,11 @@ --- -title: no-shadow-restricted-names - Rules +title: no-shadow-restricted-names layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-shadow-restricted-names.md rule_type: suggestion --- - -# no-shadow-restricted-names + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-shadow.md b/docs/rules/no-shadow.md index 45929045aa..39178b39fc 100644 --- a/docs/rules/no-shadow.md +++ b/docs/rules/no-shadow.md @@ -1,12 +1,9 @@ --- -title: no-shadow - Rules +title: no-shadow layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-shadow.md rule_type: suggestion --- - - -# no-shadow Disallows variable declarations from shadowing variables declared in the outer scope. diff --git a/docs/rules/no-space-before-semi.md b/docs/rules/no-space-before-semi.md index 3f4f56fcc7..5d63c1506c 100644 --- a/docs/rules/no-space-before-semi.md +++ b/docs/rules/no-space-before-semi.md @@ -1,12 +1,9 @@ --- -title: no-space-before-semi - Rules +title: no-space-before-semi layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-space-before-semi.md --- - - -# no-space-before-semi Disallows spaces before semicolons. diff --git a/docs/rules/no-spaced-func.md b/docs/rules/no-spaced-func.md index cd3199fca5..f824835bfb 100644 --- a/docs/rules/no-spaced-func.md +++ b/docs/rules/no-spaced-func.md @@ -1,12 +1,11 @@ --- -title: no-spaced-func - Rules +title: no-spaced-func layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-spaced-func.md rule_type: layout --- - -# no-spaced-func + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-sparse-arrays.md b/docs/rules/no-sparse-arrays.md index 76f15323c5..da0fa4e268 100644 --- a/docs/rules/no-sparse-arrays.md +++ b/docs/rules/no-sparse-arrays.md @@ -1,12 +1,11 @@ --- -title: no-sparse-arrays - Rules +title: no-sparse-arrays layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-sparse-arrays.md rule_type: problem --- - -# no-sparse-arrays + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-sync.md b/docs/rules/no-sync.md index 3bf92e577c..6b089320b9 100644 --- a/docs/rules/no-sync.md +++ b/docs/rules/no-sync.md @@ -1,12 +1,9 @@ --- -title: no-sync - Rules +title: no-sync layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-sync.md rule_type: suggestion --- - - -# no-sync Disallows synchronous methods. diff --git a/docs/rules/no-tabs.md b/docs/rules/no-tabs.md index ee416ac78f..1d877e5dd7 100644 --- a/docs/rules/no-tabs.md +++ b/docs/rules/no-tabs.md @@ -1,12 +1,9 @@ --- -title: no-tabs - Rules +title: no-tabs layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-tabs.md rule_type: layout --- - - -# no-tabs Disallows all tabs. diff --git a/docs/rules/no-template-curly-in-string.md b/docs/rules/no-template-curly-in-string.md index f52d978ca6..48b4950056 100644 --- a/docs/rules/no-template-curly-in-string.md +++ b/docs/rules/no-template-curly-in-string.md @@ -1,12 +1,9 @@ --- -title: no-template-curly-in-string - Rules +title: no-template-curly-in-string layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-template-curly-in-string.md rule_type: problem --- - - -# no-template-curly-in-string Disallows template literal placeholder syntax in regular strings. diff --git a/docs/rules/no-ternary.md b/docs/rules/no-ternary.md index 424cd8e989..5f07b4dc06 100644 --- a/docs/rules/no-ternary.md +++ b/docs/rules/no-ternary.md @@ -1,12 +1,9 @@ --- -title: no-ternary - Rules +title: no-ternary layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-ternary.md rule_type: suggestion --- - - -# no-ternary Disallows ternary operators. diff --git a/docs/rules/no-this-before-super.md b/docs/rules/no-this-before-super.md index 8039ea87b7..309807d207 100644 --- a/docs/rules/no-this-before-super.md +++ b/docs/rules/no-this-before-super.md @@ -1,12 +1,11 @@ --- -title: no-this-before-super - Rules +title: no-this-before-super layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-this-before-super.md rule_type: problem --- - -# no-this-before-super + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-throw-literal.md b/docs/rules/no-throw-literal.md index 20d394a150..e2c93b21fc 100644 --- a/docs/rules/no-throw-literal.md +++ b/docs/rules/no-throw-literal.md @@ -1,12 +1,9 @@ --- -title: no-throw-literal - Rules +title: no-throw-literal layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-throw-literal.md rule_type: suggestion --- - - -# no-throw-literal Restricts what can be thrown as an exception. diff --git a/docs/rules/no-trailing-spaces.md b/docs/rules/no-trailing-spaces.md index 656d0f01c0..1bce6b31b3 100644 --- a/docs/rules/no-trailing-spaces.md +++ b/docs/rules/no-trailing-spaces.md @@ -1,12 +1,11 @@ --- -title: no-trailing-spaces - Rules +title: no-trailing-spaces layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-trailing-spaces.md rule_type: layout --- - -# no-trailing-spaces + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-undef-init.md b/docs/rules/no-undef-init.md index 32e6745b28..030954f781 100644 --- a/docs/rules/no-undef-init.md +++ b/docs/rules/no-undef-init.md @@ -1,12 +1,11 @@ --- -title: no-undef-init - Rules +title: no-undef-init layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-undef-init.md rule_type: suggestion --- - -# no-undef-init + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-undef.md b/docs/rules/no-undef.md index eb378a1617..1937fa3cc6 100644 --- a/docs/rules/no-undef.md +++ b/docs/rules/no-undef.md @@ -1,12 +1,11 @@ --- -title: no-undef - Rules +title: no-undef layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-undef.md rule_type: problem --- - -# no-undef + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-undefined.md b/docs/rules/no-undefined.md index de87989c1c..f23c4adaa9 100644 --- a/docs/rules/no-undefined.md +++ b/docs/rules/no-undefined.md @@ -1,12 +1,9 @@ --- -title: no-undefined - Rules +title: no-undefined layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-undefined.md rule_type: suggestion --- - - -# no-undefined Disallows the use of `undefined` as an identifier. diff --git a/docs/rules/no-underscore-dangle.md b/docs/rules/no-underscore-dangle.md index e9df78d48d..bf38025320 100644 --- a/docs/rules/no-underscore-dangle.md +++ b/docs/rules/no-underscore-dangle.md @@ -1,12 +1,9 @@ --- -title: no-underscore-dangle - Rules +title: no-underscore-dangle layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-underscore-dangle.md rule_type: suggestion --- - - -# no-underscore-dangle Disallows dangling underscores in identifiers. diff --git a/docs/rules/no-unexpected-multiline.md b/docs/rules/no-unexpected-multiline.md index 0e564ba548..471cbdafa5 100644 --- a/docs/rules/no-unexpected-multiline.md +++ b/docs/rules/no-unexpected-multiline.md @@ -1,12 +1,11 @@ --- -title: no-unexpected-multiline - Rules +title: no-unexpected-multiline layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-unexpected-multiline.md rule_type: problem --- - -# no-unexpected-multiline + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-unmodified-loop-condition.md b/docs/rules/no-unmodified-loop-condition.md index 103f633e5c..2dc1319eae 100644 --- a/docs/rules/no-unmodified-loop-condition.md +++ b/docs/rules/no-unmodified-loop-condition.md @@ -1,12 +1,9 @@ --- -title: no-unmodified-loop-condition - Rules +title: no-unmodified-loop-condition layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-unmodified-loop-condition.md rule_type: problem --- - - -# no-unmodified-loop-condition Disallows unmodified conditions of loops. diff --git a/docs/rules/no-unneeded-ternary.md b/docs/rules/no-unneeded-ternary.md index 5028aeac18..cf10ef376c 100644 --- a/docs/rules/no-unneeded-ternary.md +++ b/docs/rules/no-unneeded-ternary.md @@ -1,12 +1,11 @@ --- -title: no-unneeded-ternary - Rules +title: no-unneeded-ternary layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-unneeded-ternary.md rule_type: suggestion --- - -# no-unneeded-ternary + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. @@ -22,7 +21,6 @@ var isYes = answer === 1 ? true : false; // Good var isYes = answer === 1; - // Bad var isNo = answer === 1 ? false : true; diff --git a/docs/rules/no-unreachable-loop.md b/docs/rules/no-unreachable-loop.md index 935bdfbe63..f6ca2b04f1 100644 --- a/docs/rules/no-unreachable-loop.md +++ b/docs/rules/no-unreachable-loop.md @@ -1,12 +1,9 @@ --- -title: no-unreachable-loop - Rules +title: no-unreachable-loop layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-unreachable-loop.md rule_type: problem --- - - -# no-unreachable-loop Disallows loops with a body that allows only one iteration. diff --git a/docs/rules/no-unreachable.md b/docs/rules/no-unreachable.md index ff3c8106cd..7f3250f5d3 100644 --- a/docs/rules/no-unreachable.md +++ b/docs/rules/no-unreachable.md @@ -1,12 +1,11 @@ --- -title: no-unreachable - Rules +title: no-unreachable layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-unreachable.md rule_type: problem --- - -# no-unreachable + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-unsafe-finally.md b/docs/rules/no-unsafe-finally.md index 8b80d62573..91faff32ce 100644 --- a/docs/rules/no-unsafe-finally.md +++ b/docs/rules/no-unsafe-finally.md @@ -1,12 +1,11 @@ --- -title: no-unsafe-finally - Rules +title: no-unsafe-finally layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-unsafe-finally.md rule_type: problem --- - -# no-unsafe-finally + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-unsafe-negation.md b/docs/rules/no-unsafe-negation.md index c07590c856..18044961c9 100644 --- a/docs/rules/no-unsafe-negation.md +++ b/docs/rules/no-unsafe-negation.md @@ -1,15 +1,16 @@ --- -title: no-unsafe-negation - Rules +title: no-unsafe-negation layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-unsafe-negation.md rule_type: problem --- - -# no-unsafe-negation + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. + + (hasSuggestions) Some problems reported by this rule are manually fixable by editor [suggestions](../developer-guide/working-with-rules#providing-suggestions). Disallows negating the left operand of relational operators. diff --git a/docs/rules/no-unsafe-optional-chaining.md b/docs/rules/no-unsafe-optional-chaining.md index 220d5b3f2b..03646f579e 100644 --- a/docs/rules/no-unsafe-optional-chaining.md +++ b/docs/rules/no-unsafe-optional-chaining.md @@ -1,12 +1,11 @@ --- -title: no-unsafe-optional-chaining - Rules +title: no-unsafe-optional-chaining layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-unsafe-optional-chaining.md rule_type: problem --- - -# no-unsafe-optional-chaining + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-unused-expressions.md b/docs/rules/no-unused-expressions.md index 2dbfa42fa7..378d68b038 100644 --- a/docs/rules/no-unused-expressions.md +++ b/docs/rules/no-unused-expressions.md @@ -1,12 +1,9 @@ --- -title: no-unused-expressions - Rules +title: no-unused-expressions layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-unused-expressions.md rule_type: suggestion --- - - -# no-unused-expressions Disallows unused expressions. diff --git a/docs/rules/no-unused-labels.md b/docs/rules/no-unused-labels.md index 6e787b1681..b57f35bdf4 100644 --- a/docs/rules/no-unused-labels.md +++ b/docs/rules/no-unused-labels.md @@ -1,15 +1,16 @@ --- -title: no-unused-labels - Rules +title: no-unused-labels layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-unused-labels.md rule_type: suggestion --- - -# no-unused-labels + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. + + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. Disallows unused labels. diff --git a/docs/rules/no-unused-private-class-members.md b/docs/rules/no-unused-private-class-members.md index 04a0f8490c..c99b86900a 100644 --- a/docs/rules/no-unused-private-class-members.md +++ b/docs/rules/no-unused-private-class-members.md @@ -1,12 +1,9 @@ --- -title: no-unused-private-class-members - Rules +title: no-unused-private-class-members layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-unused-private-class-members.md rule_type: problem --- - - -# no-unused-private-class-members Disallows unused private class members. diff --git a/docs/rules/no-unused-vars.md b/docs/rules/no-unused-vars.md index d10f3b9faa..0dde9b1dd6 100644 --- a/docs/rules/no-unused-vars.md +++ b/docs/rules/no-unused-vars.md @@ -1,12 +1,11 @@ --- -title: no-unused-vars - Rules +title: no-unused-vars layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-unused-vars.md rule_type: problem --- - -# no-unused-vars + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-use-before-define.md b/docs/rules/no-use-before-define.md index e1509515f4..f28a840c0a 100644 --- a/docs/rules/no-use-before-define.md +++ b/docs/rules/no-use-before-define.md @@ -1,12 +1,9 @@ --- -title: no-use-before-define - Rules +title: no-use-before-define layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-use-before-define.md rule_type: problem --- - - -# no-use-before-define Disallows the use of variables before they are defined. diff --git a/docs/rules/no-useless-backreference.md b/docs/rules/no-useless-backreference.md index d46a0f5386..5737e94a90 100644 --- a/docs/rules/no-useless-backreference.md +++ b/docs/rules/no-useless-backreference.md @@ -1,12 +1,11 @@ --- -title: no-useless-backreference - Rules +title: no-useless-backreference layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-useless-backreference.md rule_type: problem --- - -# no-useless-backreference + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-useless-call.md b/docs/rules/no-useless-call.md index e7411b75d0..ff373ac2e7 100644 --- a/docs/rules/no-useless-call.md +++ b/docs/rules/no-useless-call.md @@ -1,12 +1,9 @@ --- -title: no-useless-call - Rules +title: no-useless-call layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-useless-call.md rule_type: suggestion --- - - -# no-useless-call Disallows unnecessary `.call()` and `.apply()`. diff --git a/docs/rules/no-useless-catch.md b/docs/rules/no-useless-catch.md index e51ac2c2c4..8a673881f1 100644 --- a/docs/rules/no-useless-catch.md +++ b/docs/rules/no-useless-catch.md @@ -1,12 +1,11 @@ --- -title: no-useless-catch - Rules +title: no-useless-catch layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-useless-catch.md rule_type: suggestion --- - -# no-useless-catch + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-useless-computed-key.md b/docs/rules/no-useless-computed-key.md index fdb4430729..619ab75fef 100644 --- a/docs/rules/no-useless-computed-key.md +++ b/docs/rules/no-useless-computed-key.md @@ -1,12 +1,11 @@ --- -title: no-useless-computed-key - Rules +title: no-useless-computed-key layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-useless-computed-key.md rule_type: suggestion --- - -# no-useless-computed-key + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-useless-concat.md b/docs/rules/no-useless-concat.md index f7fda0be46..7c48f62df0 100644 --- a/docs/rules/no-useless-concat.md +++ b/docs/rules/no-useless-concat.md @@ -1,12 +1,9 @@ --- -title: no-useless-concat - Rules +title: no-useless-concat layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-useless-concat.md rule_type: suggestion --- - - -# no-useless-concat Disallows unnecessary concatenation of strings. diff --git a/docs/rules/no-useless-constructor.md b/docs/rules/no-useless-constructor.md index 8ed3cb1df1..f26b642c38 100644 --- a/docs/rules/no-useless-constructor.md +++ b/docs/rules/no-useless-constructor.md @@ -1,12 +1,9 @@ --- -title: no-useless-constructor - Rules +title: no-useless-constructor layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-useless-constructor.md rule_type: suggestion --- - - -# no-useless-constructor Disallows unnecessary constructors. diff --git a/docs/rules/no-useless-escape.md b/docs/rules/no-useless-escape.md index 42953e7c41..0d1605c22e 100644 --- a/docs/rules/no-useless-escape.md +++ b/docs/rules/no-useless-escape.md @@ -1,15 +1,16 @@ --- -title: no-useless-escape - Rules +title: no-useless-escape layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-useless-escape.md rule_type: suggestion --- - -# no-useless-escape + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. + + (hasSuggestions) Some problems reported by this rule are manually fixable by editor [suggestions](../developer-guide/working-with-rules#providing-suggestions). Disallows unnecessary escape characters. diff --git a/docs/rules/no-useless-rename.md b/docs/rules/no-useless-rename.md index cf392e4feb..89cb28ea3b 100644 --- a/docs/rules/no-useless-rename.md +++ b/docs/rules/no-useless-rename.md @@ -1,12 +1,11 @@ --- -title: no-useless-rename - Rules +title: no-useless-rename layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-useless-rename.md rule_type: suggestion --- - -# no-useless-rename + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-useless-return.md b/docs/rules/no-useless-return.md index 766edca95d..ff24110ef2 100644 --- a/docs/rules/no-useless-return.md +++ b/docs/rules/no-useless-return.md @@ -1,12 +1,11 @@ --- -title: no-useless-return - Rules +title: no-useless-return layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-useless-return.md rule_type: suggestion --- - -# no-useless-return + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-var.md b/docs/rules/no-var.md index 203d2031c5..42740ceab3 100644 --- a/docs/rules/no-var.md +++ b/docs/rules/no-var.md @@ -1,12 +1,11 @@ --- -title: no-var - Rules +title: no-var layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-var.md rule_type: suggestion --- - -# no-var + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-void.md b/docs/rules/no-void.md index 527c37999d..b7a961379c 100644 --- a/docs/rules/no-void.md +++ b/docs/rules/no-void.md @@ -1,12 +1,9 @@ --- -title: no-void - Rules +title: no-void layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-void.md rule_type: suggestion --- - - -# no-void Disallows use of the void operator. diff --git a/docs/rules/no-warning-comments.md b/docs/rules/no-warning-comments.md index 2d849a4731..2251e08b3d 100644 --- a/docs/rules/no-warning-comments.md +++ b/docs/rules/no-warning-comments.md @@ -1,12 +1,9 @@ --- -title: no-warning-comments - Rules +title: no-warning-comments layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-warning-comments.md rule_type: suggestion --- - - -# no-warning-comments Disallows specified warning terms in comments. diff --git a/docs/rules/no-whitespace-before-property.md b/docs/rules/no-whitespace-before-property.md index 609eff6036..5c7a306a08 100644 --- a/docs/rules/no-whitespace-before-property.md +++ b/docs/rules/no-whitespace-before-property.md @@ -1,12 +1,11 @@ --- -title: no-whitespace-before-property - Rules +title: no-whitespace-before-property layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-whitespace-before-property.md rule_type: layout --- - -# no-whitespace-before-property + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/no-with.md b/docs/rules/no-with.md index ed045d5777..89307b14df 100644 --- a/docs/rules/no-with.md +++ b/docs/rules/no-with.md @@ -1,12 +1,11 @@ --- -title: no-with - Rules +title: no-with layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-with.md rule_type: suggestion --- - -# no-with + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/no-wrap-func.md b/docs/rules/no-wrap-func.md index 2414c0aab5..fbee5e8ec5 100644 --- a/docs/rules/no-wrap-func.md +++ b/docs/rules/no-wrap-func.md @@ -1,12 +1,9 @@ --- -title: no-wrap-func - Rules +title: no-wrap-func layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/no-wrap-func.md --- - - -# no-wrap-func Disallows unnecessary parentheses around function expressions. diff --git a/docs/rules/nonblock-statement-body-position.md b/docs/rules/nonblock-statement-body-position.md index 9a78f51991..c83d8af2e0 100644 --- a/docs/rules/nonblock-statement-body-position.md +++ b/docs/rules/nonblock-statement-body-position.md @@ -1,12 +1,11 @@ --- -title: nonblock-statement-body-position - Rules +title: nonblock-statement-body-position layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/nonblock-statement-body-position.md rule_type: layout --- - -# nonblock-statement-body-position + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/object-curly-newline.md b/docs/rules/object-curly-newline.md index e8e37f52f3..a98c70c0b9 100644 --- a/docs/rules/object-curly-newline.md +++ b/docs/rules/object-curly-newline.md @@ -1,12 +1,11 @@ --- -title: object-curly-newline - Rules +title: object-curly-newline layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/object-curly-newline.md rule_type: layout --- - -# object-curly-newline + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. @@ -381,7 +380,6 @@ Examples of **correct** code for this rule with the default `{ "consistent": tru /*eslint object-curly-newline: ["error", { "consistent": true }]*/ /*eslint-env es6*/ - let empty1 = {}; let empty2 = { }; diff --git a/docs/rules/object-curly-spacing.md b/docs/rules/object-curly-spacing.md index 155df50256..d1f3cb9ab4 100644 --- a/docs/rules/object-curly-spacing.md +++ b/docs/rules/object-curly-spacing.md @@ -1,12 +1,11 @@ --- -title: object-curly-spacing - Rules +title: object-curly-spacing layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/object-curly-spacing.md rule_type: layout --- - -# object-curly-spacing + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/object-property-newline.md b/docs/rules/object-property-newline.md index 4e6609602a..615b7e98ef 100644 --- a/docs/rules/object-property-newline.md +++ b/docs/rules/object-property-newline.md @@ -1,12 +1,11 @@ --- -title: object-property-newline - Rules +title: object-property-newline layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/object-property-newline.md rule_type: layout --- - -# object-property-newline + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/object-shorthand.md b/docs/rules/object-shorthand.md index e4e24562c6..9e1eb814c9 100644 --- a/docs/rules/object-shorthand.md +++ b/docs/rules/object-shorthand.md @@ -1,12 +1,11 @@ --- -title: object-shorthand - Rules +title: object-shorthand layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/object-shorthand.md rule_type: suggestion --- - -# object-shorthand + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/one-var-declaration-per-line.md b/docs/rules/one-var-declaration-per-line.md index 8aac3e0384..de25043460 100644 --- a/docs/rules/one-var-declaration-per-line.md +++ b/docs/rules/one-var-declaration-per-line.md @@ -1,12 +1,11 @@ --- -title: one-var-declaration-per-line - Rules +title: one-var-declaration-per-line layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/one-var-declaration-per-line.md rule_type: suggestion --- - -# one-var-declaration-per-line + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/one-var.md b/docs/rules/one-var.md index 9eb27548d3..8b6dd92233 100644 --- a/docs/rules/one-var.md +++ b/docs/rules/one-var.md @@ -1,12 +1,11 @@ --- -title: one-var - Rules +title: one-var layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/one-var.md rule_type: suggestion --- - -# one-var + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/operator-assignment.md b/docs/rules/operator-assignment.md index b476093f74..9925d6cac8 100644 --- a/docs/rules/operator-assignment.md +++ b/docs/rules/operator-assignment.md @@ -1,12 +1,11 @@ --- -title: operator-assignment - Rules +title: operator-assignment layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/operator-assignment.md rule_type: suggestion --- - -# operator-assignment + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/operator-linebreak.md b/docs/rules/operator-linebreak.md index 939495f6cc..4bafa3f91d 100644 --- a/docs/rules/operator-linebreak.md +++ b/docs/rules/operator-linebreak.md @@ -1,12 +1,11 @@ --- -title: operator-linebreak - Rules +title: operator-linebreak layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/operator-linebreak.md rule_type: layout --- - -# operator-linebreak + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/padded-blocks.md b/docs/rules/padded-blocks.md index 9bb9edc16a..4678831e2b 100644 --- a/docs/rules/padded-blocks.md +++ b/docs/rules/padded-blocks.md @@ -1,12 +1,11 @@ --- -title: padded-blocks - Rules +title: padded-blocks layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/padded-blocks.md rule_type: layout --- - -# padded-blocks + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/padding-line-between-statements.md b/docs/rules/padding-line-between-statements.md index af9ae8edfe..6e70baa1bb 100644 --- a/docs/rules/padding-line-between-statements.md +++ b/docs/rules/padding-line-between-statements.md @@ -1,12 +1,11 @@ --- -title: padding-line-between-statements - Rules +title: padding-line-between-statements layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/padding-line-between-statements.md rule_type: layout --- - -# padding-line-between-statements + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/prefer-arrow-callback.md b/docs/rules/prefer-arrow-callback.md index a5f669a727..4c1c02e147 100644 --- a/docs/rules/prefer-arrow-callback.md +++ b/docs/rules/prefer-arrow-callback.md @@ -1,12 +1,11 @@ --- -title: prefer-arrow-callback - Rules +title: prefer-arrow-callback layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/prefer-arrow-callback.md rule_type: suggestion --- - -# prefer-arrow-callback + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/prefer-const.md b/docs/rules/prefer-const.md index 4562e8d2e8..7494819fce 100644 --- a/docs/rules/prefer-const.md +++ b/docs/rules/prefer-const.md @@ -1,12 +1,11 @@ --- -title: prefer-const - Rules +title: prefer-const layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/prefer-const.md rule_type: suggestion --- - -# prefer-const + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/prefer-destructuring.md b/docs/rules/prefer-destructuring.md index 81f1a7e27d..7c802d21df 100644 --- a/docs/rules/prefer-destructuring.md +++ b/docs/rules/prefer-destructuring.md @@ -1,12 +1,11 @@ --- -title: prefer-destructuring - Rules +title: prefer-destructuring layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/prefer-destructuring.md rule_type: suggestion --- - -# prefer-destructuring + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/prefer-exponentiation-operator.md b/docs/rules/prefer-exponentiation-operator.md index 106b7b3cd5..a622debea1 100644 --- a/docs/rules/prefer-exponentiation-operator.md +++ b/docs/rules/prefer-exponentiation-operator.md @@ -1,12 +1,11 @@ --- -title: prefer-exponentiation-operator - Rules +title: prefer-exponentiation-operator layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/prefer-exponentiation-operator.md rule_type: suggestion --- - -# prefer-exponentiation-operator + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/prefer-named-capture-group.md b/docs/rules/prefer-named-capture-group.md index 5016fd3268..06a4e3417a 100644 --- a/docs/rules/prefer-named-capture-group.md +++ b/docs/rules/prefer-named-capture-group.md @@ -1,12 +1,9 @@ --- -title: prefer-named-capture-group - Rules +title: prefer-named-capture-group layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/prefer-named-capture-group.md rule_type: suggestion --- - - -# prefer-named-capture-group Suggest using named capture group in regular expression. diff --git a/docs/rules/prefer-numeric-literals.md b/docs/rules/prefer-numeric-literals.md index b66c8646a8..b6cbe6480a 100644 --- a/docs/rules/prefer-numeric-literals.md +++ b/docs/rules/prefer-numeric-literals.md @@ -1,12 +1,11 @@ --- -title: prefer-numeric-literals - Rules +title: prefer-numeric-literals layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/prefer-numeric-literals.md rule_type: suggestion --- - -# prefer-numeric-literals + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/prefer-object-has-own.md b/docs/rules/prefer-object-has-own.md index cf5986cb6b..6cef1ffc3e 100644 --- a/docs/rules/prefer-object-has-own.md +++ b/docs/rules/prefer-object-has-own.md @@ -1,12 +1,11 @@ --- -title: prefer-object-has-own - Rules +title: prefer-object-has-own layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/prefer-object-has-own.md rule_type: suggestion --- - -# prefer-object-has-own + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/prefer-object-spread.md b/docs/rules/prefer-object-spread.md index b9988927b7..68d3d1764a 100644 --- a/docs/rules/prefer-object-spread.md +++ b/docs/rules/prefer-object-spread.md @@ -1,12 +1,11 @@ --- -title: prefer-object-spread - Rules +title: prefer-object-spread layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/prefer-object-spread.md rule_type: suggestion --- - -# prefer-object-spread + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/prefer-promise-reject-errors.md b/docs/rules/prefer-promise-reject-errors.md index 8761477b6b..ba53ca1ea1 100644 --- a/docs/rules/prefer-promise-reject-errors.md +++ b/docs/rules/prefer-promise-reject-errors.md @@ -1,12 +1,9 @@ --- -title: prefer-promise-reject-errors - Rules +title: prefer-promise-reject-errors layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/prefer-promise-reject-errors.md rule_type: suggestion --- - - -# prefer-promise-reject-errors Requires using Error objects as Promise rejection reasons. diff --git a/docs/rules/prefer-reflect.md b/docs/rules/prefer-reflect.md index 053aa669c3..1f214b5e27 100644 --- a/docs/rules/prefer-reflect.md +++ b/docs/rules/prefer-reflect.md @@ -1,12 +1,9 @@ --- -title: prefer-reflect - Rules +title: prefer-reflect layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/prefer-reflect.md rule_type: suggestion --- - - -# prefer-reflect Suggest using Reflect methods where applicable. diff --git a/docs/rules/prefer-regex-literals.md b/docs/rules/prefer-regex-literals.md index ba4e7505cc..214fe8501b 100644 --- a/docs/rules/prefer-regex-literals.md +++ b/docs/rules/prefer-regex-literals.md @@ -1,12 +1,11 @@ --- -title: prefer-regex-literals - Rules +title: prefer-regex-literals layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/prefer-regex-literals.md rule_type: suggestion --- - -# prefer-regex-literals + (hasSuggestions) Some problems reported by this rule are manually fixable by editor [suggestions](../developer-guide/working-with-rules#providing-suggestions). diff --git a/docs/rules/prefer-rest-params.md b/docs/rules/prefer-rest-params.md index 5c66729597..81ce6156f8 100644 --- a/docs/rules/prefer-rest-params.md +++ b/docs/rules/prefer-rest-params.md @@ -1,12 +1,9 @@ --- -title: prefer-rest-params - Rules +title: prefer-rest-params layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/prefer-rest-params.md rule_type: suggestion --- - - -# prefer-rest-params Suggests using rest parameters instead of `arguments`. diff --git a/docs/rules/prefer-spread.md b/docs/rules/prefer-spread.md index e6cda1c7fd..a6670b9b5a 100644 --- a/docs/rules/prefer-spread.md +++ b/docs/rules/prefer-spread.md @@ -1,12 +1,9 @@ --- -title: prefer-spread - Rules +title: prefer-spread layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/prefer-spread.md rule_type: suggestion --- - - -# prefer-spread Suggests using spread syntax instead of `.apply()`. diff --git a/docs/rules/prefer-template.md b/docs/rules/prefer-template.md index d9cc9eb5cc..960bc4baa6 100644 --- a/docs/rules/prefer-template.md +++ b/docs/rules/prefer-template.md @@ -1,12 +1,11 @@ --- -title: prefer-template - Rules +title: prefer-template layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/prefer-template.md rule_type: suggestion --- - -# prefer-template + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/quote-props.md b/docs/rules/quote-props.md index 6d0f22f0f2..c6424c7bfe 100644 --- a/docs/rules/quote-props.md +++ b/docs/rules/quote-props.md @@ -1,12 +1,11 @@ --- -title: quote-props - Rules +title: quote-props layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/quote-props.md rule_type: suggestion --- - -# quote-props + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/quotes.md b/docs/rules/quotes.md index 1fdd3856bb..129bc0c450 100644 --- a/docs/rules/quotes.md +++ b/docs/rules/quotes.md @@ -1,12 +1,11 @@ --- -title: quotes - Rules +title: quotes layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/quotes.md rule_type: layout --- - -# quotes + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/radix.md b/docs/rules/radix.md index 79baa9c65d..2ab988a35b 100644 --- a/docs/rules/radix.md +++ b/docs/rules/radix.md @@ -1,12 +1,11 @@ --- -title: radix - Rules +title: radix layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/radix.md rule_type: suggestion --- - -# radix + (hasSuggestions) Some problems reported by this rule are manually fixable by editor [suggestions](../developer-guide/working-with-rules#providing-suggestions). diff --git a/docs/rules/require-atomic-updates.md b/docs/rules/require-atomic-updates.md index d4c829bc42..97be2cc965 100644 --- a/docs/rules/require-atomic-updates.md +++ b/docs/rules/require-atomic-updates.md @@ -1,12 +1,9 @@ --- -title: require-atomic-updates - Rules +title: require-atomic-updates layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/require-atomic-updates.md rule_type: problem --- - - -# require-atomic-updates Disallows assignments that can lead to race conditions due to usage of `await` or `yield`. diff --git a/docs/rules/require-await.md b/docs/rules/require-await.md index a5218ea9bb..09291dd32e 100644 --- a/docs/rules/require-await.md +++ b/docs/rules/require-await.md @@ -1,12 +1,9 @@ --- -title: require-await - Rules +title: require-await layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/require-await.md rule_type: suggestion --- - - -# require-await Disallows async functions which have no `await` expression. diff --git a/docs/rules/require-jsdoc.md b/docs/rules/require-jsdoc.md index 6ad92357c8..2617714533 100644 --- a/docs/rules/require-jsdoc.md +++ b/docs/rules/require-jsdoc.md @@ -1,12 +1,9 @@ --- -title: require-jsdoc - Rules +title: require-jsdoc layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/require-jsdoc.md rule_type: suggestion --- - - -# require-jsdoc Requires JSDoc comments. diff --git a/docs/rules/require-unicode-regexp.md b/docs/rules/require-unicode-regexp.md index 2e767a06ef..d4ac6df5cb 100644 --- a/docs/rules/require-unicode-regexp.md +++ b/docs/rules/require-unicode-regexp.md @@ -1,12 +1,9 @@ --- -title: require-unicode-regexp - Rules +title: require-unicode-regexp layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/require-unicode-regexp.md rule_type: suggestion --- - - -# require-unicode-regexp Enforces the use of `u` flag on RegExp. diff --git a/docs/rules/require-yield.md b/docs/rules/require-yield.md index b9067f78f6..a5af52da83 100644 --- a/docs/rules/require-yield.md +++ b/docs/rules/require-yield.md @@ -1,12 +1,11 @@ --- -title: require-yield - Rules +title: require-yield layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/require-yield.md rule_type: suggestion --- - -# require-yield + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/rest-spread-spacing.md b/docs/rules/rest-spread-spacing.md index 5004caf624..d6c6c6534b 100644 --- a/docs/rules/rest-spread-spacing.md +++ b/docs/rules/rest-spread-spacing.md @@ -1,12 +1,11 @@ --- -title: rest-spread-spacing - Rules +title: rest-spread-spacing layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/rest-spread-spacing.md rule_type: layout --- - -# rest-spread-spacing + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/semi-spacing.md b/docs/rules/semi-spacing.md index 5e5c784e01..e766b30de8 100644 --- a/docs/rules/semi-spacing.md +++ b/docs/rules/semi-spacing.md @@ -1,12 +1,11 @@ --- -title: semi-spacing - Rules +title: semi-spacing layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/semi-spacing.md rule_type: layout --- - -# semi-spacing + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/semi-style.md b/docs/rules/semi-style.md index d9069f2112..fdc7513ab1 100644 --- a/docs/rules/semi-style.md +++ b/docs/rules/semi-style.md @@ -1,12 +1,11 @@ --- -title: semi-style - Rules +title: semi-style layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/semi-style.md rule_type: layout --- - -# semi-style + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/semi.md b/docs/rules/semi.md index 3cba008ef2..6da4155f16 100644 --- a/docs/rules/semi.md +++ b/docs/rules/semi.md @@ -1,12 +1,11 @@ --- -title: semi - Rules +title: semi layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/semi.md rule_type: layout --- - -# semi + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/sort-imports.md b/docs/rules/sort-imports.md index e4d551ec96..da6f79abae 100644 --- a/docs/rules/sort-imports.md +++ b/docs/rules/sort-imports.md @@ -1,12 +1,11 @@ --- -title: sort-imports - Rules +title: sort-imports layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/sort-imports.md rule_type: suggestion --- - -# sort-imports + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/sort-keys.md b/docs/rules/sort-keys.md index 1f0678b22d..341b5b32c6 100644 --- a/docs/rules/sort-keys.md +++ b/docs/rules/sort-keys.md @@ -1,12 +1,9 @@ --- -title: sort-keys - Rules +title: sort-keys layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/sort-keys.md rule_type: suggestion --- - - -# sort-keys Requires object keys to be sorted. diff --git a/docs/rules/sort-vars.md b/docs/rules/sort-vars.md index 5e516bba59..1340be818b 100644 --- a/docs/rules/sort-vars.md +++ b/docs/rules/sort-vars.md @@ -1,12 +1,11 @@ --- -title: sort-vars - Rules +title: sort-vars layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/sort-vars.md rule_type: suggestion --- - -# sort-vars + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/space-after-function-name.md b/docs/rules/space-after-function-name.md index e4d2f04ea3..c15455d95b 100644 --- a/docs/rules/space-after-function-name.md +++ b/docs/rules/space-after-function-name.md @@ -1,12 +1,9 @@ --- -title: space-after-function-name - Rules +title: space-after-function-name layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/space-after-function-name.md --- - - -# space-after-function-name Enforces consistent spacing after name in function definitions. diff --git a/docs/rules/space-after-keywords.md b/docs/rules/space-after-keywords.md index 4e3480760d..f2c0f681f2 100644 --- a/docs/rules/space-after-keywords.md +++ b/docs/rules/space-after-keywords.md @@ -1,12 +1,9 @@ --- -title: space-after-keywords - Rules +title: space-after-keywords layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/space-after-keywords.md --- - - -# space-after-keywords Enforces consistent spacing after keywords. diff --git a/docs/rules/space-before-blocks.md b/docs/rules/space-before-blocks.md index 784620f709..dc493b114d 100644 --- a/docs/rules/space-before-blocks.md +++ b/docs/rules/space-before-blocks.md @@ -1,12 +1,11 @@ --- -title: space-before-blocks - Rules +title: space-before-blocks layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/space-before-blocks.md rule_type: layout --- - -# space-before-blocks + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/space-before-function-paren.md b/docs/rules/space-before-function-paren.md index 19d0208f5a..9cfa0f512e 100644 --- a/docs/rules/space-before-function-paren.md +++ b/docs/rules/space-before-function-paren.md @@ -1,12 +1,11 @@ --- -title: space-before-function-paren - Rules +title: space-before-function-paren layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/space-before-function-paren.md rule_type: layout --- - -# space-before-function-paren + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/space-before-function-parentheses.md b/docs/rules/space-before-function-parentheses.md index 82f15eed52..b6ed05ad3b 100644 --- a/docs/rules/space-before-function-parentheses.md +++ b/docs/rules/space-before-function-parentheses.md @@ -1,12 +1,9 @@ --- -title: space-before-function-parentheses - Rules +title: space-before-function-parentheses layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/space-before-function-parentheses.md --- - - -# space-before-function-parentheses Enforces consistent spacing before opening parenthesis in function definitions. diff --git a/docs/rules/space-before-keywords.md b/docs/rules/space-before-keywords.md index 31ade84852..e546544e1c 100644 --- a/docs/rules/space-before-keywords.md +++ b/docs/rules/space-before-keywords.md @@ -1,12 +1,9 @@ --- -title: space-before-keywords - Rules +title: space-before-keywords layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/space-before-keywords.md --- - - -# space-before-keywords Enforces consistent spacing before keywords. diff --git a/docs/rules/space-in-brackets.md b/docs/rules/space-in-brackets.md index 3961c45be3..151b0de631 100644 --- a/docs/rules/space-in-brackets.md +++ b/docs/rules/space-in-brackets.md @@ -1,12 +1,9 @@ --- -title: space-in-brackets - Rules +title: space-in-brackets layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/space-in-brackets.md --- - - -# space-in-brackets Enforces consistent spacing inside braces of object literals and brackets of array literals. diff --git a/docs/rules/space-in-parens.md b/docs/rules/space-in-parens.md index 156711c7b6..1bfb0f89f0 100644 --- a/docs/rules/space-in-parens.md +++ b/docs/rules/space-in-parens.md @@ -1,12 +1,11 @@ --- -title: space-in-parens - Rules +title: space-in-parens layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/space-in-parens.md rule_type: layout --- - -# space-in-parens + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/space-infix-ops.md b/docs/rules/space-infix-ops.md index 58993d2505..4957a35fa0 100644 --- a/docs/rules/space-infix-ops.md +++ b/docs/rules/space-infix-ops.md @@ -1,12 +1,11 @@ --- -title: space-infix-ops - Rules +title: space-infix-ops layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/space-infix-ops.md rule_type: layout --- - -# space-infix-ops + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/space-return-throw-case.md b/docs/rules/space-return-throw-case.md index c9e6073f0a..290b9072da 100644 --- a/docs/rules/space-return-throw-case.md +++ b/docs/rules/space-return-throw-case.md @@ -1,12 +1,9 @@ --- -title: space-return-throw-case - Rules +title: space-return-throw-case layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/space-return-throw-case.md --- - - -# space-return-throw-case Requires spaces after `return`, `throw`, and `case` keywords. diff --git a/docs/rules/space-unary-ops.md b/docs/rules/space-unary-ops.md index b52f0ffb86..3686be788b 100644 --- a/docs/rules/space-unary-ops.md +++ b/docs/rules/space-unary-ops.md @@ -1,12 +1,11 @@ --- -title: space-unary-ops - Rules +title: space-unary-ops layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/space-unary-ops.md rule_type: layout --- - -# space-unary-ops + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/space-unary-word-ops.md b/docs/rules/space-unary-word-ops.md index c61031f4e3..5e346730d7 100644 --- a/docs/rules/space-unary-word-ops.md +++ b/docs/rules/space-unary-word-ops.md @@ -1,12 +1,9 @@ --- -title: space-unary-word-ops - Rules +title: space-unary-word-ops layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/space-unary-word-ops.md --- - - -# space-unary-word-ops Requires spaces after unary word operators. diff --git a/docs/rules/spaced-comment.md b/docs/rules/spaced-comment.md index e141c1b9d2..70b006f56c 100644 --- a/docs/rules/spaced-comment.md +++ b/docs/rules/spaced-comment.md @@ -1,12 +1,11 @@ --- -title: spaced-comment - Rules +title: spaced-comment layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/spaced-comment.md rule_type: suggestion --- - -# spaced-comment + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/spaced-line-comment.md b/docs/rules/spaced-line-comment.md index f6ea587031..ceac20c19d 100644 --- a/docs/rules/spaced-line-comment.md +++ b/docs/rules/spaced-line-comment.md @@ -1,12 +1,9 @@ --- -title: spaced-line-comment - Rules +title: spaced-line-comment layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/spaced-line-comment.md --- - - -# spaced-line-comment Enforces consistent spacing after `//` in line comments. diff --git a/docs/rules/strict.md b/docs/rules/strict.md index c37ae70b59..687213c144 100644 --- a/docs/rules/strict.md +++ b/docs/rules/strict.md @@ -1,12 +1,11 @@ --- -title: strict - Rules +title: strict layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/strict.md rule_type: suggestion --- - -# strict + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/switch-colon-spacing.md b/docs/rules/switch-colon-spacing.md index 1f765376c6..b2cdb138be 100644 --- a/docs/rules/switch-colon-spacing.md +++ b/docs/rules/switch-colon-spacing.md @@ -1,12 +1,11 @@ --- -title: switch-colon-spacing - Rules +title: switch-colon-spacing layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/switch-colon-spacing.md rule_type: layout --- - -# switch-colon-spacing + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/symbol-description.md b/docs/rules/symbol-description.md index 3e4d8a8636..07c28c584e 100644 --- a/docs/rules/symbol-description.md +++ b/docs/rules/symbol-description.md @@ -1,12 +1,9 @@ --- -title: symbol-description - Rules +title: symbol-description layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/symbol-description.md rule_type: suggestion --- - - -# symbol-description Requires symbol descriptions. diff --git a/docs/rules/template-curly-spacing.md b/docs/rules/template-curly-spacing.md index ff5430ca25..4b9a8e6d35 100644 --- a/docs/rules/template-curly-spacing.md +++ b/docs/rules/template-curly-spacing.md @@ -1,12 +1,11 @@ --- -title: template-curly-spacing - Rules +title: template-curly-spacing layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/template-curly-spacing.md rule_type: layout --- - -# template-curly-spacing + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/template-tag-spacing.md b/docs/rules/template-tag-spacing.md index e743344957..4bbb3ceaae 100644 --- a/docs/rules/template-tag-spacing.md +++ b/docs/rules/template-tag-spacing.md @@ -1,12 +1,11 @@ --- -title: template-tag-spacing - Rules +title: template-tag-spacing layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/template-tag-spacing.md rule_type: layout --- - -# template-tag-spacing + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/unicode-bom.md b/docs/rules/unicode-bom.md index 2310684cc3..fad1cd06dc 100644 --- a/docs/rules/unicode-bom.md +++ b/docs/rules/unicode-bom.md @@ -1,12 +1,11 @@ --- -title: unicode-bom - Rules +title: unicode-bom layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/unicode-bom.md rule_type: layout --- - -# unicode-bom + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/use-isnan.md b/docs/rules/use-isnan.md index 5ef6618f04..44523df32f 100644 --- a/docs/rules/use-isnan.md +++ b/docs/rules/use-isnan.md @@ -1,12 +1,11 @@ --- -title: use-isnan - Rules +title: use-isnan layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/use-isnan.md rule_type: problem --- - -# use-isnan + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. diff --git a/docs/rules/valid-jsdoc.md b/docs/rules/valid-jsdoc.md index 5a114bf42c..9eb53a4324 100644 --- a/docs/rules/valid-jsdoc.md +++ b/docs/rules/valid-jsdoc.md @@ -1,12 +1,11 @@ --- -title: valid-jsdoc - Rules +title: valid-jsdoc layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/valid-jsdoc.md rule_type: suggestion --- - -# valid-jsdoc + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/valid-typeof.md b/docs/rules/valid-typeof.md index db0e6cc0f6..0e1cadc384 100644 --- a/docs/rules/valid-typeof.md +++ b/docs/rules/valid-typeof.md @@ -1,15 +1,16 @@ --- -title: valid-typeof - Rules +title: valid-typeof layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/valid-typeof.md rule_type: problem --- - -# valid-typeof + (recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule. + + (hasSuggestions) Some problems reported by this rule are manually fixable by editor [suggestions](../developer-guide/working-with-rules#providing-suggestions). Enforces comparing `typeof` expressions against valid strings. diff --git a/docs/rules/vars-on-top.md b/docs/rules/vars-on-top.md index 2ce930e2c2..fb17bf3d65 100644 --- a/docs/rules/vars-on-top.md +++ b/docs/rules/vars-on-top.md @@ -1,12 +1,9 @@ --- -title: vars-on-top - Rules +title: vars-on-top layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/vars-on-top.md rule_type: suggestion --- - - -# vars-on-top Requires variable declarations to be at the top of their scope. diff --git a/docs/rules/wrap-iife.md b/docs/rules/wrap-iife.md index 143cb74be6..6a92b961d9 100644 --- a/docs/rules/wrap-iife.md +++ b/docs/rules/wrap-iife.md @@ -1,12 +1,11 @@ --- -title: wrap-iife - Rules +title: wrap-iife layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/wrap-iife.md rule_type: layout --- - -# wrap-iife + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/wrap-regex.md b/docs/rules/wrap-regex.md index 289f33ffcd..d93b2f69d7 100644 --- a/docs/rules/wrap-regex.md +++ b/docs/rules/wrap-regex.md @@ -1,12 +1,11 @@ --- -title: wrap-regex - Rules +title: wrap-regex layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/wrap-regex.md rule_type: layout --- - -# wrap-regex + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/yield-star-spacing.md b/docs/rules/yield-star-spacing.md index 3b4a3fb831..ff6f3776a2 100644 --- a/docs/rules/yield-star-spacing.md +++ b/docs/rules/yield-star-spacing.md @@ -1,12 +1,11 @@ --- -title: yield-star-spacing - Rules +title: yield-star-spacing layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/yield-star-spacing.md rule_type: layout --- - -# yield-star-spacing + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/rules/yoda.md b/docs/rules/yoda.md index 5612a967ee..d1acabce0e 100644 --- a/docs/rules/yoda.md +++ b/docs/rules/yoda.md @@ -1,12 +1,11 @@ --- -title: yoda - Rules +title: yoda layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/yoda.md rule_type: suggestion --- - -# yoda + (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. diff --git a/docs/user-guide/README.md b/docs/user-guide/README.md index 63b7533f73..fd935711dd 100644 --- a/docs/user-guide/README.md +++ b/docs/user-guide/README.md @@ -1,8 +1,13 @@ -# User Guide +--- +title: User Guide +layout: doc +edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/README.md + +--- This guide is intended for those who wish to use ESLint as an end-user. If you're looking for how to extend ESLint or work with the ESLint source code, please see the [Developer Guide](../developer-guide). -## [Getting Started](getting-started.md) +## [Getting Started](getting-started) Want to skip ahead and just start using ESLint? This section gives a high-level overview of installation, setup, and configuration options. @@ -14,15 +19,15 @@ ESLint has a lot of rules that you can configure to fine-tune it to your project Once you've got ESLint running, you'll probably want to adjust the configuration to better suit your project. This section explains all the different ways you can configure ESLint. -## [Command Line Interface](command-line-interface.md) +## [Command Line Interface](command-line-interface) There are a lot of command line flags for ESLint and this section explains what they do. -## [Integrations](integrations.md) +## [Integrations](integrations) Wondering if ESLint will work with your favorite editor or build system? This section has a list of all known integrations (submitted by their authors). -## [Rule Deprecation](rule-deprecation.md) +## [Rule Deprecation](rule-deprecation) The ESLint team is committed to making upgrading as easy and painless as possible. This section outlines the guidelines the team has set in place for the deprecation of rules in future releases. @@ -30,10 +35,10 @@ The ESLint team is committed to making upgrading as easy and painless as possibl If you were using a prior version of ESLint, you can get help with the transition by reading: -* [migrating-to-1.0.0](migrating-to-1.0.0.md) -* [migrating-to-2.0.0](migrating-to-2.0.0.md) -* [migrating-to-3.0.0](migrating-to-3.0.0.md) -* [migrating-to-4.0.0](migrating-to-4.0.0.md) -* [migrating-to-5.0.0](migrating-to-5.0.0.md) -* [migrating-to-6.0.0](migrating-to-6.0.0.md) -* [migrating-to-7.0.0](migrating-to-7.0.0.md) +* [migrating-to-1.0.0](migrating-to-1.0.0) +* [migrating-to-2.0.0](migrating-to-2.0.0) +* [migrating-to-3.0.0](migrating-to-3.0.0) +* [migrating-to-4.0.0](migrating-to-4.0.0) +* [migrating-to-5.0.0](migrating-to-5.0.0) +* [migrating-to-6.0.0](migrating-to-6.0.0) +* [migrating-to-7.0.0](migrating-to-7.0.0) diff --git a/docs/user-guide/command-line-interface.md b/docs/user-guide/command-line-interface.md index ecd70c2c01..e7c7b32f5a 100644 --- a/docs/user-guide/command-line-interface.md +++ b/docs/user-guide/command-line-interface.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/command-line-interface.md --- - - -# Command Line Interface 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. diff --git a/docs/user-guide/configuring/README.md b/docs/user-guide/configuring/README.md index 2d22421e0c..0b491c4c99 100644 --- a/docs/user-guide/configuring/README.md +++ b/docs/user-guide/configuring/README.md @@ -1,52 +1,56 @@ -# Configuring ESLint +--- +title: Configuring ESLint +layout: doc +edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/configuring/README.md +--- 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 an [`.eslintrc.*`](./configuration-files.md#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 an [`.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). Here are some of the options that you can configure in ESLint: -* [**Environments**](./language-options.md#specifying-environments) - which environments your script is designed to run in. Each environment brings with it a certain set of predefined global variables. -* [**Globals**](./language-options.md#specifying-globals) - the additional global variables your script accesses during execution. -* [**Rules**](rules.md) - which rules are enabled and at what error level. -* [**Plugins**](plugins.md) - which third-party plugins define additional rules, environments, configs, etc. for ESLint to use. +* [**Environments**](./language-options#specifying-environments) - which environments your script is designed to run in. Each environment brings with it a certain set of predefined global variables. +* [**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. All of these options give you fine-grained control over how ESLint treats your code. ## Table of Contents -[**Configuration Files**](configuration-files.md) +[**Configuration Files**](configuration-files) -* [Configuration File Formats](./configuration-files.md#configuration-file-formats) -* [Using Configuration Files](./configuration-files.md#using-configuration-files) -* [Adding Shared Settings](./configuration-files.md#adding-shared-settings) -* [Cascading and Hierarchy](./configuration-files.md#cascading-and-hierarchy) -* [Extending Configuration Files](./configuration-files.md#extending-configuration-files) -* [Configuration Based on Glob Patterns](./configuration-files.md#configuration-based-on-glob-patterns) -* [Personal Configuration Files](./configuration-files.md#personal-configuration-files-deprecated) +* [Configuration File Formats](./configuration-files#configuration-file-formats) +* [Using Configuration Files](./configuration-files#using-configuration-files) +* [Adding Shared Settings](./configuration-files#adding-shared-settings) +* [Cascading and Hierarchy](./configuration-files#cascading-and-hierarchy) +* [Extending Configuration Files](./configuration-files#extending-configuration-files) +* [Configuration Based on Glob Patterns](./configuration-files#configuration-based-on-glob-patterns) +* [Personal Configuration Files](./configuration-files#personal-configuration-files-deprecated) -[**Language Options**](language-options.md) +[**Language Options**](language-options) -* [Specifying Environments](./language-options.md#specifying-environments) -* [Specifying Globals](./language-options.md#specifying-globals) -* [Specifying Parser Options](./language-options.md#specifying-parser-options) +* [Specifying Environments](./language-options#specifying-environments) +* [Specifying Globals](./language-options#specifying-globals) +* [Specifying Parser Options](./language-options#specifying-parser-options) -[**Rules**](rules.md) +[**Rules**](rules) -* [Configuring Rules](./rules.md#configuring-rules) -* [Disabling Rules](./rules.md#disabling-rules) +* [Configuring Rules](./rules#configuring-rules) +* [Disabling Rules](./rules#disabling-rules) -[**Plugins**](plugins.md) +[**Plugins**](plugins) -* [Specifying Parser](./plugins.md#specifying-parser) -* [Specifying Processor](./plugins.md#specifying-processor) -* [Configuring Plugins](./plugins.md#configuring-plugins) +* [Specifying Parser](./plugins#specifying-parser) +* [Specifying Processor](./plugins#specifying-processor) +* [Configuring Plugins](./plugins#configuring-plugins) -[**Ignoring Code**](ignoring-code.md) +[**Ignoring Code**](ignoring-code) -* [`ignorePatterns` in Config Files](./ignoring-code.md#ignorepatterns-in-config-files) -* [The `.eslintignore` File](./ignoring-code.md#the-eslintignore-file) -* [Using an Alternate File](./ignoring-code.md#using-an-alternate-file) -* [Using eslintIgnore in package.json](./ignoring-code.md#using-eslintignore-in-packagejson) -* [Ignored File Warnings](./ignoring-code.md#ignored-file-warnings) +* [`ignorePatterns` in Config Files](./ignoring-code#ignorepatterns-in-config-files) +* [The `.eslintignore` File](./ignoring-code#the-eslintignore-file) +* [Using an Alternate File](./ignoring-code#using-an-alternate-file) +* [Using eslintIgnore in package.json](./ignoring-code#using-eslintignore-in-packagejson) +* [Ignored File Warnings](./ignoring-code#ignored-file-warnings) diff --git a/docs/user-guide/configuring/configuration-files.md b/docs/user-guide/configuring/configuration-files.md index f58f35fdb0..a21291a477 100644 --- a/docs/user-guide/configuring/configuration-files.md +++ b/docs/user-guide/configuring/configuration-files.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/configuring/configuration-files.md --- - - -# Configuration Files * [Configuration File Formats](#configuration-file-formats) * [Using Configuration Files](#using-configuration-files) diff --git a/docs/user-guide/configuring/ignoring-code.md b/docs/user-guide/configuring/ignoring-code.md index a35b7d7429..8aab1336b0 100644 --- a/docs/user-guide/configuring/ignoring-code.md +++ b/docs/user-guide/configuring/ignoring-code.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/configuring/ignoring-code.md --- - - -# Ignoring Code * [`ignorePatterns` in Config Files](#ignorepatterns-in-config-files) * [The `.eslintignore` File](#the-eslintignore-file) diff --git a/docs/user-guide/configuring/index.md b/docs/user-guide/configuring/index.md index 86162ba8d0..0b491c4c99 100644 --- a/docs/user-guide/configuring/index.md +++ b/docs/user-guide/configuring/index.md @@ -2,11 +2,7 @@ title: Configuring ESLint layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/configuring/README.md - --- - - -# Configuring ESLint 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: diff --git a/docs/user-guide/configuring/language-options.md b/docs/user-guide/configuring/language-options.md index bf23583b01..5523fbab55 100644 --- a/docs/user-guide/configuring/language-options.md +++ b/docs/user-guide/configuring/language-options.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/configuring/language-options.md --- - - -# Language Options * [Specifying Environments](#specifying-environments) * [Specifying Globals](#specifying-globals) diff --git a/docs/user-guide/configuring/plugins.md b/docs/user-guide/configuring/plugins.md index f9b69af9df..f56da1e2f8 100644 --- a/docs/user-guide/configuring/plugins.md +++ b/docs/user-guide/configuring/plugins.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/configuring/plugins.md --- - - -# Plugins * [Specifying Parser](#specifying-parser) * [Specifying Processor](#specifying-processor) diff --git a/docs/user-guide/configuring/rules.md b/docs/user-guide/configuring/rules.md index 5ac9533b59..36540ea3a9 100644 --- a/docs/user-guide/configuring/rules.md +++ b/docs/user-guide/configuring/rules.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/configuring/rules.md --- - - -# Rules * [Configuring Rules](#configuring-rules) * [Disabling Rules](#disabling-rules) diff --git a/docs/user-guide/formatters/html-formatter-example.html b/docs/user-guide/formatters/html-formatter-example.html index 0eec2a613f..b84ecfde0c 100644 --- a/docs/user-guide/formatters/html-formatter-example.html +++ b/docs/user-guide/formatters/html-formatter-example.html @@ -93,14 +93,14 @@

ESLint Report

- 9 problems (5 errors, 4 warnings) - Generated on Fri Apr 08 2022 17:27:23 GMT-0400 (Eastern Daylight Time) + 9 problems (5 errors, 4 warnings) - Generated on Wed Apr 20 2022 08:54:27 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/user-guide/formatters/index.md b/docs/user-guide/formatters/index.md index d6114949e1..4861edf18a 100644 --- a/docs/user-guide/formatters/index.md +++ b/docs/user-guide/formatters/index.md @@ -57,20 +57,20 @@ function addOne(i) { ### checkstyle ``` - + ``` ### compact ``` -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 1, col 10, Error - 'addOne' is defined but never used. (no-unused-vars) -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 2, col 9, Error - Use the isNaN function to compare with NaN. (use-isnan) -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 3, col 16, Error - Unexpected space before unary operator '++'. (space-unary-ops) -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 3, col 20, Warning - Missing semicolon. (semi) -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 4, col 12, Warning - Unnecessary 'else' after 'return'. (no-else-return) -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 5, col 1, Warning - Expected indentation of 8 spaces but found 6. (indent) -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 5, col 7, Error - Function 'addOne' expected a return value. (consistent-return) -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 5, col 13, Warning - Missing semicolon. (semi) -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 7, col 2, Error - Unnecessary semicolon. (no-extra-semi) +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js: line 1, col 10, Error - 'addOne' is defined but never used. (no-unused-vars) +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js: line 2, col 9, Error - Use the isNaN function to compare with NaN. (use-isnan) +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js: line 3, col 16, Error - Unexpected space before unary operator '++'. (space-unary-ops) +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js: line 3, col 20, Warning - Missing semicolon. (semi) +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js: line 4, col 12, Warning - Unnecessary 'else' after 'return'. (no-else-return) +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js: line 5, col 1, Warning - Expected indentation of 8 spaces but found 6. (indent) +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js: line 5, col 7, Error - Function 'addOne' expected a return value. (consistent-return) +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js: line 5, col 13, Warning - Missing semicolon. (semi) +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js: line 7, col 2, Error - Unnecessary semicolon. (no-extra-semi) 9 problems ``` @@ -80,33 +80,33 @@ function addOne(i) { ### jslint-xml ``` - + ``` ### json-with-metadata ``` -{"results":[{"filePath":"/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js","messages":[{"ruleId":"no-unused-vars","severity":2,"message":"'addOne' is defined but never used.","line":1,"column":10,"nodeType":"Identifier","messageId":"unusedVar","endLine":1,"endColumn":16},{"ruleId":"use-isnan","severity":2,"message":"Use the isNaN function to compare with NaN.","line":2,"column":9,"nodeType":"BinaryExpression","messageId":"comparisonWithNaN","endLine":2,"endColumn":17},{"ruleId":"space-unary-ops","severity":2,"message":"Unexpected space before unary operator '++'.","line":3,"column":16,"nodeType":"UpdateExpression","messageId":"unexpectedBefore","endLine":3,"endColumn":20,"fix":{"range":[57,58],"text":""}},{"ruleId":"semi","severity":1,"message":"Missing semicolon.","line":3,"column":20,"nodeType":"ReturnStatement","messageId":"missingSemi","endLine":4,"endColumn":1,"fix":{"range":[60,60],"text":";"}},{"ruleId":"no-else-return","severity":1,"message":"Unnecessary 'else' after 'return'.","line":4,"column":12,"nodeType":"BlockStatement","messageId":"unexpected","endLine":6,"endColumn":6,"fix":{"range":[0,94],"text":"function addOne(i) {\n if (i != NaN) {\n return i ++\n } \n return\n \n}"}},{"ruleId":"indent","severity":1,"message":"Expected indentation of 8 spaces but found 6.","line":5,"column":1,"nodeType":"Keyword","messageId":"wrongIndentation","endLine":5,"endColumn":7,"fix":{"range":[74,80],"text":" "}},{"ruleId":"consistent-return","severity":2,"message":"Function 'addOne' expected a return value.","line":5,"column":7,"nodeType":"ReturnStatement","messageId":"missingReturnValue","endLine":5,"endColumn":13},{"ruleId":"semi","severity":1,"message":"Missing semicolon.","line":5,"column":13,"nodeType":"ReturnStatement","messageId":"missingSemi","endLine":6,"endColumn":1,"fix":{"range":[86,86],"text":";"}},{"ruleId":"no-extra-semi","severity":2,"message":"Unnecessary semicolon.","line":7,"column":2,"nodeType":"EmptyStatement","messageId":"unexpected","endLine":7,"endColumn":3,"fix":{"range":[93,95],"text":"}"}}],"suppressedMessages":[],"errorCount":5,"fatalErrorCount":0,"warningCount":4,"fixableErrorCount":2,"fixableWarningCount":4,"source":"function addOne(i) {\n if (i != NaN) {\n return i ++\n } else {\n return\n }\n};"}],"metadata":{"rulesMeta":{"no-else-return":{"type":"suggestion","docs":{"description":"disallow `else` blocks after `return` statements in `if` statements","recommended":false,"url":"https://eslint.org/docs/rules/no-else-return"},"schema":[{"type":"object","properties":{"allowElseIf":{"type":"boolean","default":true}},"additionalProperties":false}],"fixable":"code","messages":{"unexpected":"Unnecessary 'else' after 'return'."}},"indent":{"type":"layout","docs":{"description":"enforce consistent indentation","recommended":false,"url":"https://eslint.org/docs/rules/indent"},"fixable":"whitespace","schema":[{"oneOf":[{"enum":["tab"]},{"type":"integer","minimum":0}]},{"type":"object","properties":{"SwitchCase":{"type":"integer","minimum":0,"default":0},"VariableDeclarator":{"oneOf":[{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},{"type":"object","properties":{"var":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"let":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"const":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]}},"additionalProperties":false}]},"outerIIFEBody":{"oneOf":[{"type":"integer","minimum":0},{"enum":["off"]}]},"MemberExpression":{"oneOf":[{"type":"integer","minimum":0},{"enum":["off"]}]},"FunctionDeclaration":{"type":"object","properties":{"parameters":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"body":{"type":"integer","minimum":0}},"additionalProperties":false},"FunctionExpression":{"type":"object","properties":{"parameters":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"body":{"type":"integer","minimum":0}},"additionalProperties":false},"StaticBlock":{"type":"object","properties":{"body":{"type":"integer","minimum":0}},"additionalProperties":false},"CallExpression":{"type":"object","properties":{"arguments":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]}},"additionalProperties":false},"ArrayExpression":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"ObjectExpression":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"ImportDeclaration":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"flatTernaryExpressions":{"type":"boolean","default":false},"offsetTernaryExpressions":{"type":"boolean","default":false},"ignoredNodes":{"type":"array","items":{"type":"string","not":{"pattern":":exit$"}}},"ignoreComments":{"type":"boolean","default":false}},"additionalProperties":false}],"messages":{"wrongIndentation":"Expected indentation of {{expected}} but found {{actual}}."}},"space-unary-ops":{"type":"layout","docs":{"description":"enforce consistent spacing before or after unary operators","recommended":false,"url":"https://eslint.org/docs/rules/space-unary-ops"},"fixable":"whitespace","schema":[{"type":"object","properties":{"words":{"type":"boolean","default":true},"nonwords":{"type":"boolean","default":false},"overrides":{"type":"object","additionalProperties":{"type":"boolean"}}},"additionalProperties":false}],"messages":{"unexpectedBefore":"Unexpected space before unary operator '{{operator}}'.","unexpectedAfter":"Unexpected space after unary operator '{{operator}}'.","unexpectedAfterWord":"Unexpected space after unary word operator '{{word}}'.","wordOperator":"Unary word operator '{{word}}' must be followed by whitespace.","operator":"Unary operator '{{operator}}' must be followed by whitespace.","beforeUnaryExpressions":"Space is required before unary expressions '{{token}}'."}},"semi":{"type":"layout","docs":{"description":"require or disallow semicolons instead of ASI","recommended":false,"url":"https://eslint.org/docs/rules/semi"},"fixable":"code","schema":{"anyOf":[{"type":"array","items":[{"enum":["never"]},{"type":"object","properties":{"beforeStatementContinuationChars":{"enum":["always","any","never"]}},"additionalProperties":false}],"minItems":0,"maxItems":2},{"type":"array","items":[{"enum":["always"]},{"type":"object","properties":{"omitLastInOneLineBlock":{"type":"boolean"}},"additionalProperties":false}],"minItems":0,"maxItems":2}]},"messages":{"missingSemi":"Missing semicolon.","extraSemi":"Extra semicolon."}},"consistent-return":{"type":"suggestion","docs":{"description":"require `return` statements to either always or never specify values","recommended":false,"url":"https://eslint.org/docs/rules/consistent-return"},"schema":[{"type":"object","properties":{"treatUndefinedAsUnspecified":{"type":"boolean","default":false}},"additionalProperties":false}],"messages":{"missingReturn":"Expected to return a value at the end of {{name}}.","missingReturnValue":"{{name}} expected a return value.","unexpectedReturnValue":"{{name}} expected no return value."}}}}} +{"results":[{"filePath":"C:\\Users\\nzaka\\projects\\eslint\\eslint\\fullOfProblems.js","messages":[{"ruleId":"no-unused-vars","severity":2,"message":"'addOne' is defined but never used.","line":1,"column":10,"nodeType":"Identifier","messageId":"unusedVar","endLine":1,"endColumn":16},{"ruleId":"use-isnan","severity":2,"message":"Use the isNaN function to compare with NaN.","line":2,"column":9,"nodeType":"BinaryExpression","messageId":"comparisonWithNaN","endLine":2,"endColumn":17},{"ruleId":"space-unary-ops","severity":2,"message":"Unexpected space before unary operator '++'.","line":3,"column":16,"nodeType":"UpdateExpression","messageId":"unexpectedBefore","endLine":3,"endColumn":20,"fix":{"range":[57,58],"text":""}},{"ruleId":"semi","severity":1,"message":"Missing semicolon.","line":3,"column":20,"nodeType":"ReturnStatement","messageId":"missingSemi","endLine":4,"endColumn":1,"fix":{"range":[60,60],"text":";"}},{"ruleId":"no-else-return","severity":1,"message":"Unnecessary 'else' after 'return'.","line":4,"column":12,"nodeType":"BlockStatement","messageId":"unexpected","endLine":6,"endColumn":6,"fix":{"range":[0,94],"text":"function addOne(i) {\n if (i != NaN) {\n return i ++\n } \n return\n \n}"}},{"ruleId":"indent","severity":1,"message":"Expected indentation of 8 spaces but found 6.","line":5,"column":1,"nodeType":"Keyword","messageId":"wrongIndentation","endLine":5,"endColumn":7,"fix":{"range":[74,80],"text":" "}},{"ruleId":"consistent-return","severity":2,"message":"Function 'addOne' expected a return value.","line":5,"column":7,"nodeType":"ReturnStatement","messageId":"missingReturnValue","endLine":5,"endColumn":13},{"ruleId":"semi","severity":1,"message":"Missing semicolon.","line":5,"column":13,"nodeType":"ReturnStatement","messageId":"missingSemi","endLine":6,"endColumn":1,"fix":{"range":[86,86],"text":";"}},{"ruleId":"no-extra-semi","severity":2,"message":"Unnecessary semicolon.","line":7,"column":2,"nodeType":"EmptyStatement","messageId":"unexpected","endLine":7,"endColumn":3,"fix":{"range":[93,95],"text":"}"}}],"suppressedMessages":[],"errorCount":5,"fatalErrorCount":0,"warningCount":4,"fixableErrorCount":2,"fixableWarningCount":4,"source":"function addOne(i) {\n if (i != NaN) {\n return i ++\n } else {\n return\n }\n};"}],"metadata":{"rulesMeta":{"no-else-return":{"type":"suggestion","docs":{"description":"disallow `else` blocks after `return` statements in `if` statements","recommended":false,"url":"https://eslint.org/docs/rules/no-else-return"},"schema":[{"type":"object","properties":{"allowElseIf":{"type":"boolean","default":true}},"additionalProperties":false}],"fixable":"code","messages":{"unexpected":"Unnecessary 'else' after 'return'."}},"indent":{"type":"layout","docs":{"description":"enforce consistent indentation","recommended":false,"url":"https://eslint.org/docs/rules/indent"},"fixable":"whitespace","schema":[{"oneOf":[{"enum":["tab"]},{"type":"integer","minimum":0}]},{"type":"object","properties":{"SwitchCase":{"type":"integer","minimum":0,"default":0},"VariableDeclarator":{"oneOf":[{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},{"type":"object","properties":{"var":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"let":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"const":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]}},"additionalProperties":false}]},"outerIIFEBody":{"oneOf":[{"type":"integer","minimum":0},{"enum":["off"]}]},"MemberExpression":{"oneOf":[{"type":"integer","minimum":0},{"enum":["off"]}]},"FunctionDeclaration":{"type":"object","properties":{"parameters":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"body":{"type":"integer","minimum":0}},"additionalProperties":false},"FunctionExpression":{"type":"object","properties":{"parameters":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"body":{"type":"integer","minimum":0}},"additionalProperties":false},"StaticBlock":{"type":"object","properties":{"body":{"type":"integer","minimum":0}},"additionalProperties":false},"CallExpression":{"type":"object","properties":{"arguments":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]}},"additionalProperties":false},"ArrayExpression":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"ObjectExpression":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"ImportDeclaration":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"flatTernaryExpressions":{"type":"boolean","default":false},"offsetTernaryExpressions":{"type":"boolean","default":false},"ignoredNodes":{"type":"array","items":{"type":"string","not":{"pattern":":exit$"}}},"ignoreComments":{"type":"boolean","default":false}},"additionalProperties":false}],"messages":{"wrongIndentation":"Expected indentation of {{expected}} but found {{actual}}."}},"space-unary-ops":{"type":"layout","docs":{"description":"enforce consistent spacing before or after unary operators","recommended":false,"url":"https://eslint.org/docs/rules/space-unary-ops"},"fixable":"whitespace","schema":[{"type":"object","properties":{"words":{"type":"boolean","default":true},"nonwords":{"type":"boolean","default":false},"overrides":{"type":"object","additionalProperties":{"type":"boolean"}}},"additionalProperties":false}],"messages":{"unexpectedBefore":"Unexpected space before unary operator '{{operator}}'.","unexpectedAfter":"Unexpected space after unary operator '{{operator}}'.","unexpectedAfterWord":"Unexpected space after unary word operator '{{word}}'.","wordOperator":"Unary word operator '{{word}}' must be followed by whitespace.","operator":"Unary operator '{{operator}}' must be followed by whitespace.","beforeUnaryExpressions":"Space is required before unary expressions '{{token}}'."}},"semi":{"type":"layout","docs":{"description":"require or disallow semicolons instead of ASI","recommended":false,"url":"https://eslint.org/docs/rules/semi"},"fixable":"code","schema":{"anyOf":[{"type":"array","items":[{"enum":["never"]},{"type":"object","properties":{"beforeStatementContinuationChars":{"enum":["always","any","never"]}},"additionalProperties":false}],"minItems":0,"maxItems":2},{"type":"array","items":[{"enum":["always"]},{"type":"object","properties":{"omitLastInOneLineBlock":{"type":"boolean"}},"additionalProperties":false}],"minItems":0,"maxItems":2}]},"messages":{"missingSemi":"Missing semicolon.","extraSemi":"Extra semicolon."}},"consistent-return":{"type":"suggestion","docs":{"description":"require `return` statements to either always or never specify values","recommended":false,"url":"https://eslint.org/docs/rules/consistent-return"},"schema":[{"type":"object","properties":{"treatUndefinedAsUnspecified":{"type":"boolean","default":false}},"additionalProperties":false}],"messages":{"missingReturn":"Expected to return a value at the end of {{name}}.","missingReturnValue":"{{name}} expected a return value.","unexpectedReturnValue":"{{name}} expected no return value."}}}}} ``` ### json ``` -[{"filePath":"/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js","messages":[{"ruleId":"no-unused-vars","severity":2,"message":"'addOne' is defined but never used.","line":1,"column":10,"nodeType":"Identifier","messageId":"unusedVar","endLine":1,"endColumn":16},{"ruleId":"use-isnan","severity":2,"message":"Use the isNaN function to compare with NaN.","line":2,"column":9,"nodeType":"BinaryExpression","messageId":"comparisonWithNaN","endLine":2,"endColumn":17},{"ruleId":"space-unary-ops","severity":2,"message":"Unexpected space before unary operator '++'.","line":3,"column":16,"nodeType":"UpdateExpression","messageId":"unexpectedBefore","endLine":3,"endColumn":20,"fix":{"range":[57,58],"text":""}},{"ruleId":"semi","severity":1,"message":"Missing semicolon.","line":3,"column":20,"nodeType":"ReturnStatement","messageId":"missingSemi","endLine":4,"endColumn":1,"fix":{"range":[60,60],"text":";"}},{"ruleId":"no-else-return","severity":1,"message":"Unnecessary 'else' after 'return'.","line":4,"column":12,"nodeType":"BlockStatement","messageId":"unexpected","endLine":6,"endColumn":6,"fix":{"range":[0,94],"text":"function addOne(i) {\n if (i != NaN) {\n return i ++\n } \n return\n \n}"}},{"ruleId":"indent","severity":1,"message":"Expected indentation of 8 spaces but found 6.","line":5,"column":1,"nodeType":"Keyword","messageId":"wrongIndentation","endLine":5,"endColumn":7,"fix":{"range":[74,80],"text":" "}},{"ruleId":"consistent-return","severity":2,"message":"Function 'addOne' expected a return value.","line":5,"column":7,"nodeType":"ReturnStatement","messageId":"missingReturnValue","endLine":5,"endColumn":13},{"ruleId":"semi","severity":1,"message":"Missing semicolon.","line":5,"column":13,"nodeType":"ReturnStatement","messageId":"missingSemi","endLine":6,"endColumn":1,"fix":{"range":[86,86],"text":";"}},{"ruleId":"no-extra-semi","severity":2,"message":"Unnecessary semicolon.","line":7,"column":2,"nodeType":"EmptyStatement","messageId":"unexpected","endLine":7,"endColumn":3,"fix":{"range":[93,95],"text":"}"}}],"suppressedMessages":[],"errorCount":5,"fatalErrorCount":0,"warningCount":4,"fixableErrorCount":2,"fixableWarningCount":4,"source":"function addOne(i) {\n if (i != NaN) {\n return i ++\n } else {\n return\n }\n};"}] +[{"filePath":"C:\\Users\\nzaka\\projects\\eslint\\eslint\\fullOfProblems.js","messages":[{"ruleId":"no-unused-vars","severity":2,"message":"'addOne' is defined but never used.","line":1,"column":10,"nodeType":"Identifier","messageId":"unusedVar","endLine":1,"endColumn":16},{"ruleId":"use-isnan","severity":2,"message":"Use the isNaN function to compare with NaN.","line":2,"column":9,"nodeType":"BinaryExpression","messageId":"comparisonWithNaN","endLine":2,"endColumn":17},{"ruleId":"space-unary-ops","severity":2,"message":"Unexpected space before unary operator '++'.","line":3,"column":16,"nodeType":"UpdateExpression","messageId":"unexpectedBefore","endLine":3,"endColumn":20,"fix":{"range":[57,58],"text":""}},{"ruleId":"semi","severity":1,"message":"Missing semicolon.","line":3,"column":20,"nodeType":"ReturnStatement","messageId":"missingSemi","endLine":4,"endColumn":1,"fix":{"range":[60,60],"text":";"}},{"ruleId":"no-else-return","severity":1,"message":"Unnecessary 'else' after 'return'.","line":4,"column":12,"nodeType":"BlockStatement","messageId":"unexpected","endLine":6,"endColumn":6,"fix":{"range":[0,94],"text":"function addOne(i) {\n if (i != NaN) {\n return i ++\n } \n return\n \n}"}},{"ruleId":"indent","severity":1,"message":"Expected indentation of 8 spaces but found 6.","line":5,"column":1,"nodeType":"Keyword","messageId":"wrongIndentation","endLine":5,"endColumn":7,"fix":{"range":[74,80],"text":" "}},{"ruleId":"consistent-return","severity":2,"message":"Function 'addOne' expected a return value.","line":5,"column":7,"nodeType":"ReturnStatement","messageId":"missingReturnValue","endLine":5,"endColumn":13},{"ruleId":"semi","severity":1,"message":"Missing semicolon.","line":5,"column":13,"nodeType":"ReturnStatement","messageId":"missingSemi","endLine":6,"endColumn":1,"fix":{"range":[86,86],"text":";"}},{"ruleId":"no-extra-semi","severity":2,"message":"Unnecessary semicolon.","line":7,"column":2,"nodeType":"EmptyStatement","messageId":"unexpected","endLine":7,"endColumn":3,"fix":{"range":[93,95],"text":"}"}}],"suppressedMessages":[],"errorCount":5,"fatalErrorCount":0,"warningCount":4,"fixableErrorCount":2,"fixableWarningCount":4,"source":"function addOne(i) {\n if (i != NaN) {\n return i ++\n } else {\n return\n }\n};"}] ``` ### junit ``` - - - - - - - - - - + + + + + + + + + + @@ -115,7 +115,7 @@ function addOne(i) { ### stylish ``` -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js 1:10 error 'addOne' is defined but never used no-unused-vars 2:9 error Use the isNaN function to compare with NaN use-isnan 3:16 error Unexpected space before unary operator '++' space-unary-ops @@ -135,7 +135,7 @@ function addOne(i) { ``` TAP version 13 1..1 -not ok 1 - /var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js +not ok 1 - C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js --- message: '''addOne'' is defined but never used.' severity: error @@ -198,30 +198,30 @@ not ok 1 - /var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProbl ### unix ``` -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:1:10: 'addOne' is defined but never used. [Error/no-unused-vars] -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:2:9: Use the isNaN function to compare with NaN. [Error/use-isnan] -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:3:16: Unexpected space before unary operator '++'. [Error/space-unary-ops] -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:3:20: Missing semicolon. [Warning/semi] -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:4:12: Unnecessary 'else' after 'return'. [Warning/no-else-return] -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:5:1: Expected indentation of 8 spaces but found 6. [Warning/indent] -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:5:7: Function 'addOne' expected a return value. [Error/consistent-return] -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:5:13: Missing semicolon. [Warning/semi] -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:7:2: Unnecessary semicolon. [Error/no-extra-semi] +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js:1:10: 'addOne' is defined but never used. [Error/no-unused-vars] +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js:2:9: Use the isNaN function to compare with NaN. [Error/use-isnan] +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js:3:16: Unexpected space before unary operator '++'. [Error/space-unary-ops] +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js:3:20: Missing semicolon. [Warning/semi] +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js:4:12: Unnecessary 'else' after 'return'. [Warning/no-else-return] +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js:5:1: Expected indentation of 8 spaces but found 6. [Warning/indent] +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js:5:7: Function 'addOne' expected a return value. [Error/consistent-return] +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js:5:13: Missing semicolon. [Warning/semi] +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js:7:2: Unnecessary semicolon. [Error/no-extra-semi] 9 problems ``` ### visualstudio ``` -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(1,10): error no-unused-vars : 'addOne' is defined but never used. -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(2,9): error use-isnan : Use the isNaN function to compare with NaN. -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(3,16): error space-unary-ops : Unexpected space before unary operator '++'. -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(3,20): warning semi : Missing semicolon. -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(4,12): warning no-else-return : Unnecessary 'else' after 'return'. -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(5,1): warning indent : Expected indentation of 8 spaces but found 6. -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(5,7): error consistent-return : Function 'addOne' expected a return value. -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(5,13): warning semi : Missing semicolon. -/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(7,2): error no-extra-semi : Unnecessary semicolon. +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js(1,10): error no-unused-vars : 'addOne' is defined but never used. +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js(2,9): error use-isnan : Use the isNaN function to compare with NaN. +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js(3,16): error space-unary-ops : Unexpected space before unary operator '++'. +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js(3,20): warning semi : Missing semicolon. +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js(4,12): warning no-else-return : Unnecessary 'else' after 'return'. +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js(5,1): warning indent : Expected indentation of 8 spaces but found 6. +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js(5,7): error consistent-return : Function 'addOne' expected a return value. +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js(5,13): warning semi : Missing semicolon. +C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js(7,2): error no-extra-semi : Unnecessary semicolon. 9 problems ``` diff --git a/docs/user-guide/getting-started.md b/docs/user-guide/getting-started.md index 0cc0975aa2..3e9fcd2b5e 100644 --- a/docs/user-guide/getting-started.md +++ b/docs/user-guide/getting-started.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/getting-started.md --- - - -# Getting Started with ESLint ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code, with the goal of making code more consistent and avoiding bugs. In many ways, it is similar to JSLint and JSHint with a few exceptions: diff --git a/docs/user-guide/index.md b/docs/user-guide/index.md index c183340355..fd935711dd 100644 --- a/docs/user-guide/index.md +++ b/docs/user-guide/index.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/README.md --- - - -# User Guide This guide is intended for those who wish to use ESLint as an end-user. If you're looking for how to extend ESLint or work with the ESLint source code, please see the [Developer Guide](../developer-guide). diff --git a/docs/user-guide/integrations.md b/docs/user-guide/integrations.md index 46f0e0830f..6f5c809c9a 100644 --- a/docs/user-guide/integrations.md +++ b/docs/user-guide/integrations.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/integrations.md --- - - -# Integrations ## Editors diff --git a/docs/user-guide/migrating-from-jscs.md b/docs/user-guide/migrating-from-jscs.md index 132916300f..c25af45665 100644 --- a/docs/user-guide/migrating-from-jscs.md +++ b/docs/user-guide/migrating-from-jscs.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/migrating-from-jscs.md --- - - -# Migrating from JSCS In April 2016, we [announced](https://eslint.org/blog/2016/04/welcoming-jscs-to-eslint) that the JSCS project was shutting down and the JSCS team would be joining the ESLint team. This guide is intended to help those who are using JSCS to migrate their settings and projects to use ESLint. We've tried to automate as much of the conversion as possible, but there are some manual changes that are needed. diff --git a/docs/user-guide/migrating-to-1.0.0.md b/docs/user-guide/migrating-to-1.0.0.md index 86e148f34f..f71b428ed7 100644 --- a/docs/user-guide/migrating-to-1.0.0.md +++ b/docs/user-guide/migrating-to-1.0.0.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/migrating-to-1.0.0.md --- - - -# Migrating to v1.0.0 ESLint v1.0.0 is the first major version release. As a result, there are some significant changes between how ESLint worked during its life in 0.x and how it will work going forward. These changes are the direct result of feedback from the ESLint community of users and were not made without due consideration for the upgrade path. We believe that these changes make ESLint even better, and while some work is necessary to upgrade, we hope the pain of this upgrade is small enough that you will see the benefit of upgrading. diff --git a/docs/user-guide/migrating-to-2.0.0.md b/docs/user-guide/migrating-to-2.0.0.md index 44725171e2..aa216aa3f4 100644 --- a/docs/user-guide/migrating-to-2.0.0.md +++ b/docs/user-guide/migrating-to-2.0.0.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/migrating-to-2.0.0.md --- - - -# Migrating to v2.0.0 ESLint v2.0.0 is the second major version release. As a result, there are some significant changes between how ESLint worked during its life in 0.x and 1.x and how it will work going forward. These changes are the direct result of feedback from the ESLint community of users and were not made without due consideration for the upgrade path. We believe that these changes make ESLint even better, and while some work is necessary to upgrade, we hope the pain of this upgrade is small enough that you will see the benefit of upgrading. diff --git a/docs/user-guide/migrating-to-3.0.0.md b/docs/user-guide/migrating-to-3.0.0.md index 16c062c97b..8435e28ebb 100644 --- a/docs/user-guide/migrating-to-3.0.0.md +++ b/docs/user-guide/migrating-to-3.0.0.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/migrating-to-3.0.0.md --- - - -# Migrating to v3.0.0 ESLint v3.0.0 is the third major version release. We have made several breaking changes in this release, however, we believe the changes to be small enough that they should not require significant changes for ESLint users. This guide is intended to walk you through the changes. diff --git a/docs/user-guide/migrating-to-4.0.0.md b/docs/user-guide/migrating-to-4.0.0.md index 5d5d0a084f..cef90a3ddc 100644 --- a/docs/user-guide/migrating-to-4.0.0.md +++ b/docs/user-guide/migrating-to-4.0.0.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/migrating-to-4.0.0.md --- - - -# Migrating to v4.0.0 ESLint v4.0.0 is the fourth major version release. We have made several breaking changes in this release; however, we expect that most of the changes will only affect a very small percentage of users. This guide is intended to walk you through the changes. diff --git a/docs/user-guide/migrating-to-5.0.0.md b/docs/user-guide/migrating-to-5.0.0.md index d61f9238c1..0bddbe1dcb 100644 --- a/docs/user-guide/migrating-to-5.0.0.md +++ b/docs/user-guide/migrating-to-5.0.0.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/migrating-to-5.0.0.md --- - - -# Migrating to v5.0.0 ESLint v5.0.0 is the fifth major version release. We have made a few breaking changes in this release, but we expect that most users will be able to upgrade without any modifications to their build. This guide is intended to walk you through the breaking changes. diff --git a/docs/user-guide/migrating-to-6.0.0.md b/docs/user-guide/migrating-to-6.0.0.md index b16f530661..14cc7d868c 100644 --- a/docs/user-guide/migrating-to-6.0.0.md +++ b/docs/user-guide/migrating-to-6.0.0.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/migrating-to-6.0.0.md --- - - -# Migrating to v6.0.0 ESLint v6.0.0 is a major release of ESLint. We have made a few breaking changes in this release. This guide is intended to walk you through the breaking changes. diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 2c4f87c951..b04b143f23 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/migrating-to-7.0.0.md --- - - -# Migrating to v7.0.0 ESLint v7.0.0 is a major release of ESLint. We have made a few breaking changes in this release. This guide is intended to walk you through the breaking changes. diff --git a/docs/user-guide/migrating-to-8.0.0.md b/docs/user-guide/migrating-to-8.0.0.md index 51968ffb9d..ea3457ff05 100644 --- a/docs/user-guide/migrating-to-8.0.0.md +++ b/docs/user-guide/migrating-to-8.0.0.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/migrating-to-8.0.0.md --- - - -# Migrating to v8.0.0 ESLint v8.0.0 is a major release of ESLint. We have made a few breaking changes in this release. This guide is intended to walk you through the breaking changes. diff --git a/docs/user-guide/rule-deprecation.md b/docs/user-guide/rule-deprecation.md index 6f4335420b..2b92947318 100644 --- a/docs/user-guide/rule-deprecation.md +++ b/docs/user-guide/rule-deprecation.md @@ -4,9 +4,6 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/user-guide/rule-deprecation.md --- - - -# Rule Deprecation Balancing the trade-offs of improving a tool and the frustration these changes can cause is a difficult task. One key area in which this affects our users is in the removal of rules.
- [+] /var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js + [+] C:\Users\nzaka\projects\eslint\eslint\fullOfProblems.js 9 problems (5 errors, 4 warnings)