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

Docs: simplify array type declarations on rule pages #11117

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updatinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
@kirkwaiblinger

Description

@kirkwaiblinger

Before You File a Documentation Request Please Confirm You Have Done The Following...

Suggested Changes

Rather than a type declaration on the rule page like so...

typeOptions=[{/** Type specifiers of functions whose calls are safe to float. */allowForKnownSafeCalls?:(|{from:'file';name:[string, ...string[]]|string;path?:string;}|{from:'lib';name:[string, ...string[]]|string;}|{from:'package';name:[string, ...string[]]|string;package:string;}|string)[];},// ...];

...I'd prefer to see a type declaration like so:

typeOptions=[{/** Type specifiers of functions whose calls are safe to float. */allowForKnownSafeCalls?:(|{from:'file';name:string[]|string;path?:string;}|{from:'lib';name:string[]|string;}|{from:'package';name:string[]|string;package:string;}|string)[];},// ...];

While the non-empty-array-type pattern is more correct for runtime code, it negatively impacts the readability for documentation purposes.

I propose: let's use simpleT[] array types rather than[T, ...T[]] types for the documentation types only being read by humans.

Note that we can optionally add a "types simplified for clarity" caveat if we'd like. (random example of another doc site that adds such a caveat)

Affected URL(s)

http://typescript-eslint.io/rules/no-floating-promises#options

Additional Info

likely involves changes to rule-schema-to-typescript-types

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updatinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp