Commit Graph
13 Commits
Author SHA1 Message Date
uhyo 29dffc3079 Forbid unused property renaming in destructuring binding in function types (#41044)
* Forbid renaming a propertyin function type parameters

* add tests

* Remove renaming from declaration output

* accept baseline

* accept baseline

* renew tests (not very right now)

* get correct result

* update diagnostic text

* accept baseline

* add declaration emit test

* fix declaration emit

* fix formatting

* revert unnecessary change

* accept baseline

* extend tests

* Revert "revert unnecessary change"

This reverts commit 17a29fff6c.

* accept baseline

* Rename and refactor potentialAlways... stuff

* add non-identifier names

* extend check to non-identifier original property names

* update diagnostic message

* add related span

* accept baseline

* add symbol-keyed test case

* oops?

* workaround for unstable test

* fix suggested name

* add comment about non-identifier property names

* simplify isReferenced check

* accept baseline

* move it one step further
2022-06-14 12:13:49 -07:00
uhyo f3d57ccea8 Remove undefined from source type of renaming destructuring assignment with default (#41042)
* Remove undefined from source type of destructuring assignment with renaming

* add a test

* add test case from original issue

* add test with undefined default value

* add more test cases with const declaration
2022-06-01 15:34:37 -07:00
uhyo 04f831d795 Import chalk with import() syntax (#46931)
This makes code compatible with chalk v5.0.0.
2021-11-29 13:32:29 +00:00
uhyo 58781b0d41 allow type narrowing with NonNullExpression 2020-10-13 13:00:09 +09:00
uhyo 61910e8c97 Fix missing constraints for parenthesized infer T (#40406)
* add tests

* consider parenthesized types in getInferredTypeParameterConstraint

* update tests
2020-09-23 00:48:40 -07:00
b6f09ccf06 Better error message for unparenthesized function/constructor type notation in union/intersection types (#39570)
* add graceful error message for unparenthesized function types in union and intersection

* add unparenthesizedFunctionTypeInUnionOrIntersection test

* add unparenthesizedConstructorTypeInUnionOrIntersection test

* Update src/compiler/parser.ts

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* pass isInUnionType to parseFunctionOrConstructorTypeToError

* Apply suggestions from code review

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>

* syntax fix

* refactor isStartOfFunctionType into isStartOfFunctionTypeOrConstructorType

* Update src/compiler/parser.ts

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* hoist isUnionType

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-07-15 14:43:56 -07:00
uhyoandWesley Wigham 1f56ab02f0 Improve error message for invalid return type of JSX component (#32702)
* New diagnostic message for wrong JSX function component

* Component and Mixed type

* fix existing tests

* add new test for JSX component return type error

* fix tslint error

* update diagnostic message to include component name

* accept baseline

* update tests

* missing semicolon

* accept baseline

Co-authored-by: Wesley Wigham <wwigham@gmail.com>
2020-03-30 13:04:33 -07:00
uhyo bafdf4baf8 remove extra newline 2019-05-02 03:45:17 +09:00
uhyo 55bffe3616 add tests to check errors for use of 'await' in non-async function 2019-05-02 02:33:27 +09:00
uhyo 1fd9de3214 do not suggest to mark constructor 'async' 2019-05-02 02:33:27 +09:00
uhyo 8e9556a860 fix existing tests to accept new behavior 2019-05-02 02:33:26 +09:00
uhyo 246b66c714 add related info to error for use of for-await-of in non-async function 2019-05-02 02:33:25 +09:00
uhyo b0143bb446 add relatedInfo to error message for 'await' used in non-async function 2019-05-02 02:33:24 +09:00