Commit Graph

1582 Commits

Author SHA1 Message Date
Wesley Wigham
49689894d7 Elaborate jsx children elementwise (#29264)
* Heavy WIP, but has good contextual typing fix

* Add arity error, refine messages and spans

* Small error message change

* Better error messages, text-specific message
2019-01-15 11:32:36 -08:00
Gabriela Britto
e5708e1903 Merge pull request #29352 from Microsoft/qualified-name-param-tag-error
Qualified name param tag error
2019-01-14 10:28:08 -08:00
Josh Goldberg
8d28f9230c Added codefix to enable experimentalDecorators in the user's config file
Starts on #29035 by creating a codefix to enable the `experimentalDecorators` setting in a user's config file, if one exists. The issue's discussion also mentions giving a more precise error message if the user has a jsconfig or tsconfig or creating one if not; I'd rather tackle those in separate PRs to keep this one small.

Doesn't create the code action if no config file is present. Otherwise keeps to the precedent of returning without action when the config file contents aren't the expected JSON structure (looking at `fixCannotFindModule.ts`).  Moves a couple JSON helpers from that file into the sibling `helpers.ts` so both codefixes can use them.
2019-01-11 09:20:12 -05:00
Gabriela Britto
a9ed42f541 Merge branch 'master' into qualified-name-param-tag-error 2019-01-10 09:49:26 -08:00
Gabriela Britto
e16be71c08 Add diagnostic message for JSDoc qualified param name without top level param 2019-01-09 15:52:05 -08:00
Alexander T
52057ac4f6 Merge branch 'master' of https://github.com/Microsoft/TypeScript into bug/24542-bad-error-message-for-import-ing-an-export 2019-01-08 10:55:11 +02:00
Alexander T
945eed8d9b PR feedback: change error #2497 message 2019-01-08 10:54:08 +02:00
Anders Hejlsberg
3f7a9a906b Type parameter defaults can only reference previously declared type parameters 2018-12-27 13:45:13 -10:00
Anders Hejlsberg
3e0639add5 Merge pull request #29053 from Microsoft/fixDestructuringControlFlow
Fix destructuring control flow analysis
2018-12-19 11:12:41 -08:00
Anders Hejlsberg
676338971d Improve error message for out-of-bounds tuple element access 2018-12-19 08:45:18 -08:00
Daniel Rosenwasser
3edd2d6893 Merge pull request #28896 from JoshuaKGoldberg/n-identifier-after-numeric-literal-error
Better error message for invalid bigint literals ending with n
2018-12-18 11:38:06 -08:00
Alexander T
78707b206a Merge branch 'master' of https://github.com/Microsoft/TypeScript into bug/24542-bad-error-message-for-import-ing-an-export 2018-12-18 10:41:31 +02:00
Alexander T
332c88e57d PR feedback: change error #2497 message 2018-12-18 10:39:32 +02:00
Ali Sabzevari
1a5ecbb6ac #28977 Change error message according to review comments 2018-12-14 23:42:59 +01:00
Ali Sabzevari
99c7fc4a88 #28977 Change const enum error message 2018-12-14 21:23:46 +01:00
Anders Hejlsberg
43811dd16f Use getIndexedAccessType when computing destructured types 2018-12-13 12:13:13 -08:00
Philip Pesca
e6aa992095 Fix error message when type argument arity is wrong (#28366)
* Fix error message when type argument arity is wrong

* Parenthesize 's' in plurals

* Update baseline

* Update baseline

* Use old error message

* Revert parantheses
2018-12-11 09:54:38 -08:00
Josh Goldberg
773c50f05a Better error message for invalid bigint literals ending with n
Helps with the cases of decimals and exponentials, though not with numbers incorrectly starting with `0`.

Fixes #28887.
2018-12-07 00:40:13 -08:00
Josh Goldberg
a211184347 Clarified error message; extended error to identifier end
Lengthening the reported error length to include all of the identifier necessitates scanning for all of the identifier. I also reset the `pos` after so other identifier scanning still happens.
2018-12-06 11:17:06 -08:00
Josh Goldberg
174816fc26 Added error for IdentifierStart immediately after a NumericLiteral
Fixes #4702.
2018-12-04 17:59:20 -08:00
Nathan Shively-Sanders
6cee7c3080 Better nameless parameter implicit any error (#28554)
* Initial version, doesn't work for primitives yet.

Need to find out why.

* Primitives now work, plus improve error message

null and void don't even parse without parameter names so they are not
tested.

* Codefix: Add names to nameless parameters

* Improve error wording

* Add detail to error message
2018-11-15 12:45:39 -08:00
Daniel Rosenwasser
fe263708be Merge pull request #27019 from iliashkolyar/codefix_add_missing_new_operator
Codefix: add quick fix for missing 'new' operator
2018-11-14 16:53:25 -08:00
Daniel Rosenwasser
f4fb28daa9 Merge pull request #28015 from prateekgoel/error-messages
Error messages for extending a specific type
2018-11-13 17:04:40 -08:00
Wesley Wigham
7a71887c23 Build better import paths for declaration emit/typeToString from reexports if possible (#27340)
* Build better import paths from reexports if possible, issue error on node_modules import generation

* Small refactorings

* Add file-by-file cacheing

* Minor cleanups

* Adjust error message
2018-11-13 14:07:54 -08:00
Alexander T
5c7f8ef89d Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/28297-make-error-message-at--a-constant-or-a-read-only-property--more-specific 2018-11-13 09:58:30 +02:00
Daniel Rosenwasser
25462beeb7 Merge pull request #28456 from Microsoft/nonExperimentalBigInt
BigInt shouldn't be considered experimental
2018-11-12 15:59:15 -08:00
Andy
995f746c92 Add implicit-any error on JSDocFunctionType with no return type (#28487) 2018-11-12 14:39:02 -08:00
Wesley Wigham
11eee2b6ee Slightly improve missing property errors (#28298)
* Slightly improve missing property errors

* Add missing quote

* Fix jsx case

* Add related span

* Fix crash (why can declarations be undefined)

* Only skip top elaboration when no variant message is provided
2018-11-12 14:31:15 -08:00
Daniel Rosenwasser
f7ad54b432 Only complain about BigInt literals in pre-ESNext targets. 2018-11-09 16:20:54 -08:00
iliashkolyar
047b76f979 Merge branch 'master' into codefix_add_missing_new_operator 2018-11-10 01:45:11 +02:00
Daniel Rosenwasser
2585ccbe39 Merge pull request #28281 from ryanclarke/master
Add codefix for 'convert to unknown' diagnostic
2018-11-09 14:43:25 -08:00
Alexander T
5bd0051daa Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/28297-make-error-message-at--a-constant-or-a-read-only-property--more-specific 2018-11-07 10:05:34 +02:00
Wesley Wigham
cc36e294cc Add related span pointing to this-shadowing location for implicitly-any this (#28299)
* Add diagnostic pointing to this-shadowing location

* Fix almost-top-level-this case

* Change message on span
2018-11-06 11:27:07 -08:00
Caleb Sander
28e9ec497c Address review comments 2018-11-05 11:36:32 -08:00
Caleb Sander
3e10dedbce Add diagnostic messages for bigints 2018-11-05 11:36:30 -08:00
Alexander
ae8d54658a exclude mention about constant from error message 'a-constant-or-a-read-only-property' to be more specific. 2018-11-03 16:07:20 +02:00
Alexander T
28fc0a28b0 add new error message 'Cannot assign to {0} because it is a constant.' 2018-11-03 15:42:00 +02:00
Wesley Wigham
eba83f4ea7 Add related span for mixin constructor error (#28319)
* Add related span for mixin constructor error

* Remove unneeded casts

* Nicer style
2018-11-02 17:29:05 -07:00
Sheetal Nandi
77ef9cedab Report error summary in pretty mode during normal compilation 2018-11-01 16:11:22 -07:00
Ryan Clarke
4598943ed3 Add codefix for 'convert to unknown' diagnostic
Codefix for diagnostic error 2352: "Conversion of type '{0}' to type '{1}' may be
a mistake because neither type sufficiently overlaps with the other. If this was
intentional, convert the expression to 'unknown' first."

Add codefix for both AsExpressions and TypeAssertions
2018-11-01 06:13:25 -04:00
Wesley Wigham
a4a1bed88b Add showConfig tsc flag for debugging configs (#27353)
* Add showConfig tsc flag for debugging configs

* Merge showConfig implementation with init implementation, add basic unit tests

* Fix lint

* Add missing semicolon

* showConfig when theres no config file
2018-10-31 15:57:09 -07:00
Klaus Meinhardt
33568795e0 Suggest adding to tsconfig after installing @types (#28211)
Ref: https://github.com/Microsoft/TypeScript/pull/28168#issuecomment-433554228
2018-10-30 11:33:05 -07:00
Nathan Shively-Sanders
60efb65931 infer-from-usage suggestions can't be ignored, and always do something when invoked. (#28206)
* Do not ts-ignore noImplicitAny suggestions

Still need to write tests.

* Add tests

* More tests

* Update baselines
2018-10-29 13:23:33 -07:00
iliashkolyar
21feb204f6 Merge branch 'master' into codefix_add_missing_new_operator 2018-10-28 23:27:16 +02:00
Prateek Goel
2fa23e96cd Error messages and tests 2018-10-26 10:14:53 +05:30
Prateek Goel
d45eed314a Error messages for extending a specific type 2018-10-26 10:14:37 +05:30
Alexander T
fe6dad7725 Merge branch 'master' of https://github.com/Microsoft/TypeScript into bug/24542-bad-error-message-for-import-ing-an-export 2018-10-18 11:49:58 +03:00
Sheetal Nandi
b69622a114 Merge branch 'master' into transitiveReferences 2018-10-16 10:41:17 -07:00
Anders Hejlsberg
5a126e2b27 Merge pull request #27587 from Microsoft/fixUnionOfTupleIndexing
Fix indexing and destructuring of unions of tuple types
2018-10-11 12:01:24 -07:00
Sheetal Nandi
88f79de9f4 Merge branch 'master' into transitiveReferences 2018-10-09 14:03:58 -07:00