Repository navigation
v3.5.0
v3.5.0: New optional-parameter rule and imported-type name fixes
prefer-optional-parameter is a new rule that reports undefined in parameter unions. starts-with-verb and require-async-suffix no longer report object keys whose names an imported type dictates.
🚀 Added
- prefer-optional-parameter: The rule reports
undefinedin a parameter's type union, such asscenario: ScenarioId | undefined, and autofixes it toscenario?: ScenarioIdwhere TypeScript allows?; elsewhere, such as before a required parameter or on an accessor setter, it reports without a fix. - by @howmanysmall in #93
🐞 Fixed
- starts-with-verb: The rule no longer reports callback names in an object literal annotated with an imported type or asserted with
asor<T>to one, including through a local alias; names constrained only by local types still report. PreviouslyviteFinal(viteConfiguration): InlineConfig {...}inconst configuration: StorybookConfig = {...}reported. - by @howmanysmall in #92 - require-async-suffix: The rule no longer reports async methods in an object literal annotated with an imported type, including through a local alias; methods typed only by a local type still report. Previously
async getAll()in an object annotated with an importedServerConfigurationreported as missing theAsyncsuffix. - by @howmanysmall in #92
Full Changelog: v3.4.0...v3.5.0