Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
Before You File a Documentation Request Please Confirm You Have Done The Following...
- I have looked for existingopen or closed documentation requests that match my proposal.
- I haveread the FAQ and my problem is not listed.
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's
meta.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.