9 Commits

Author SHA1 Message Date
Erik Arvidsson
fba5655a44 Parenthesized expressions (#8025)
* Add parser createParenthesizedExpressions option  …

When set to `true` we create `ParenthesizedExpression` nodes instead of
setting `extra.parenthesized`.

* Also update babel-parser.d.ts
2019-03-06 22:43:36 +01:00
Justin Ridgewell
fc1ea7f496 Revert "Parenthesized expressions (#8025)"
This reverts commit dd8b700a2c4c975584c7b2ea43023aa275c16167.
2019-02-25 19:03:00 +01:00
Erik Arvidsson
dd8b700a2c Parenthesized expressions (#8025)
* Add parser createParenthesizedExpressions option  …

When set to `true` we create `ParenthesizedExpression` nodes instead of
setting `extra.parenthesized`.

* Also update babel-parser.d.ts
2019-02-23 02:45:25 -05:00
Yifei Fu
e03e5ba01d Add TypeScript definitions for parser plugin options. (#9457) 2019-02-06 10:03:54 +01:00
Sven Sauleau
6893b7e7d2
fix: [skip ci] consistent naming 2018-09-03 08:09:26 +02:00
Avi Vahl
0e8830f3a8 Fix unneeded uppercasing in comment 2018-06-15 02:46:02 +03:00
Avi Vahl
4cdfee768b Add jsdocs to parse() and parseExpression()
also change parameter name to match docs
2018-06-15 02:42:32 +03:00
Avi Vahl
adbf2a15f9 Clearer naming of interfaces 2018-06-15 01:12:58 +03:00
Avi Vahl
ca65781132 @babel/parser: expose a TypeScript definition file from package
This allows the new parser package to be used in TypeScript projects, with static type checking and auto-completions. IDEs like VSCode will use this to show auto completions even in JavaScript projects, which is a huge benefit to users wanting to use the parser directly.

This PR follows the auto-generated .d.ts that was added to @babel/types in #7101

- took outdated DefinitelyTyped babylon .d.ts and updated it using new site's documentation.
- added "typings" folder to package, with the new .d.ts
- connected new .d.ts via package.json's "types" field. also adjusted "files" so folder will be published.
- definition file uses TypeScript 2.9's new `import('package').Type` syntax.
2018-06-15 01:04:49 +03:00