-
Notifications
You must be signed in to change notification settings - Fork 86
no-redundant-undefined: enforce undefined
for optional parameters
#335
Conversation
I'm going to wait to merge this until I can clean up DT to pass -- and I need to ship a new version of dtslint in a day or two for the beta before then. |
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers packages starting with x-. microsoft/dtslint#335
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers packages starting with w-. microsoft/dtslint#335
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers packages starting with x-. microsoft/dtslint#335
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers packages starting with v-. microsoft/dtslint#335
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers packages starting with v-. microsoft/dtslint#335
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers packages starting with u-. microsoft/dtslint#335
* Add undefined to optional properties, part W In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers packages starting with w-. microsoft/dtslint#335 * Update types/wordpress__block-editor/components/media-placeholder.d.ts dedupe multiple undefineds created by tslint --fix Co-authored-by: Piotr Błażejewicz (Peter Blazejewicz) <peterblazejewicz@users.noreply.github.com> Co-authored-by: Piotr Błażejewicz (Peter Blazejewicz) <peterblazejewicz@users.noreply.github.com>
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers packages starting with u-. microsoft/dtslint#335
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers packages starting with tl--ty-. microsoft/dtslint#335
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers packages starting with tf--ti-. microsoft/dtslint#335
* Add undefined to optional properties, part TL In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers packages starting with tl--ty-. microsoft/dtslint#335 * fix bad merge of typopo
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers packages starting with tf--ti-. microsoft/dtslint#335
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers widely used packages, those with more then 100,000 packages per month, from react-measure -- react-slick microsoft/dtslint#335
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers widely used packages, those with more then 100,000 packages per month, from react-slider -- regenerate microsoft/dtslint#335
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers widely used packages, those with more then 100,000 packages per month, from regenerator -- rimraf. microsoft/dtslint#335
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers widely used packages, those with more then 100,000 packages per month, from regenerator -- rimraf. microsoft/dtslint#335
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers non-widely used packages starting with o- and following. microsoft/dtslint#335
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers non-widely used packages starting with h- and following. microsoft/dtslint#335
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers non-widely used packages starting with d- and following. microsoft/dtslint#335
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers non-widely used packages starting with a- and following. microsoft/dtslint#335
* Add undefined to optional properties, React to Regenerate In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers widely used packages, those with more then 100,000 packages per month, from react-slider -- regenerate microsoft/dtslint#335 * Fix errors in react * Missed fix to react-table * add missed parens to conditional type
@wandyezj points out that it doesn't make sense to require optional properties to have However, plenty of people won't know about the distinction at first, meaning that some new types will incorrectly exclude I expect over time that @a-tarasyuk's eslint rule will grow configuration options that allow people either to upgrade old code or keep new code appropriately strict. |
* Add undefined to optional properties, part D In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers non-widely used packages starting with d- and following. microsoft/dtslint#335 * reformat for shorter line length * Add missing whitespace
* Add undefined to optional properties, part A In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers non-widely used packages starting with a- and following. microsoft/dtslint#335 * reformat for shorter line length
* Add undefined to optional properties, part O In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers non-widely used packages starting with o- and following. microsoft/dtslint#335 * shorten max line length
* Add undefined to optional properties, part H In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers non-widely used packages starting with h- and following. microsoft/dtslint#335 * shorten line lengths
Including undefined, or not, is now semantically meaningful when exactOptionalPropertyTypes is true.
* Add undefined to optional properties, part H In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers non-widely used packages starting with h- and following. microsoft/dtslint#335 * shorten line lengths
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers widely used packages (more than 100,000 downloads per month) from karma-chrome-launcher -- mimos microsoft/dtslint#335
* Add undefined to optional properties, part H In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers non-widely used packages starting with h- and following. microsoft/dtslint#335 * shorten line lengths
Previously, both optional parameters and optional properties forbid
undefined
in their type. Now optional properties require it so that people can use exactOptionalPropertyTypes with packages from DT.To avoid "no-redundant-undefined means redundant-undefined!?", I also renamed the lint rule. There are only 17 projects that turn off this rule, so I think it's easy to rename along with all the other changes that this rule will cause in DT.