TypeScript/src
Nathan Shively-Sanders 8d4fe5a0fb
Fix unassignable properties by adding undefined with exactOptionalPropertyTypes (#45032)
* Simple first version

Doesn't cover or test any complicated variations.

* Lots of cases work

Destructuring does not. But

- skipping node_modules and lib.* does.
- call expressions does
- property access, including with private identifiers, does

* Support variable declarations, property assignments, destructuring

As long as it's not nested

* More cleanup

* skip all d.ts, not just node_modules/lib

* Offer a codefix for a lot more cases

* remove incorrect tuple check

* Use getSymbolId instead of converting to string

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>

* add test + switch to tracking number symbol ids

* Address PR comments

* Exclude tuples from suggestion

* Better way to get error node

Plus add a check that errorNode is an argument to the call, not the
call's expression.

* fix semicolon lint

* fix another crash

* Simplify: add undefined to all optional propertie

whether or not somebody tried to assign undefined to them in the
erroneous assignment

* remove fix-all

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
2021-08-10 16:57:38 -07:00
..
cancellationToken
compiler Fix unassignable properties by adding undefined with exactOptionalPropertyTypes (#45032) 2021-08-10 16:57:38 -07:00
debug Allow assignments to a narrowable reference to be considered narrowable 2020-07-29 16:37:25 -07:00
deprecatedCompat @link support, second try (#43312) 2021-03-22 16:39:35 -07:00
executeCommandLine Revisions for the new --help (#44800) 2021-08-05 16:41:01 +01:00
harness Fix unassignable properties by adding undefined with exactOptionalPropertyTypes (#45032) 2021-08-10 16:57:38 -07:00
instrumenter Update tsc-instrumented for project build (#45383) 2021-08-10 14:53:17 -07:00
jsTyping Detect preference for Unode:-prefixed node core modules (#45080) 2021-07-19 09:56:24 -07:00
lib Migrate over 4.4 lib dom and webworker (#45324) 2021-08-04 17:14:24 -07:00
loc/lcl LEGO: Merge pull request 45375 2021-08-08 22:13:50 -07:00
loggedIO Update tsc-instrumented for project build (#45383) 2021-08-10 14:53:17 -07:00
server Use getFileAndProject in session provideInlayHints to ensure language service updates are applied (#45394) 2021-08-10 11:48:35 -07:00
services Fix unassignable properties by adding undefined with exactOptionalPropertyTypes (#45032) 2021-08-10 16:57:38 -07:00
shims Fix definition of ts.Iterator 2020-11-11 18:42:12 -08:00
testRunner Update tsc-instrumented for project build (#45383) 2021-08-10 14:53:17 -07:00
tsc Refactor node factory API, use node factory in parser (#35282) 2020-06-16 16:55:03 -07:00
tsserver Fix decorator emit regression for static fields (#44933) 2021-07-07 16:58:36 -07:00
tsserverlibrary Rename 'compat' to 'deprecatedCompat'. (#41000) 2020-11-02 14:25:12 -08:00
typescriptServices Rename 'compat' to 'deprecatedCompat'. (#41000) 2020-11-02 14:25:12 -08:00
typingsInstaller feat(eslint): consistent-type-assertions (#43556) 2021-05-18 06:20:57 -07:00
typingsInstallerCore feat(eslint): consistent-type-assertions (#43556) 2021-05-18 06:20:57 -07:00
watchGuard
webServer Enable events on web server (#45313) 2021-08-05 16:10:01 -07:00
.eslintrc.json Remove distinction between CI lint and local lint (#36430) 2020-01-24 16:23:14 -08:00
tsconfig-base.json Replaces the default module index resolver with '/index' instead of '' when handling internal routing for dts bundles (#39277) 2020-09-11 08:12:07 -04:00
tsconfig-library-base.json Produce source maps for local typescriptServices build (#41589) 2020-11-30 14:28:13 -08:00
tsconfig-noncomposite-base.json
tsconfig.json