Skip to content

Commit

Permalink
docs: remove unnecessary Examples headings from extension rule docs (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Jul 28, 2023
1 parent 1b8e0bc commit 6addee9
Show file tree
Hide file tree
Showing 38 changed files with 4 additions and 82 deletions.
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/block-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Disallow or enforce spaces inside of blocks after opening block an
>
> See **https://typescript-eslint.io/rules/block-spacing** for documentation.
## Examples

This rule extends the base [`eslint/block-spacing`](https://eslint.org/docs/rules/block-spacing) rule.
This version adds support for TypeScript related blocks (interfaces, object type literals and enums).
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/brace-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Enforce consistent brace style for blocks.'
>
> See **https://typescript-eslint.io/rules/brace-style** for documentation.
## Examples

This rule extends the base [`eslint/brace-style`](https://eslint.org/docs/rules/brace-style) rule.
It adds support for `enum`, `interface`, `namespace` and `module` declarations.
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/class-methods-use-this.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description: 'Enforce that class methods utilize `this`.'
>
> See **https://typescript-eslint.io/rules/class-methods-use-this** for documentation.
## Examples

This rule extends the base [`eslint/class-methods-use-this`](https://eslint.org/docs/rules/class-methods-use-this) rule.
It adds support for ignoring `override` methods or methods on classes that implement an interface.

Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/comma-dangle.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description: 'Require or disallow trailing commas.'
>
> See **https://typescript-eslint.io/rules/comma-dangle** for documentation.
## Examples

This rule extends the base [`eslint/comma-dangle`](https://eslint.org/docs/rules/comma-dangle) rule.
It adds support for TypeScript syntax.

Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/comma-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Enforce consistent spacing before and after commas.'
>
> See **https://typescript-eslint.io/rules/comma-spacing** for documentation.
## Examples

This rule extends the base [`eslint/comma-spacing`](https://eslint.org/docs/rules/comma-spacing) rule.
It adds support for trailing comma in a types parameters list.
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/default-param-last.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description: 'Enforce default parameters to be last.'
>
> See **https://typescript-eslint.io/rules/default-param-last** for documentation.
## Examples

This rule extends the base [`eslint/default-param-last`](https://eslint.org/docs/rules/default-param-last) rule.
It adds support for optional parameters.

Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/dot-notation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description: 'Enforce dot notation whenever possible.'
>
> See **https://typescript-eslint.io/rules/dot-notation** for documentation.
## Examples

This rule extends the base [`eslint/dot-notation`](https://eslint.org/docs/rules/dot-notation) rule.
It adds:

Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/func-call-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Require or disallow spacing between function identifiers and their
>
> See **https://typescript-eslint.io/rules/func-call-spacing** for documentation.
## Examples

This rule extends the base [`eslint/func-call-spacing`](https://eslint.org/docs/rules/func-call-spacing) rule.
It adds support for generic type parameters on function calls.
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/indent.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@ Please read [Issue #1824: Problems with the indent rule](https://github.com/type

:::

## Examples

This rule extends the base [`eslint/indent`](https://eslint.org/docs/rules/indent) rule.
It adds support for TypeScript nodes.
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/init-declarations.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Require or disallow initialization in variable declarations.'
>
> See **https://typescript-eslint.io/rules/init-declarations** for documentation.
## Examples

This rule extends the base [`eslint/init-declarations`](https://eslint.org/docs/rules/init-declarations) rule.
It adds support for TypeScript's `declare` variables.
4 changes: 1 addition & 3 deletions packages/eslint-plugin/docs/rules/key-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Enforce consistent spacing between property names and type annotat
>
> See **https://typescript-eslint.io/rules/key-spacing** for documentation.
## Examples

This rule extends the base [`eslint/key-spacing`](https://eslint.org/docs/rules/key-spacing) rule.
This version adds support for type annotations on interfaces, classes and type literals properties.
It adds support for type annotations on interfaces, classes and type literals properties.
4 changes: 1 addition & 3 deletions packages/eslint-plugin/docs/rules/keyword-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Enforce consistent spacing before and after keywords.'
>
> See **https://typescript-eslint.io/rules/keyword-spacing** for documentation.
## Examples

This rule extends the base [`eslint/keyword-spacing`](https://eslint.org/docs/rules/keyword-spacing) rule.
This version adds support for generic type parameters on function calls.
It adds support for generic type parameters on function calls.
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/lines-around-comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description: 'Require empty lines around comments.'
>
> See **https://typescript-eslint.io/rules/lines-around-comment** for documentation.
## Rule Details

This rule extends the base [`eslint/lines-around-comment`](https://eslint.org/docs/rules/lines-around-comment) rule.
It adds support for TypeScript syntax.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ description: 'Require or disallow an empty line between class members.'
>
> See **https://typescript-eslint.io/rules/lines-between-class-members** for documentation.
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 will require or disallow an empty line between class members.

## Examples

This rule extends the base [`eslint/lines-between-class-members`](https://eslint.org/docs/rules/lines-between-class-members) rule.
It adds support for ignoring overload methods in a class.

Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/no-array-constructor.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description: 'Disallow generic `Array` constructors.'
>
> See **https://typescript-eslint.io/rules/no-array-constructor** for documentation.
## Examples

This rule extends the base [`eslint/no-array-constructor`](https://eslint.org/docs/rules/no-array-constructor) rule.
It adds support for the generically typed `Array` constructor (`new Array<Foo>()`).

Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/no-dupe-class-members.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Disallow duplicate class members.'
>
> See **https://typescript-eslint.io/rules/no-dupe-class-members** for documentation.
## Examples

This rule extends the base [`eslint/no-dupe-class-members`](https://eslint.org/docs/rules/no-dupe-class-members) rule.
It adds support for TypeScript's method overload definitions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ TypeScript supports types ("constituents") within union and intersection types b
However, developers typically expect each constituent to be unique within its intersection or union.
Duplicate values make the code overly verbose and generally reduce readability.

## Rule Details

This rule disallows duplicate union or intersection constituents.
We consider types to be duplicate if they evaluate to the same result in the type system.
For example, given `type A = string` and `type T = string | A`, this rule would flag that `A` is the same type as `string`.
Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/no-empty-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description: 'Disallow empty functions.'
>
> See **https://typescript-eslint.io/rules/no-empty-function** for documentation.
## Examples

This rule extends the base [`eslint/no-empty-function`](https://eslint.org/docs/rules/no-empty-function) rule.
It adds support for handling TypeScript specific code that would otherwise trigger the rule.

Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/no-extra-parens.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Disallow unnecessary parentheses.'
>
> See **https://typescript-eslint.io/rules/no-extra-parens** for documentation.
## Examples

This rule extends the base [`eslint/no-extra-parens`](https://eslint.org/docs/rules/no-extra-parens) rule.
It adds support for TypeScript type assertions.
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/no-extra-semi.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Disallow unnecessary semicolons.'
>
> See **https://typescript-eslint.io/rules/no-extra-semi** for documentation.
## Examples

This rule extends the base [`eslint/no-extra-semi`](https://eslint.org/docs/rules/no-extra-semi) rule.
It adds support for class properties.
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/no-invalid-this.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Disallow `this` keywords outside of classes or class-like objects.
>
> See **https://typescript-eslint.io/rules/no-invalid-this** for documentation.
## Examples

This rule extends the base [`eslint/no-invalid-this`](https://eslint.org/docs/rules/no-invalid-this) rule.
It adds support for TypeScript's `this` parameters.
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/no-loop-func.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Disallow function declarations that contain unsafe references insi
>
> See **https://typescript-eslint.io/rules/no-loop-func** for documentation.
## Examples

This rule extends the base [`eslint/no-loop-func`](https://eslint.org/docs/rules/no-loop-func) rule.
It adds support for TypeScript types.
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/no-loss-of-precision.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Disallow literal numbers that lose precision.'
>
> See **https://typescript-eslint.io/rules/no-loss-of-precision** for documentation.
## Examples

This rule extends the base [`eslint/no-loss-of-precision`](https://eslint.org/docs/rules/no-loss-of-precision) rule.
It adds support for [numeric separators](https://github.com/tc39/proposal-numeric-separator).
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/no-magic-numbers.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description: 'Disallow magic numbers.'
>
> See **https://typescript-eslint.io/rules/no-magic-numbers** for documentation.
## Examples

This rule extends the base [`eslint/no-magic-numbers`](https://eslint.org/docs/rules/no-magic-numbers) rule.
It adds support for:

Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/no-redeclare.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description: 'Disallow variable redeclaration.'
>
> See **https://typescript-eslint.io/rules/no-redeclare** for documentation.
## Examples

This rule extends the base [`eslint/no-redeclare`](https://eslint.org/docs/rules/no-redeclare) rule.
It adds support for TypeScript function overloads, and declaration merging.

Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/no-restricted-imports.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description: 'Disallow specified modules when loaded by `import`.'
>
> See **https://typescript-eslint.io/rules/no-restricted-imports** for documentation.
## Examples

This rule extends the base [`eslint/no-restricted-imports`](https://eslint.org/docs/rules/no-restricted-imports) rule.

## Options
Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/no-shadow.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description: 'Disallow variable declarations from shadowing variables declared i
>
> See **https://typescript-eslint.io/rules/no-shadow** for documentation.
## Examples

This rule extends the base [`eslint/no-shadow`](https://eslint.org/docs/rules/no-shadow) rule.
It adds support for TypeScript's `this` parameters and global augmentation, and adds options for TypeScript features.

Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/no-unused-expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Disallow unused expressions.'
>
> See **https://typescript-eslint.io/rules/no-unused-expressions** for documentation.
## Examples

This rule extends the base [`eslint/no-unused-expressions`](https://eslint.org/docs/rules/no-unused-expressions) rule.
It adds support for optional call expressions `x?.()`, and directive in module declarations.
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/no-unused-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Disallow unused variables.'
>
> See **https://typescript-eslint.io/rules/no-unused-vars** for documentation.
## Examples

This rule extends the base [`eslint/no-unused-vars`](https://eslint.org/docs/rules/no-unused-vars) rule.
It adds support for TypeScript features, such as types.
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/no-use-before-define.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description: 'Disallow the use of variables before they are defined.'
>
> See **https://typescript-eslint.io/rules/no-use-before-define** for documentation.
## Examples

This rule extends the base [`eslint/no-use-before-define`](https://eslint.org/docs/rules/no-use-before-define) rule.
It adds support for `type`, `interface` and `enum` declarations.

Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/no-useless-constructor.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description: 'Disallow unnecessary constructors.'
>
> See **https://typescript-eslint.io/rules/no-useless-constructor** for documentation.
## Examples

This rule extends the base [`eslint/no-useless-constructor`](https://eslint.org/docs/rules/no-useless-constructor) rule.
It adds support for:

Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/object-curly-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Enforce consistent spacing inside braces.'
>
> See **https://typescript-eslint.io/rules/object-curly-spacing** for documentation.
## Examples

This rule extends the base [`eslint/object-curly-spacing`](https://eslint.org/docs/rules/object-curly-spacing) rule.
It adds support for TypeScript's object types.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description: 'Require or disallow padding lines between statements.'
>
> See **https://typescript-eslint.io/rules/padding-line-between-statements** for documentation.
## Examples

This rule extends the base [`eslint/padding-line-between-statements`](https://eslint.org/docs/rules/padding-line-between-statements) rule.
It adds support for TypeScript constructs such as `interface` and `type`.

Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/quotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Enforce the consistent use of either backticks, double, or single
>
> See **https://typescript-eslint.io/rules/quotes** for documentation.
## Examples

This rule extends the base [`eslint/quotes`](https://eslint.org/docs/rules/quotes) rule.
It adds support for TypeScript features which allow quoted names, but not backtick quoted names.
4 changes: 2 additions & 2 deletions packages/eslint-plugin/docs/rules/require-await.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ description: 'Disallow async functions which have no `await` expression.'
>
> See **https://typescript-eslint.io/rules/require-await** for documentation.
## Examples

This rule extends the base [`eslint/require-await`](https://eslint.org/docs/rules/require-await) rule.
It uses type information to add support for `async` functions that return a `Promise`.

## Examples

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

```ts
Expand Down
4 changes: 0 additions & 4 deletions packages/eslint-plugin/docs/rules/semi.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ description: 'Require or disallow semicolons instead of ASI.'
>
> See **https://typescript-eslint.io/rules/semi** for documentation.
This rule enforces consistent use of semicolons after statements.

## Examples

This rule extends the base [`eslint/semi`](https://eslint.org/docs/rules/semi) rule.
It adds support for TypeScript features that require semicolons.

Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/space-before-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description: 'Enforce consistent spacing before blocks.'
>
> See **https://typescript-eslint.io/rules/space-before-blocks** for documentation.
## Examples

This rule extends the base [`eslint/space-before-blocks`](https://eslint.org/docs/rules/space-before-blocks) rule.
It adds support for interfaces and enums.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ description: 'Enforce consistent spacing before function parenthesis.'
>
> See **https://typescript-eslint.io/rules/space-before-function-paren** for documentation.
## Examples

This rule extends the base [`eslint/space-before-function-paren`](https://eslint.org/docs/rules/space-before-function-paren) rule.
It adds support for generic type parameters on function calls.

0 comments on commit 6addee9

Please sign in to comment.