Commit Graph

1647 Commits

Author SHA1 Message Date
Alexander
a292ae1789 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-04 15:35:41 +03:00
Sheetal Nandi
1d18b4941e Store already known not parenthesized arrow expression positions for faster exit in case of deep parsing
Fixes #31987
2019-07-31 11:12:01 -07:00
Alexander T
64baa804a8 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-15 18:35:34 +03:00
Andrew Branch
4f3412153a Parse quoted constructors as constructors, not methods (#31949)
* Parse quoted constructors as constructors, not methods

* Update baselines

* Fix disambiguation between quoted constructor and property named constructor

* Clean up parsing a bit

* Support escapes in constructor name

* Update baselines
2019-07-12 14:01:57 -07:00
Alexander T
4defd1d635 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-04 12:49:33 +03:00
Nathan Shively-Sanders
6f0baa3ae1 Merge pull request #29717 from petersandor/jsdoc-tag-author-email-support
Support email in author JSDoc tag
2019-07-03 10:42:02 -07:00
Alexander T
9f474150c6 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-02 17:57:44 +03:00
Alexander T
769bb0b475 remove tslint configuration 2019-06-27 13:49:35 +03:00
Alexander T
810303542d Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-06-27 11:51:20 +03:00
Alexander T
f6a50067d3 @typescript-eslint/indent 2019-06-27 11:30:03 +03:00
Nathan Shively-Sanders
8454ef114d JSDoc:Treat tokens between backticks as comments
even `@`, which would otherwise start a new tag.
2019-06-26 16:04:46 -07:00
Alexander T
7d449ac13f no-fallthrough 2019-06-21 18:32:22 +03:00
Andrew Branch
2856aabd70 Parse stray identifier-ish as JSXText instead of trivia 2019-05-21 15:28:16 -07:00
Andrew Branch
feaef9c829 Improve error message for JSXExpressions that are comma expressions 2019-05-21 14:21:44 -07:00
Klaus Meinhardt
0c9db717ad fix parsing of leading union/intersection operator (#31265)
* fix parsing of leading union/intersection operator

Fixes: #30995

* test declaration emit
2019-05-08 14:09:11 -07:00
Klaus Meinhardt
4ee0084fa1 avoid more useless type assertions (#31239) 2019-05-03 14:51:54 -07:00
Klaus Meinhardt
5bc8a8dddf JSDocTypeTag.typeExpression is not optional (#30452) 2019-04-30 09:46:32 -07:00
Klaus Meinhardt
de9b91f46a simplify pragma comment parsing (#31144)
* simplify pragma parsing

* use emptyArray
2019-04-29 14:17:48 -07:00
Wesley Wigham
d7f03fb0fa Parse generic function types in import type argument lists (#31079)
* Parenthesize in import type node factory

* And now parse unparenthesized generic functions so we can handle parsing the older output
2019-04-23 14:48:31 -07:00
Peter Šándor
08bd017db9 JSDoc author tag parsing updates (#17244) 2019-04-19 12:03:33 +02:00
Peter Šándor
00279e9eca Parse unexpected comments after email in author JSDoc tag (#17244) 2019-04-19 11:17:09 +02:00
Peter Šándor
ea9d519424 Support email in author JSDoc tag
- fixes #17244
2019-04-19 11:15:39 +02:00
Nathan Shively-Sanders
c3a9429420 Handle JSDoc backticks in the parser, not scanner (#30939)
* Scan backticks in jsdoc as a single token less often

Previously, matching backticks in jsdoc would always be scanned as one
token to aid parsing incorrect jsdoc that uses backticks for parameter
names:

``js
/** @param {string} `nope`
 * @param {number} `not needed`
 */
```

However, this is wrong for code fences, which use triple backticks. This
fix parses a single backtick as a single token if it's immediately
followed by another backtick or by a newline. It retains the
questionable tokenisation of backticks-as-pairs in other cases, however.
A better fix might be to have the parser ignore backticks in jsdoc
instead.

* Add test case

* Handle jsdoc backticks in the parser, not scanner

Previously, the jsdoc scanner had ad-hoc handling of backticks that was
similar in structure to the normal scanner's handling, but much simpler.
This was a smaller code change, but is handled backwards: the special
case of backtick-quoted parameter names was handled in the scanner
instead of in the jsdoc identifier parsing code. That made it overapply
and block correct handling of asterisks across newlines, which was most
obvious in code fences inside jsdoc, as in #23517.

Fixes #23517

* More cleanup
2019-04-18 09:35:40 -07:00
Andrew
13d9f08976 Gracefully parse 'super' with type arguments (#10677) (#30913) 2019-04-15 13:06:29 -07:00
Anders Hejlsberg
6cd229b4b9 Merge pull request #30769 from Microsoft/saferIndexedAccessTypes
Improve soundness of indexed access types
2019-04-12 07:33:50 -10:00
Nathan Shively-Sanders
ff959096df Fix some bad jsdoc comment indent (#30838)
* First draft

Solves the initial problem but breaks commentCommentParsing. I also
found a couple more interesting cases.

* Add more tests and fix their bugs

* Another test case

* Some cleanup

I may try do a little more; `margin += tag.end - tag.pos` bothers me a
bit.

* More cleanup
2019-04-10 08:22:09 -07:00
Anders Hejlsberg
e1fd5e5225 Fix unsafe parameter coercions related to PragmaPseudoMap 2019-04-06 06:29:59 -10:00
Andrew Branch
3f3444be80 Merge pull request #30699 from andrewbranch/bug/30635
Fix ternaries where "true" is a parenthesized variable and "false" is a function expression
2019-04-02 14:03:11 -07:00
Wesley Wigham
ca98a50574 Use const contexts and tuple mapped types to simplify some explicitly elucidated types (#30654)
* Use const contexts and tuple mapped types to simplify some explicitly elucidated types

* Fix lint

* Further cleanup - refactor mapped type into its own alias for readability

* Slightly more cleanup - PragmaPsuedoMap neednt be partial, thus removing tons of nonull assertions

* Remove GH#18217 comments
2019-04-02 13:04:51 -07:00
Andrew Branch
96660f6c00 Just look at the current node instead of context 2019-04-02 11:31:05 -07:00
Andrew Branch
d198c5906f Be stricter while parsing arrow function heads in conditional expressions 2019-04-02 11:17:21 -07:00
Wenlu Wang
b97b1a8de6 add jsx factory and hold text in jsxtext node (#29439)
* add jsx factory and hold text in jsxtext node

* update jsxtext prop name and factory
2019-03-11 16:00:18 -07:00
Sheetal Nandi
9fa28158bb Enable building typescript.d.ts with current source 2019-02-22 18:11:27 -08:00
Anders Hejlsberg
4706a060a5 Merge branch 'master' into readonlyArrayTuple 2019-01-26 14:44:15 -08:00
kingwl
e8497096d8 Merge branch 'master' into improve_type_arguments_parser_1 2019-01-20 01:54:49 +08:00
Anders Hejlsberg
bb8378fddf Support 'readonly' type modifier on array and tuple types 2019-01-15 09:43:39 -08:00
Wesley Wigham
fadd95f72b Fix unneeded cast lints (#29383) 2019-01-11 14:24:49 -08:00
Anders Hejlsberg
92a8cc9f5f Fix logic that bails out of incremental parsing in certain contexts 2018-11-29 10:19:42 -08:00
Klaus Meinhardt
1ad7b0fe69 forEachToken: correctly handle JSDocTag (#28369)
* forEachChild: handle JSDocTags and all their children

* fix codefix for unused identifier

* fix lint

* fix build

* Fix test failures
2018-11-15 13:22:25 -08:00
Andy
772f6cdf48 Remove JSDocTag#atToken (#28376) 2018-11-06 09:54:23 -08:00
Caleb Sander
28e9ec497c Address review comments 2018-11-05 11:36:32 -08:00
Caleb Sander
188c07865a Scan bigint literals 2018-11-05 11:36:31 -08:00
Andy
36dfd775b3 Parse an object literal property as shorthand unless followed by '(' or ':' (#28121) 2018-10-26 15:00:31 -07:00
Andy
efc831e0ba At '.' in array literal, don't close the array (#28120) 2018-10-25 12:25:33 -07:00
Andy
54a5be1860 At '.' in object literal, don't close the object (#27850)
* At '.' in object literal, don't close the object

* Include diagnostics test
2018-10-12 08:49:04 -07:00
Andy
f6ca10565d Fix bug: Ensure JSDoc type range is valid (#27343) 2018-10-08 17:09:48 -07:00
Andy
dd9b8cab34 Have scanJsDocToken scan keywords (#27162)
* Have scanJsDocToken scan keywords

* Update API
2018-10-08 14:42:51 -07:00
Andy
deeb40129d Remove duplicate case in parseJsDocCommentWorker (#27164) 2018-10-04 15:44:01 -07:00
Nathan Shively-Sanders
21148b3b0a Fix typo in PseudoPragma* types (#27437) 2018-09-28 10:39:30 -07:00
Andy
f71d6005a2 Use nextToken() after parsing a tag name so we can parse type keywords (#26915)
* Use nextToken() after parsing a tag name so we can parse type keywords

* Make callback to skipWhitespaceOrAsterisk non-optional
2018-09-13 15:49:06 -07:00