Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
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
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