Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore(website): generate rule docs h1 and description automatically#5249

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/TEMPLATE.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `your-rule-name`
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@armano2 starting a thread for#5249 (comment):

I think the idea is that the docs should not be viewed on GitHub but should be as maintainable as possible.

if that is a case than we should move it out of eslint-plugin to docs

I think I agree, it would be best long term to have these docs files in the docs area. But: the old .md files still have much better SEO than the site. We can't move them all-up just yet. The most we could do would be to leave a .md file in the old location with just the redirect notice.

What would you prefer I do in this PR? I don't have strong feelings one way or another, as long as we're moving towards automating more of the rule docs pages.

Copy link
Member

Choose a reason for hiding this comment

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

Personally - I think it's still a good idea to co-locate them with the plugin - that way they're easy to find and update for contributors.

Copy link
Member

Choose a reason for hiding this comment

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

I am 100% behind treating the .md files in the repo as source code for most things (i.e. users shouldn't read them).
It's what I said a year ago with the first versions of the website!

Also LMAO I had a different opinion back then about where to put the files:

TBH - I also don't see any tangible value in co-locating the docs with the packages.

So I'll say - I don't mind either way. As long as we keep things clearly documented for contributors (i.e. tests to fail if they've not been added, or not been deleted) - then it shouldn't matter.


Yourrule description here.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/your-rule-name** for documentation.

## Rule Details

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `adjacent-overload-signatures`

Requires that member overloads be consecutive.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/adjacent-overload-signatures** for documentation.

Grouping overloaded members together can improve readability of the code.

Expand Down
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/array-type.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `array-type`

Requires using either `T[]` or `Array<T>`forarrays.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/array-type**fordocumentation.

Using the same style for array definitions across your codebase makes it easier for your developers to read and understand the types.

Expand Down
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/await-thenable.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `await-thenable`

Disallows awaiting a value that is not a Thenable.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/await-thenable** for documentation.

This rule disallows awaiting a value that is not a "Thenable" (an object which has `then` method, such as a Promise).
While it is valid JavaScript to await a non-`Promise`-like value (it will resolve immediately), this pattern is often a programmer error, such as forgetting to add parenthesis to call a function that returns a Promise.
Expand Down
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/ban-ts-comment.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `ban-ts-comment`

Disallows `@ts-<directive>` comments or requires descriptions after directive.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/ban-ts-comment** for documentation.

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
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/ban-tslint-comment.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `ban-tslint-comment`

Disallows `//tslint:<rule-flag>` comments.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/ban-tslint-comment** for documentation.

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

Expand Down
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/ban-types.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `ban-types`

Disallows certaintypes.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/ban-types** for documentation.

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
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/brace-style.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `brace-style`

Enforces consistentbracestyle forblocks.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/brace-style** fordocumentation.

## Rule Details

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `class-literal-property-style`

Enforces that literals on classes are exposed in a consistent style.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/class-literal-property-style** for documentation.

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
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/comma-dangle.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `comma-dangle`

Requires or disallows trailing commas.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/comma-dangle** for documentation.

## Rule Details

Expand Down
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/comma-spacing.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `comma-spacing`

Enforces consistentspacing before and after commas.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/comma-spacing** for documentation.

## Rule Details

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `consistent-generic-constructors`

Enforces specifyinggeneric type arguments on type annotation or constructor name of a constructor call.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/consistent-generic-constructors** for documentation.

When constructing a generic class, you can specify the type arguments on either the left-hand side (as a type annotation) or the right-hand side (as part of the constructor call):

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `consistent-indexed-object-style`

Requires or disallows the `Record` type.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/consistent-indexed-object-style** for documentation.

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
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `consistent-type-assertions`

Enforces consistent usage oftypeassertions.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/consistent-type-assertions** for documentation.

## Rule Details

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `consistent-type-definitions`

Enforces typedefinitions to consistently use either `interface` or `type`.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/consistent-type-definitions** for documentation.

There are two ways to define a type.

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `consistent-type-exports`

Enforces consistent usage oftypeexports.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/consistent-type-exports** for documentation.

TypeScript 3.8 added support for type-only exports.

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `consistent-type-imports`

Enforces consistent usage oftypeimports.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/consistent-type-imports** for documentation.

TypeScript 3.8 added support for type-only imports.
Type-only imports allow you to specify that an import can only be used in a type location, allowing certain optimizations within compilers.
Expand Down
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/default-param-last.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `default-param-last`

Enforcesdefault parameters to be last.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/default-param-last** for documentation.

## Rule Details

Expand Down
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/dot-notation.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `dot-notation`

Enforces dotnotation whenever possible.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/dot-notation** for documentation.

## Rule Details

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `explicit-function-return-type`

Requires explicitreturn types on functions and class methods.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/explicit-function-return-type** for documentation.

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
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `explicit-member-accessibility`

Requires explicitaccessibility modifiers on class properties and methods.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/explicit-member-accessibility** for documentation.

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

Requires explicit return and argumenttypes on exported functions' and classes' public class methods.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/explicit-module-boundary-types** for documentation.

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
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/func-call-spacing.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `func-call-spacing`

Requires or disallowsspacing between function identifiers and their invocations.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/func-call-spacing** for documentation.

## Rule Details

Expand Down
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/indent.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `indent`

Enforces consistent indentation.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/indent** for documentation.

## Warning

Expand Down
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/init-declarations.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `init-declarations`

Requires or disallows initialization in variable declarations.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/init-declarations** for documentation.

## Rule Details

Expand Down
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/keyword-spacing.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `keyword-spacing`

Enforces consistentspacing before and after keywords.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/keyword-spacing** for documentation.

## Rule Details

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `lines-between-class-members`

Requires or disallows an empty linebetweenclassmembers.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> 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 require or disallow an empty line between class members.

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `member-delimiter-style`

Requires a specificmemberdelimiterstyle forinterfaces and type literals.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/member-delimiter-style** fordocumentation.

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

Expand Down
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/member-ordering.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `member-ordering`

Requires a consistentmember declaration order.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/member-ordering** for documentation.

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
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `method-signature-style`

Enforces using a particularmethodsignature syntax.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/method-signature-style** for documentation.

There are two ways to define an object/interface function property.

Expand Down
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/naming-convention.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `naming-convention`

Enforcesnaming conventionsforeverything across a codebase.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/naming-convention**fordocumentation.

Enforcing naming conventions helps keep the codebase consistent, and reduces overhead when thinking about how to name a variable.
Additionally, a well-designed style guide can help communicate intent, such as by enforcing all private properties begin with an `_`, and all global-level constants are written in `UPPER_CASE`.
Expand Down
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/no-array-constructor.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `no-array-constructor`

Disallows generic `Array` constructors.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/no-array-constructor** for documentation.

## Rule Details

Expand Down
4 changes: 3 additions & 1 deletionpackages/eslint-plugin/docs/rules/no-base-to-string.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
# `no-base-to-string`
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/no-base-to-string** for documentation.

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

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `no-confusing-non-null-assertion`

Disallowsnon-nullassertion in locations that may be confusing.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/no-confusing-non-null-assertion** for documentation.

## Rule Details

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `no-confusing-void-expression`

Requires expressions of typevoid to appear in statement position.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/no-confusing-void-expression** for documentation.

Returning the results of an expression whose type is void can be misleading.
Attempting to do so is likely a symptom of expecting a different return type from a function.
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `no-dupe-class-members`

Disallows duplicateclassmembers.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/no-dupe-class-members** for documentation.

## Rule Details

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `no-duplicate-enum-values`

Disallows duplicateenum member values.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/no-duplicate-enum-values** for documentation.

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
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/no-duplicate-imports.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `no-duplicate-imports`

Disallows duplicateimports.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/no-duplicate-imports** for documentation.

## DEPRECATED

Expand Down
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/no-dynamic-delete.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `no-dynamic-delete`

Disallows using the `delete` operator on computed key expressions.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/no-dynamic-delete** for documentation.

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

Expand Down
6 changes: 3 additions & 3 deletionspackages/eslint-plugin/docs/rules/no-empty-function.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# `no-empty-function`

Disallowsempty functions.
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/no-empty-function** for documentation.

## Rule Details

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp