Commit Graph

1678 Commits

Author SHA1 Message Date
Nathan Shively-Sanders
67b8ca77d9 Merge branch 'master' into report-multiple-overload-errors 2019-06-25 14:07:56 -07:00
Andrew Branch
6717d8d928 Merge pull request #31942 from andrewbranch/bug/30882
Improve error message on indexed access to private members of type parameters
2019-06-24 09:22:21 -07:00
Nathan Shively-Sanders
720ad5bf22 Improve error message and update baselines 2019-06-21 13:15:32 -07:00
Nathan Shively-Sanders
ef0a8759bd Share code a bit better 2019-06-20 15:40:29 -07:00
Nathan Shively-Sanders
afecb87d3f Use related spans to form a tree of errors.
Formatting is wrong, and I might want to format it as non-related spans,
but the structure is exactly a tree.
2019-06-20 08:54:31 -07:00
Nathan Shively-Sanders
e5fd8766fa Merge branch 'master' into report-multiple-overload-errors 2019-06-19 10:46:51 -07:00
Nathan Shively-Sanders
beddf9c02d Working, just not the way I would like
There are still separate errors instead of one + related spans for each
sub-error.
2019-06-18 10:12:32 -07:00
Nathan Shively-Sanders
c65d9f261a Initial attempt. Totally doesn't work. 2019-06-18 08:30:18 -07:00
Josh Goldberg
ca00b3248b Added --noImplicitThis code fix for functions used as object properties (#31138)
* Added --noImplicitThis code fix for functions used as object properties

Before trying out all the various possibilities for where these functions could be used, I figured I'd start out with a relatively simple use case to verify this is the right approach. Is it? 😄

Starts on #28964.

* Fixed function expression names; included new baselines

* Got JSDocs to work, hooray!

* Added test for 'any' case of no function uses

* Refactored for inferFunctionReferencesFromUsage

* Fixed inference bug: undefined references cause parameters to default

* Removed dead code comments
2019-06-17 19:00:15 -07:00
Andrew Branch
04fbd93bf8 Revert previous fix and improve error message instead 2019-06-17 15:21:21 -07:00
Paul van Brenk
c5578a2b43 Update error message as requested by @danielrosenwasser 2019-06-04 19:08:34 -04:00
Paul van Brenk
a658f728a9 Include the project filepath in the error message for files not being
listed in the 'include' pattern. TS6307
2019-06-02 11:54:48 -04:00
Ron Buckton
dfd28d2751 Fix handling of empty 'types', 'typings', etc. fields in package.json (#31539) 2019-05-23 17:19:32 -07:00
Titian Cernicova-Dragomir
8ab0a25211 Improve error messages when indexing into a type (#31379)
* Improved error messages when indexing an object type with a literal string, a literal string union or a string.

* Added more specific message when using the indexing operator with an incompatible index argument.

* Fixed spelling and error message.
2019-05-23 15:27:50 -07:00
Nathan Shively-Sanders
4d27361680 Allow JS with isolated modules (#31483)
* Allow JS with isolated modules

Previously legacy JS code was not allowed; it was required to use ES6
module syntax. Unfortunately, the check happens after parsing but before
binding, and the commonjs module indicator isn't set until binding
because it's not syntactically simple like the ES6 module indicator,
which is set during parsing.

So I decided that JS should be allowed during isolatedModules
unconditionally. We're not going to be transforming it anyway.

* Update baselines

* Switch test to outDir instead of noEmit
2019-05-23 11:09:28 -07:00
Sheetal Nandi
85d3c5d7a1 Trace Package id at the module resolution site 2019-05-22 12:35:20 -07:00
Wenlu Wang
714821fc97 add refactor of extract type (#30562)
* add basically implement

* add rename location and add testcase

* collection type arguments

* disallow infer type

* add support for typedef convert

* refactor info to make type safe

* disallow type pred

* avoid unnecessary branch

* disallow type query

* haha😂

Co-Authored-By: Kingwl <kingwenlu@gmail.com>

* Update src/services/refactors/extractType.ts

Co-Authored-By: Kingwl <kingwenlu@gmail.com>

* Update src/services/refactors/extractType.ts

Co-Authored-By: Kingwl <kingwenlu@gmail.com>

* add more tests

* add template tag support in jsdoc

* add support of type parameters constraint

* add more tests

* merge branch

* add more tests

* refactor and update function name
2019-05-07 08:26:53 -07:00
Andrew Branch
56b19c9bf0 Merge pull request #31119 from andrewbranch/bug/31020
Emit grammar error on quoted constructors and class fields named “constructor”
2019-05-01 10:42:16 -10:00
uhyo
b0143bb446 add relatedInfo to error message for 'await' used in non-async function 2019-05-02 02:33:24 +09:00
Josh Goldberg
6e736c120e Added custom error message when trying to assign constraint type to generic type parameter (#30394)
* Added custom error message when trying to assign constraint type to generic type parameter

Fixes #29049.

This also adds the new message in chained error messages. `typeParameterDiamond4.errors.txt` shows it appearing twice in the "diamond" scenario. I can't tell if this severely increased amount of nested messages is good or bad...?

* Updated diagnostic message per suggestion

* Align formatting with local custom
2019-04-30 08:35:22 -07:00
Collins Abitekaniza
7016d45447 Better errors for indexing gettable/settable values (#26446)
* give suggestions when index signature given

* add tests for noImplicitAny indexing on Object

* remove comments regarding error messages

* recommend set if el is on RHS of assignment else get

* add new baseline tests
2019-04-30 08:31:37 -07:00
Andrew Branch
e81fa2198d Emit error on class fields named "constructor" 2019-04-25 17:30:41 -07:00
Andrew Branch
9f601ff154 Change error code 2019-04-25 16:15:00 -07:00
Andrew Branch
c5e6913ede Add grammar error on quoted constructors for TS 3.5 2019-04-25 15:44:23 -07:00
amaksimovich2
5b79b942e8 add action for enabling experimentalDescorators option in user config… (#30484)
* add action for enabling experimentalDescorators option in user config file, change error message for this case #29035

* add missing changes in tests

* Add "experimental decorators" tests for jsconfig file
2019-04-25 14:55:04 -07:00
Ely Alamillo
591b25593d update error message and update baselines (#27628) 2019-04-25 13:16:41 -07:00
Wenlu Wang
bc46c770bf allow literan enum const assertions (#30700)
* allow literan enum const assertions

* update desc
2019-04-25 10:09:21 -07:00
Ryan Cavanaugh
885d4d63c8 Remove "generate types" code (#31075) 2019-04-23 13:51:47 -07:00
Daniel Rosenwasser
c74d25c115 30837 - Bad error message when default 'import'-ing an 'export =' without 'esModuleInterop' (#30847)
30837 - Bad error message when default 'import'-ing an 'export =' without 'esModuleInterop'
2019-04-23 11:23:06 -04:00
karthikkp
181d126b02 diagnostic messages conflicts resolved 2019-04-20 01:38:17 +05:30
Andrew Branch
b6a0988052 Merge pull request #30776 from andrewbranch/feature/10178
Add flag to allow access to UMD globals from modules
2019-04-18 18:05:44 -07:00
Alexander T
f5d4e66451 Bad error message when default 'import'-ing an 'export =' without 'esModuleInterop' 2019-04-16 14:39:16 +03:00
Daniel Rosenwasser
3dc78b6f3b Merge pull request #30916 from jack-williams/array-elaboration
Elaborate array and tuple relation errors
2019-04-15 14:00:22 -07:00
Andrew
13d9f08976 Gracefully parse 'super' with type arguments (#10677) (#30913) 2019-04-15 13:06:29 -07:00
Jack Williams
2ea91a0e9c Elaborate array and tuple relation errors 2019-04-15 18:16:38 +01:00
Andrew Branch
28b21df943 Add period to compiler flag description to match others 2019-04-08 09:46:47 -07:00
Andrew Branch
2ee93bf0f2 Add allowUmdGlobalAccess flag 2019-04-08 09:46:46 -07:00
Alexander T
75a812b4db add new message - TS1258 (#30704) 2019-04-03 09:49:34 -07:00
Sheetal Nandi
35470b3f3b Make tsbuildInfoFile as commandline option to tsc (and not tsc -b) 2019-03-25 14:47:36 -07:00
Sheetal Nandi
722afc18bb Fix typo 2019-03-21 09:01:52 -07:00
Sheetal Nandi
34c3233d18 Allow --incremental to be command line option 2019-03-20 14:48:47 -07:00
Gabriela Britto
1c8a359914 rename convert to named parameters (#30401) 2019-03-14 13:41:29 -07:00
Wenlu Wang
d2476759e2 add related error span for default exports (#25396)
* add related error span for default exports

* accept baseline

* stash

* accept baseline and fix lint

* update testcase

* Add missing semicolon
2019-03-12 13:15:14 -07:00
Sheetal Nandi
68e28da141 Build project if existing project was built with different compiler version 2019-03-08 15:14:34 -08:00
Sheetal Nandi
990b199ebd Merge branch 'master' into incrementalBuildInfo 2019-03-08 11:42:19 -08:00
Sheetal Nandi
fe9f42480a Handle error when type parameter of mapped type uses private type
Fixes #30201
2019-03-06 13:30:48 -08:00
Gabriela Britto
d2364f555f Merge pull request #30089 from Microsoft/convert-to-named-parameters
Convert to named parameters
2019-03-06 09:33:01 -08:00
Sheetal Nandi
223d42847b Merge branch 'master' into incrementalBuildInfo 2019-03-01 11:39:44 -08:00
Sheetal Nandi
cd195c91c6 Add options tsBuildInfoFile to provide name for the buildinfo file 2019-03-01 10:28:57 -08:00
Sheetal Nandi
df9da15abb Incremental false with composite not allowed 2019-03-01 09:39:58 -08:00