Skip to content

docs(eslint-plugin): standardize rule description format #4976

New issue

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

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

Already on GitHub? Sign in to your account

Merged
194 changes: 97 additions & 97 deletions packages/eslint-plugin/README.md

Large diffs are not rendered by default.

196 changes: 97 additions & 99 deletions packages/eslint-plugin/docs/rules/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `adjacent-overload-signatures`

Require that member overloads be consecutive.
Requires that member overloads be consecutive.

Grouping overloaded members together can improve readability of the code.

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/ban-ts-comment.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `ban-ts-comment`

Bans `@ts-<directive>` comments from being used or requires descriptions after directive.
Disallows `@ts-<directive>` comments or requires descriptions after directive.

TypeScript provides several directive comments that can be used to alter how it processes files.
Using these to suppress TypeScript Compiler Errors reduces the effectiveness of TypeScript overall.
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/ban-tslint-comment.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `ban-tslint-comment`

Bans `// tslint:<rule-flag>` comments from being used.
Disallows `// tslint:<rule-flag>` comments.

Useful when migrating from TSLint to ESLint. Once TSLint has been removed, this rule helps locate TSLint annotations (e.g. `// tslint:disable`).

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/ban-types.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `ban-types`

Bans specific types from being used.
Disallows certain types.

Some builtin types have aliases, some types are considered dangerous or harmful.
It's often a good idea to ban certain types to help with consistency and safety.
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/brace-style.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `brace-style`

Enforce consistent brace style for blocks.
Enforces consistent brace style for blocks.

## Rule Details

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `class-literal-property-style`

Ensures that literals on classes are exposed in a consistent style.
Enforces that literals on classes are exposed in a consistent style.

When writing TypeScript applications, it's typically safe to store literal values on classes using fields with the `readonly` modifier to prevent them from being reassigned.
When writing TypeScript libraries that could be used by JavaScript users however, it's typically safer to expose these literals using `getter`s, since the `readonly` modifier is enforced at compile type.
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/comma-dangle.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `comma-dangle`

Require or disallow trailing comma.
Requires or disallows trailing commas.

## Rule Details

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `consistent-indexed-object-style`

Enforce or disallow the use of the record type.
Requires or disallows the `Record` type.

TypeScript supports defining object show keys can be flexible using an index signature. TypeScript also has a builtin type named `Record` to create an empty object defining only an index signature. For example, the following types are equal:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `consistent-type-definitions`

Consistent with type definition either `interface` or `type`.
Enforces type definitions to consistently use either `interface` or `type`.

There are two ways to define a type.

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/default-param-last.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `default-param-last`

Enforce default parameters to be last.
Enforces default parameters to be last.

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/dot-notation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `dot-notation`

enforce dot notation whenever possible.
Enforces dot notation whenever possible.

## Rule Details

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `explicit-function-return-type`

Require explicit return types on functions and class methods.
Requires explicit return types on functions and class methods.

Explicit types for function return values makes it clear to any calling code what type is returned.
This ensures that the return value is assigned to a variable of the correct type; or in the case
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `explicit-member-accessibility`

Require explicit accessibility modifiers on class properties and methods.
Requires explicit accessibility modifiers on class properties and methods.

Leaving off accessibility modifier and making everything public can make
your interface hard to use by others.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `explicit-module-boundary-types`

Require explicit return and argument types on exported functions' and classes' public class methods.
Requires explicit return and argument types on exported functions' and classes' public class methods.

Explicit types for function return values and arguments makes it clear to any calling code what is the module boundary's input and output.

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/func-call-spacing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `func-call-spacing`

Require or disallow spacing between function identifiers and their invocations.
Requires or disallows spacing between function identifiers and their invocations.

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/indent.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `indent`

Enforce consistent indentation.
Enforces consistent indentation.

## Warning

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/init-declarations.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `init-declarations`

require or disallow initialization in variable declarations.
Requires or disallows initialization in variable declarations.

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/keyword-spacing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `keyword-spacing`

Enforce consistent spacing before and after keywords.
Enforces consistent spacing before and after keywords.

## Rule Details

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `lines-between-class-members`

Require or disallow an empty line between class members.
Requires or disallows an empty line between class members.

This rule improves readability by enforcing lines between class members. It will not check empty lines before the first member and after the last member. This rule require or disallow an empty line between class members.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `member-delimiter-style`

Require a specific member delimiter style for interfaces and type literals.
Requires a specific member delimiter style for interfaces and type literals.

Enforces a consistent member delimiter style in interfaces and type literals. There are three member delimiter styles primarily used in TypeScript:

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/member-ordering.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `member-ordering`

Require a consistent member declaration order.
Requires a consistent member declaration order.

A consistent ordering of fields, methods and constructors can make interfaces, type literals, classes and class expressions easier to read, navigate, and edit.

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-array-constructor.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-array-constructor`

Disallow generic `Array` constructors.
Disallows generic `Array` constructors.

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-base-to-string.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-base-to-string`

Requires that `.toString()` is only called on objects which provide useful information when stringified.
Requires `.toString()` to only be called on objects which provide useful information when stringified.

JavaScript will call `toString()` on an object when it is converted to a string, such as when `+` adding to a string or in `${}` template literals.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-confusing-non-null-assertion`

Disallow non-null assertion in locations that may be confusing.
Disallows non-null assertion in locations that may be confusing.

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-dupe-class-members.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-dupe-class-members`

Disallow duplicate class members.
Disallows duplicate class members.

## Rule Details

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-duplicate-enum-values`

Disallow duplicate enum member values.
Disallows duplicate enum member values.

Although TypeScript supports duplicate enum member values, people usually expect members to have unique values within the same enum. Duplicate values can lead to bugs that are hard to track down.

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-duplicate-imports.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-duplicate-imports`

Disallow duplicate imports.
Disallows duplicate imports.

## DEPRECATED

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-dynamic-delete.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-dynamic-delete`

Disallow the delete operator with computed key expressions.
Disallows using the `delete` operator on computed key expressions.

Deleting dynamically computed keys can be dangerous and in some cases not well optimized.

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-empty-function.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-empty-function`

Disallow empty functions.
Disallows empty functions.

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-empty-interface.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-empty-interface`

Disallow the declaration of empty interfaces.
Disallows the declaration of empty interfaces.

An empty interface is equivalent to its supertype. If the interface does not implement a supertype, then
the interface is equivalent to an empty object (`{}`). In both cases it can be omitted.
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-explicit-any.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-explicit-any`

Disallow usage of the `any` type.
Disallows the `any` type.

Using the `any` type defeats the purpose of using TypeScript.
When `any` is used, all compiler type checks around that value are ignored.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-extra-non-null-assertion`

Disallow extra non-null assertion.
Disallows extra non-null assertion.

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-extra-parens.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-extra-parens`

Disallow unnecessary parentheses.
Disallows unnecessary parentheses.

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-extra-semi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-extra-semi`

Disallow unnecessary semicolons.
Disallows unnecessary semicolons.

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-extraneous-class.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-extraneous-class`

Forbids the use of classes as namespaces.
Disallows classes used as namespaces.

This rule warns when a class is accidentally used as a namespace.

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-for-in-array.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-for-in-array`

Disallow iterating over an array with a for-in loop.
Disallows iterating over an array with a for-in loop.

This rule prohibits iterating over an array with a for-in loop.

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-implicit-any-catch.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-implicit-any-catch`

Disallow usage of the implicit `any` type in catch clauses.
Disallows usage of the implicit `any` type in catch clauses.

TypeScript 4.0 added support for adding an explicit `any` or `unknown` type annotation on a catch clause variable.

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-implied-eval.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-implied-eval`

Disallow the use of `eval()`-like methods.
Disallows the use of `eval()`-like methods.

It's considered a good practice to avoid using `eval()`. There are security and performance implications involved with doing so, which is why many linters recommend disallowing `eval()`. However, there are some other ways to pass a string and have it interpreted as JavaScript code that have similar concerns.

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-invalid-this.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-invalid-this`

Disallow `this` keywords outside of classes or class-like objects.
Disallows `this` keywords outside of classes or class-like objects.

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-invalid-void-type.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-invalid-void-type`

Disallows usage of `void` type outside of generic or return types.
Disallows `void` type outside of generic or return types.

Disallows usage of `void` type outside of return types or generic type arguments.
If `void` is used as return type, it shouldn’t be a part of intersection/union type with most other types.
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-loop-func.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-loop-func`

Disallow function declarations that contain unsafe references inside loop statements.
Disallows function declarations that contain unsafe references inside loop statements.

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-loss-of-precision.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-loss-of-precision`

Disallow literal numbers that lose precision.
Disallows literal numbers that lose precision.

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-magic-numbers.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-magic-numbers`

Disallow magic numbers.
Disallows magic numbers.

## Rule Details

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# `no-meaningless-void-operator`

Disallow the `void` operator except when used to discard a value.
Disallows the `void` operator except when used to discard a value.

Disallow the `void` operator when its argument is already of type `void` or `undefined`.
Disallows the `void` operator when its argument is already of type `void` or `undefined`.

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-misused-new.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-misused-new`

Enforce valid definition of `new` and `constructor`.
Enforces valid definition of `new` and `constructor`.

Warns on apparent attempts to define constructors for interfaces or `new` for classes.

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-misused-promises.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-misused-promises`

Avoid using Promises in places not designed to handle them.
Disallows Promises in places not designed to handle them.

This rule forbids providing Promises to logical locations such as if statements in places where the TypeScript compiler allows them but they are not handled properly.
These situations can often arise due to a missing `await` keyword or just a misunderstanding of the way async
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-namespace.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-namespace`

Disallow the use of custom TypeScript modules and namespaces.
Disallows custom TypeScript modules and namespaces.

Custom TypeScript modules (`module foo {}`) and namespaces (`namespace foo {}`) are considered outdated
ways to organize TypeScript code. ES2015 module syntax is now preferred (`import`/`export`).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-non-null-asserted-nullish-coalescing`

Disallows using a non-null assertion in the left operand of the nullish coalescing operator.
Disallows non-null assertions in the left operand of a nullish coalescing operator.

## Rule Details

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `no-non-null-asserted-optional-chain`

Disallows using a non-null assertion after an optional chain expression.
Disallows non-null assertions after an optional chain expression.

## Rule Details

Expand Down
Loading