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: Automate the Options heading in rule docs pages #5058

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updating
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

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

Suggested Changes

Right now, rules pages manually include their options according to a light spattering of tests (#4367). But the part of theOptions section that includes the opening sentence(s) & code block description of the options can be generated using the rule's schema and/or code source.

Some rules, such ashttps://typescript-eslint.io/rules/adjacent-overload-signatures, have no options. They're the easier case.

Other rules, such ashttps://typescript-eslint.io/rules/array-type, have an options type, some ancillary type alias(es), and aconst defaultOptions: Options = { ... };.

There are a few reasonable starting possibilities for how we could automate the creation of those options docs:

  • Base them purely on the rule'smeta.schema[0]
    • Upside: simplest, and most portable (we could make a utility library for it!)
    • Downside: some values might get duplicated (would we have to add logic to dedup?)
  • Base them on the types & interfaces used in the rule's source file
    • Upside: matches the internal implementation closer
    • Downside: do we want it to match the internal implementation? and, is much more complicated
  • Some combination of both

My proposal would be to base them purely on the rule's meta and see how that looks.

Affected URL(s)

https://typescript-eslint.io/rules/*

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updating

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp