Skip to content

Commit

Permalink
docs: Remove duplicate rule descriptions (#16052)
Browse files Browse the repository at this point in the history
* chore: remove hardcoded markdown desc

* chore: capitalize rule description

* chore: capitalize rule description

* chore: removed unwanted changes

* docs: restore description in removed rules
  • Loading branch information
amareshsm committed Jun 30, 2022
1 parent b6aee95 commit 3ae0574
Show file tree
Hide file tree
Showing 576 changed files with 832 additions and 1,280 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Expand Up @@ -82,7 +82,7 @@ module.exports = {
"eslint-plugin/prefer-placeholders": "error",
"eslint-plugin/prefer-replace-text": "error",
"eslint-plugin/report-message-format": ["error", "[^a-z].*\\.$"],
"eslint-plugin/require-meta-docs-description": "error",
"eslint-plugin/require-meta-docs-description": ["error", { pattern: "^(Enforce|Require|Disallow)" }],
"internal-rules/no-invalid-meta": "error"
}
},
Expand Down
520 changes: 260 additions & 260 deletions docs/src/_data/rules.json

Large diffs are not rendered by default.

566 changes: 283 additions & 283 deletions docs/src/_data/rules_meta.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/src/rules/accessor-pairs.md
Expand Up @@ -12,7 +12,6 @@ further_reading:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects
---

Enforces getter/setter pairs in objects and classes.

It's a common mistake in JavaScript to create an object with just a setter for a property but never have a corresponding getter defined for it. Without a getter, you cannot read the property, so it ends up not being used.

Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/array-bracket-newline.md
Expand Up @@ -9,8 +9,6 @@ related_rules:



Enforces line breaks after opening and before closing array brackets.

A number of style guides require or disallow line breaks inside of array brackets.

## Rule Details
Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/array-bracket-spacing.md
Expand Up @@ -11,8 +11,6 @@ related_rules:



Disallows or enforce spaces inside of brackets.

A number of style guides require or disallow spaces between array brackets and other tokens. This rule
applies to both array literals and destructuring assignments (ECMAScript 6).

Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/array-callback-return.md
Expand Up @@ -5,7 +5,6 @@ edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/array-callb
rule_type: problem
---

Enforces return statements in callbacks of array's methods.

`Array` has several methods for filtering, mapping, and folding.
If we forget to write `return` statement in a callback of those, it's probably a mistake. If you don't want to use a return or don't need the returned results, consider using [.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) instead.
Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/array-element-newline.md
Expand Up @@ -16,8 +16,6 @@ related_rules:



Enforces line breaks between array elements.

A number of style guides require or disallow line breaks between array elements.

## Rule Details
Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/arrow-parens.md
Expand Up @@ -9,8 +9,6 @@ further_reading:



Requires parens in arrow function arguments.

Arrow functions can omit parentheses when they have exactly one parameter. In all other cases the parameter(s) must
be wrapped in parentheses. This rule enforces the consistent use of parentheses in arrow functions.

Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/arrow-spacing.md
Expand Up @@ -7,8 +7,6 @@ rule_type: layout



Requires space before/after arrow function's arrow.

This rule normalize style of spacing before/after an arrow function's arrow(`=>`).

```js
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/block-scoped-var.md
Expand Up @@ -8,7 +8,6 @@ further_reading:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var#var_hoisting
---

Enforces treating `var` as block scoped.

The `block-scoped-var` rule generates warnings when variables are used outside of the block in which they were defined. This emulates C-style block scope.

Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/block-spacing.md
Expand Up @@ -10,8 +10,6 @@ related_rules:



Disallows or enforces spaces inside of blocks after opening blocks and before closing blocks.

## Rule Details

This rule enforces consistent spacing inside an open block token and the next token on the same line. This rule also enforces consistent spacing inside a close block token and previous token on the same line.
Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/brace-style.md
Expand Up @@ -12,8 +12,6 @@ further_reading:



Enforces consistent brace style for blocks.

Brace style is closely related to [indent style](https://en.wikipedia.org/wiki/Indent_style) in programming and describes the placement of braces relative to their control statement and body. There are probably a dozen, if not more, brace styles in the world.

The *one true brace style* is one of the most common brace styles in JavaScript, in which the opening brace of a block is placed on the same line as its corresponding statement or declaration. For example:
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/callback-return.md
Expand Up @@ -10,7 +10,6 @@ further_reading:
- https://web.archive.org/web/20171224042620/https://docs.nodejitsu.com/articles/errors/what-are-the-error-conventions/
---

Enforces return after callback.

This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).

Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/camelcase.md
Expand Up @@ -5,7 +5,6 @@ edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/camelcase.m
rule_type: suggestion
---

Enforces camelcase naming convention.

When it comes to naming variables, style guides generally fall into one of two camps: camelcase (`variableName`) and underscores (`variable_name`). This rule focuses on using the camelcase approach. If your style guide calls for camelCasing your variable names, then this rule is for you!

Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/capitalized-comments.md
Expand Up @@ -7,8 +7,6 @@ rule_type: suggestion



Enforces or disallows capitalization of the first letter of a comment.

Comments are useful for leaving information for future developers. In order for that information to be useful and not distracting, it is sometimes desirable for comments to follow a particular style. One element of comment formatting styles is whether the first word of a comment should be capitalized or lowercase.

In general, no comment style is any more or less valid than any others, but many developers would agree that a consistent style can improve a project's maintainability.
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/class-methods-use-this.md
Expand Up @@ -8,7 +8,6 @@ further_reading:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static
---

Enforces that class methods utilize `this`.

If a class method does not use `this`, it can *sometimes* be made into a static function. If you do convert the method into a static function, instances of the class that call that particular method have to be converted to a static call as well (`MyClass.callStaticMethod()`)

Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/comma-dangle.md
Expand Up @@ -7,8 +7,6 @@ rule_type: layout



Requires or disallows trailing commas.

Trailing commas in object literals are valid according to the ECMAScript 5 (and ECMAScript 3!) spec. However, IE8 (when not in IE8 document mode) and below will throw an error when it encounters trailing commas in JavaScript.

```js
Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/comma-spacing.md
Expand Up @@ -19,8 +19,6 @@ further_reading:



Enforces spacing around commas.

Spacing around commas improves readability of a list of items. Although most of the style guidelines for languages prescribe adding a space after a comma and not before it, it is subjective to the preferences of a project.

```js
Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/comma-style.md
Expand Up @@ -11,8 +11,6 @@ further_reading:



Enforces consistent comma styles.

The Comma Style rule enforces styles for comma-separated lists. There are two comma styles primarily used in JavaScript:

* The standard style, in which commas are placed at the end of the current line
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/complexity.md
Expand Up @@ -19,7 +19,6 @@ further_reading:
- https://github.com/eslint/eslint/issues/4808#issuecomment-167795140
---

Enforces a maximum cyclomatic complexity.

Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/computed-property-spacing.md
Expand Up @@ -11,8 +11,6 @@ related_rules:



Disallows or enforces spaces inside of computed properties.

While formatting preferences are very personal, a number of style guides require
or disallow spaces between computed properties in the following situations:

Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/consistent-return.md
Expand Up @@ -5,7 +5,6 @@ edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/consistent-
rule_type: suggestion
---

Requires `return` statements to either always or never specify values.

Unlike statically-typed languages which enforce that a function returns a specified type of value, JavaScript allows different code paths in a function to return different types of values.

Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/consistent-this.md
Expand Up @@ -5,7 +5,6 @@ edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/consistent-
rule_type: suggestion
---

Enforces consistent naming when capturing the current execution context.

It is often necessary to capture the current execution context in order to make it available subsequently. A prominent example of this are jQuery callbacks:

Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/curly.md
Expand Up @@ -7,8 +7,6 @@ rule_type: suggestion



Requires following curly brace conventions.

JavaScript allows the omission of curly braces when a block contains only one statement. However, it is considered by many to be best practice to _never_ omit curly braces around blocks, even when they are optional, because it can lead to bugs and reduces code clarity. So the following:

```js
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/default-case-last.md
Expand Up @@ -9,7 +9,6 @@ further_reading:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch
---

Enforces default clauses in switch statements to be last.

A `switch` statement can optionally have a `default` clause.

Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/default-case.md
Expand Up @@ -7,7 +7,6 @@ related_rules:
- no-fallthrough
---

Requires a `default` case in switch statements.

Some code conventions require that all `switch` statements have a `default` case, even if the default case is empty, such as:

Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/default-param-last.md
Expand Up @@ -5,8 +5,6 @@ edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/default-par
rule_type: suggestion
---

Enforces default parameters to be last.

Putting default parameter at last allows function calls to omit optional tail arguments.

```js
Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/dot-location.md
Expand Up @@ -10,8 +10,6 @@ related_rules:



Enforces newline before and after dots.

JavaScript allows you to place newlines before or after a dot in a member expression.

Consistency in placing a newline before or after the dot can greatly increase readability.
Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/dot-notation.md
Expand Up @@ -7,8 +7,6 @@ rule_type: suggestion



Enforces dot notation whenever possible.

In JavaScript, one can access properties using the dot notation (`foo.bar`) or square-bracket notation (`foo["bar"]`). However, the dot notation is often preferred because it is easier to read, less verbose, and works better with aggressive JavaScript minimizers.

```js
Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/eol-last.md
Expand Up @@ -7,8 +7,6 @@ rule_type: layout



Requires or disallows newline at the end of files.

Trailing newlines in non-empty files are a common UNIX idiom. Benefits of
trailing newlines include the ability to concatenate or append to files as well
as output files to the terminal without interfering with shell prompts.
Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/eqeqeq.md
Expand Up @@ -7,8 +7,6 @@ rule_type: suggestion



Requires the use of `===` and `!==`.

It is considered good practice to use the type-safe equality operators `===` and `!==` instead of their regular counterparts `==` and `!=`.

The reason for this is that `==` and `!=` do type coercion which follows the rather obscure [Abstract Equality Comparison Algorithm](https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3).
Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/for-direction.md
Expand Up @@ -7,8 +7,6 @@ rule_type: problem



Enforces `for` loop update clause moving the counter in the right direction.

## Rule Details

A `for` loop with a stop condition that can never be reached, such as one with a counter that moves in the wrong direction, will run infinitely. While there are occasions when an infinite loop is intended, the convention is to construct such loops as `while` loops. More typically, an infinite for loop is a bug.
Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/func-call-spacing.md
Expand Up @@ -9,8 +9,6 @@ related_rules:



Requires or disallows spacing between function identifiers and their invocations.

When calling a function, developers may insert optional whitespace between the function's name and the parentheses that invoke it. The following pairs of function calls are equivalent:

```js
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/func-name-matching.md
Expand Up @@ -5,7 +5,6 @@ edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/func-name-m
rule_type: suggestion
---

Requires function names to match the name of the variable or property to which they are assigned.

## Rule Details

Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/func-names.md
Expand Up @@ -8,7 +8,6 @@ further_reading:
- https://2ality.com/2015/09/function-names-es6.html
---

Requires or disallows named `function` expressions.

A pattern that's becoming more common is to give function expressions names to aid in debugging. For example:

Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/func-style.md
Expand Up @@ -7,7 +7,6 @@ further_reading:
- https://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html
---

Enforces the consistent use of either `function` declarations or expressions.

There are two ways of defining functions in JavaScript: `function` declarations and `function` expressions. Declarations contain the `function` keyword first, followed by a name and then its arguments and the function body, for example:

Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/function-call-argument-newline.md
Expand Up @@ -12,8 +12,6 @@ related_rules:



Enforces line breaks between arguments of a function call.

A number of style guides require or disallow line breaks between arguments of a function call.

## Rule Details
Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/function-paren-newline.md
Expand Up @@ -7,8 +7,6 @@ rule_type: layout



Enforces consistent line breaks inside function parentheses.

Many style guides require or disallow newlines inside of function parentheses.

## Rule Details
Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/generator-star-spacing.md
Expand Up @@ -9,8 +9,6 @@ further_reading:



Enforces spacing around the `*` in generator functions.

Generators are a new type of function in ECMAScript 6 that can return multiple values over time.
These special functions are indicated by placing an `*` after the `function` keyword.

Expand Down
2 changes: 0 additions & 2 deletions docs/src/rules/getter-return.md
Expand Up @@ -10,8 +10,6 @@ further_reading:



Enforces that a `return` statement is present in property getters.

The get syntax binds an object property to a function that will be called when that property is looked up. It was first introduced in ECMAScript 5:

```js
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/global-require.md
Expand Up @@ -5,7 +5,6 @@ edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/global-requ
rule_type: suggestion
---

Enforces `require()` on the top-level module scope.

This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).

Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/grouped-accessor-pairs.md
Expand Up @@ -13,7 +13,6 @@ further_reading:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
---

Requires grouped accessor pairs in object literals and classes.

A getter and setter for the same property don't necessarily have to be defined adjacent to each other.

Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/guard-for-in.md
Expand Up @@ -10,7 +10,6 @@ further_reading:
- https://2ality.com/2012/01/objects-as-maps.html
---

Requires `for in` loops to include an `if` statement.

Looping over objects with a `for in` loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/handle-callback-err.md
Expand Up @@ -8,7 +8,6 @@ further_reading:
- https://web.archive.org/web/20171224042620/https://docs.nodejitsu.com/articles/errors/what-are-the-error-conventions/
---

Enforces callback error handling.

This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).

Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/id-blacklist.md
Expand Up @@ -5,6 +5,5 @@ edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/id-blacklis
rule_type: suggestion
---

Disallows specified identifiers.

This rule was **deprecated** in ESLint v7.5.0 and replaced by the [id-denylist](id-denylist) rule.
1 change: 0 additions & 1 deletion docs/src/rules/id-denylist.md
Expand Up @@ -5,7 +5,6 @@ edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/id-denylist
rule_type: suggestion
---

Disallows specified identifiers.

> "There are only two hard things in Computer Science: cache invalidation and naming things." — Phil Karlton
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/id-length.md
Expand Up @@ -10,7 +10,6 @@ related_rules:
- camelcase
---

Enforces minimum and maximum identifier lengths.

Very short identifier names like `e`, `x`, `_t` or very long ones like `hashGeneratorResultOutputContainerObject` can make code harder to read and potentially less maintainable. To prevent this, one may enforce a minimum and/or maximum identifier length.

Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/id-match.md
Expand Up @@ -5,7 +5,6 @@ edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/id-match.md
rule_type: suggestion
---

Requires identifiers to match a specified regular expression.

> "There are only two hard things in Computer Science: cache invalidation and naming things." — Phil Karlton
Expand Down

0 comments on commit 3ae0574

Please sign in to comment.