Commit Graph

3616 Commits

Author SHA1 Message Date
Oleksandr T
1cd8ee4b8d fix(42088): fix crash on unreachability condition in for statement (#42110) 2021-01-10 15:42:39 -08:00
Sheetal Nandi
d36df0dda5 Try file if matched pattern specifies the extension instead of all the time (#42246)
* Test case for path mapping with extension

* Try file if matched pattern specifies the extension instead of all the time
Fixes #39743
2021-01-08 12:03:29 -08:00
Orta Therox
055f363fba Reverts #39277 removing bundledPackageName (#41499)
* Reverts #39277

* Bring back modeyule resolution for the test runner
2021-01-08 10:55:34 +00:00
Wesley Wigham
11606e4de4 Do for unions of many empty-object-spreadables what we did for unions of 2 (#42233)
* Do for unions of many empty-object-spreadables what we did for unions of 2

* Accept baseline
2021-01-07 12:05:40 -08:00
Christian
7a5aadca69 Adjust TS2691 message for .ts import sources (#42184)
* Adjust TS2691 message for .ts import sources

* Only ModuleKind is needed for TS2691 logic

* Added tests for TS2691
2021-01-05 11:10:04 -08:00
Wesley Wigham
72dfc589a1 Retain CheckFlags.Late on symbols manufactured based on Late-bound symbols (#42205) 2021-01-04 15:49:52 -08:00
Anders Hejlsberg
22bee779d7 Properly make inferences from partial source type (#42038)
* Slightly less picky check in typesDefinitelyUnrelated

* Accept new baselines

* Add regression test
2020-12-19 07:18:44 -10:00
Wesley Wigham
c3ff0d4c17 Under jsx: preserve, actually preserve expressions which contain only comments (#41757)
* Under jsx: preserve, actually preserve expressions which contain only comments

* Even better best effort comment preservation in JSX comments
2020-12-18 11:42:33 -08:00
Wesley Wigham
caebbe6714 Dont check computed name visibility results when the computed name representation is not in use (#41806) 2020-12-18 11:41:55 -08:00
Song Gao
8cbc576954 Fix #41800 correctly. (#41895)
* fix as suggestion.

* Update moduleSpecifiers.ts

* compare symbol rather than string

* fix typo.

* fix

* fix lint.

* better name and more clear code

* fix comment.

Co-authored-by: Orta Therox <git@orta.io>
2020-12-16 18:56:18 -08:00
Wesley Wigham
b217f22e79 Allow identical type parameter lists to merge in union signatures (#31023)
* Have signature identity checks look at the base constraint of type parameters, allow identical type parameter lists to merge in union signatures

* Update text in fourslash test

* Add whitespace to fix lint, remove duplicate impl

* Consolidate names

* Remove comparisons of type parameter defaults, add more test cases
2020-12-16 13:17:57 -08:00
Wesley Wigham
675cd4d7ce Ensure factory symbol remains unused in react-jsx mode when not referenced in user code (#41905) 2020-12-16 13:11:48 -08:00
Anders Hejlsberg
bec8071c65 Simplify constraint depth limiter logic (#41972)
* Explore at least 10 levels of constraints before checking for deeply nested types

* Simplify constraint depth limiter logic

* Add regression test

* Accept new baselines
2020-12-15 17:08:36 -10:00
Andrew Branch
035c7ca905 Elide export assignment when it does not resolve to a value (#41904)
* Only mark aliases that resolve to values referenced

* Update other affected baselines

* Remove redundant check
2020-12-10 10:17:28 -08:00
Anders Hejlsberg
646f5b3c4e Preserve substitution types in check position of conditional types (#41841)
* Preserve substitution types in check types of conditional types

* Undo changes from #32093

* Add regression tests

* Accept new baselines
2020-12-07 16:38:00 -10:00
Orta Therox
71e881a7ee Undo #39258 (isArray changes) see overview at #41808 (#41851) 2020-12-07 21:59:26 +00:00
Song Gao
37e898cfd7 import statement from "node" in js source file could produce correct declaration path. (#41816)
* fix #41800

* add test

* fix test
2020-12-07 13:54:47 +00:00
Oleksandr T
a5c3cb4194 Improve uncalled function checks with parenthesized expressions in condition (#41748) 2020-12-04 16:20:14 -08:00
Wesley Wigham
0da5a7e4ba Add missing BinaryExpression source side cases to isMatchingReference (#41765) 2020-12-01 14:47:14 -08:00
Wesley Wigham
2a3f5508ec addImplementationSuccessElaboration admits declarations with no symbol (#41758) 2020-12-01 12:19:12 -08:00
Toan Nguyen
0c76803854 Fix typos in comments (#41307)
* Fix typo fuction -> function

* Fix typo assignement -> assignment
2020-11-30 15:02:07 -08:00
Nathan Shively-Sanders
06fb724cd1 Improve uncalled function checks (#41599)
Fixes #41586
Fixes #41588

1. For binary expressions, if the immediate parent is an IfStatement,
then check the body of the if statement. I didn't walk upward to find an
IfStatement because in my experimentation I found that binary expression
uncalled-function errors are only issued when the expression is on the left of the
top-most binary expression.

2. For property accesses with interspersed calls, I added a
CallExpression case. In fact, any expression could appear here, but I
only want to fix calls for now since that's all we've observed in
Definitely Typed, and we didn't see anything else in the user tests or RWC
tests. I also didn't examine parameters of the intermediate call
expressions, but I don't think it's needed since the intent is to avoid
false positives.
2020-11-30 14:27:19 -08:00
Anders Hejlsberg
ec1490fb44 Properly cache types for shared control flow nodes (#41665)
* Properly cache shared flow node types

* Add test
2020-11-25 14:51:38 -10:00
Oleksandr T
d163ab67c8 fix(41240): allow emitting numeric with underscored separators as-is in esnext target (#41435) 2020-11-23 17:01:42 -08:00
Martin Probst
6b04f50394 Do not parse template arguments in JavaScript files. (#36673)
Fixes #36662.
2020-11-19 11:41:35 -08:00
Oleksandr T
9bbbe5c0c7 fix(41227): change message about incorrect property access with possible replacement with static access (#41275) 2020-11-18 12:50:32 -08:00
Mateusz Burzyński
09eb3d3b9c Fix/jsx global preferred over config implicit (#41476)
* Add actual baselines for a problem with global namespace being preferred over config & pragma implicit ones

* Fixed an issue with global React namespace being preferred over config & pragma implicit ones

* Do not try to mark JSX classic runtime symbols as used when automatic runtime is used
2020-11-17 17:52:32 -08:00
Oleksandr T
6369d89711 fix(41492): make more friendly handling the missing call function in binary expressions (#41502) 2020-11-17 09:42:27 -08:00
Nathan Shively-Sanders
64be2a8d16 Revert "Revert "feat(40197): handle uncalled function checks in binary expressions (#40260)"" (#41462)
This reverts commit cf3e28ea66.
2020-11-09 11:34:41 -08:00
Sheetal Nandi
9c60d5a4d3 Dont look for properties of Object and Function type when looking to resolve named import from module with export= (#37964)
* Add tests

* Dont look at object or function type when looking for members of `export=` type to be resolved by named imports
Fixes #37165

* Create separate cache when skipping function and object property augmentation

* Lookup in both cache if not skipObjectFunctionPropertyAugment
2020-11-03 12:22:30 -08:00
Thomas Williamson
8ed251d0c7 Support xml namespace prefix for JSX elements and attributes (#37421)
* Support xml namespace prefix for JSX elements and attributes

Just as with the `-` character, `:` is now also treated specially in JSX
element and attribute names, but is only allowed a single time, and not
at the beginning or end of the name, as is specified in the JSX spec.
All tests in jsxInvalidEsprimaTestSuite still fail, but for slightly
different reasons now. Two lines in jsxEsprimaFbTestSuite were
uncommented as they included elements with namespaces, and they now pass
without error.

* Add case for colons at ends of identifier

* Add case for jsx namepsace intrinsics

* Add cases with upcase idents for jsx namespaces

* Add case for jsx namespaces with react option

* Always consider jsx names with colon to be intrinsics

* Adjust comment about chars valid in jsx names but not js idents

* Fix minor typo in namespace prefix test case variable name

* Remove misleading comments on isUnhyphenatedJsxName
2020-11-02 15:34:36 -08:00
Oleksandr T
056d01afda fix(38283): fix incorrect parsing of static modifier (#41127) 2020-11-02 14:45:26 -08:00
okmttdhr
7db5f68144 Add index signature for anonymous object literal type (#37903)
* Use ts.map for stylistic consistency

* Show error only if noImplicitAny is set

* Accept baseline for noImplicitAnyIndexing

* Fix lint error

* Add test cases for indexedAccessWithFreshObjectLiteral
2020-11-02 14:35:56 -08:00
Oleksandr T
f646ec87fc fix(40901): skip checking custom arguments name in a constructor (#40912) 2020-11-02 14:35:07 -08:00
Oleksandr T
075477f9cf fix(35779): emit comments after trailing comma (#37887) 2020-11-02 14:24:55 -08:00
Wesley Wigham
479105090d Merge pull request #41330 from weswigham/jsx-import-source-as-auto-import
Auto-include types for the jsx import source in the new jsx transforms
2020-10-30 16:51:04 -07:00
Wesley Wigham
e044b56d7f Merge pull request #40985 from weswigham/static-decl-ref
Adjust typeof import name lookup to better match type query lookup
2020-10-30 11:13:23 -07:00
Wesley Wigham
6714998e01 Auto-include types for the jsx import source in the new jsx transforms 2020-10-29 14:17:24 -07:00
Wesley Wigham
f0f3862cd9 Merge pull request #41314 from weswigham/fix-global-jsx-ns-alias-crashes
Fix crashes when the global JSX namespace is an alias
2020-10-28 18:38:26 -07:00
Wesley Wigham
d722392d81 Fix crashes when the global JSX namespace is an alias 2020-10-28 14:31:40 -07:00
Wesley Wigham
4ec02a56b8 Bind comma expression LHS call expressions 2020-10-28 13:48:29 -07:00
Anders Hejlsberg
bd27bd8d47 Don't relate unmatched parameter positions in signatures (#41308)
* Don't relate unmatched parameter positions in signatures

* Add regression test

* Accept new baselines
2020-10-28 11:55:32 -07:00
Wesley Wigham
6acce0ca6f Merge pull request #41075 from uhyo/fix-36958
allow type narrowing with NonNullExpression
2020-10-27 20:10:27 -07:00
Wesley Wigham
c923023494 Merge pull request #41191 from weswigham/control-flow-comma-exprs
Track control flow for comma expressions in call expressions
2020-10-27 12:37:02 -07:00
Anders Hejlsberg
f9dcd9ef98 Don't cache Ternary.Maybe results when recursion is encountered during variance measurement (#41218)
* Don't record Ternary.Maybe results in cache during recursive variance measurement

* Add regression test

* Accept new baselines

* Use Ternary.Unknown to signal variance recursion

* Add comments

* Fix comment
2020-10-27 10:53:13 -07:00
Daniel Rosenwasser
3517af8f80 Make 'getIndentString' just use a loop. (#41221)
* Make 'getIndentString' just use a loop.

* Added test.

* Accepted baselines.
2020-10-26 12:19:31 -07:00
Anders Hejlsberg
d1f87d18b1 Support partial reverse mapped inferences with tuple types (#41106)
* Support partial reverse mapped inferences with tuple types

* Add tests

* Accept new baselines
2020-10-22 11:27:41 -07:00
Wesley Wigham
6dde1621cb Track control flow for comma expressions in call expressions 2020-10-21 12:31:29 -07:00
Andrew Branch
1f852ed747 Percent-encode source map URLs (#41102) 2020-10-20 13:11:52 -07:00
Wesley Wigham
b8dfa28ca8 Do not consider empty jsx expressions semantically important children 2020-10-19 13:34:16 -07:00