Justin Ridgewell
b1793656e6
Add aliases for Standardized, TypeScript, and Flow ( #13666 )
...
* Ensure non-standard types have an appropriate alias
This helps with filter out the types. Eg, I'm concerned with just the core JS types, and in I can derive them via:
```typescript
type Core = Exclude<t.Node, t.TypeScript | t.Flow>;
```
* Lint
* Export deprecated alias types
* Add docs descriptions for new aliases
* Add Standardized alias
* Fix inherits aliases
* Filter aliases from node types
* Remove Proposal alias
2021-10-28 14:14:32 -04:00
Mickey Rose
b5907ef967
remove executable permission from files that shouldn't have it ( #13873 )
2021-10-23 14:18:30 +02:00
Huáng Jùnliàng
29f697c84e
Implement @babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression ( #13842 )
...
* fix: register function expression id after params
* implement bugfix plugin
* add more testcases
* fix: do not skip pattern binding referencing id
* update compat-table
* add bugfix plugin to preset-env
* update Babel 8 test fixtures
* Update packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/README.md
* chore: bundle bugfix plugin
* address review comments
* add runtime version check
* update compat table
* fix syntax error
* update test fixtures
* revert bugfixes targets update
* update Babel 8 test fixtures
2021-10-20 15:53:40 -04:00
Huáng Jùnliàng
21eeb8e7a9
Restore traversal context after enter / traverse ( #13813 )
2021-10-11 19:04:01 +02:00
Huáng Jùnliàng
49a0d65be1
Mark static block as FunctionParent ( #13832 )
...
* refactor: move StaticBlock definition to core
* update generated types
* fix: mark StaticBlock as FunctionParent
* revise testcase
* update babel-types docs
2021-10-10 20:22:27 -04:00
Huáng Jùnliàng
51c6a99c8e
getBindingIdentifiers should return params for private methods (#13723 )
...
* docs: add comments on binding kind
* refactor: simplify For collector visitor
* getBinding does not return falsy values
* chore: table style tests
* add more test cases
* fix: return params for private methods
2021-09-02 21:55:39 +02:00
Huáng Jùnliàng
614b486780
Use named imports for babel types ( #13685 )
...
* migrate to named babel types imports
* perf: transform babel types import to destructuring
* fix merge errors
* apply plugin to itself
2021-08-18 10:28:40 -04:00
王清雨
b00bd94ad8
convert @babel/helpers to typescript ( #13679 )
...
Co-authored-by: Federico Ciardi <fed.ciardi@gmail.com>
2021-08-16 22:39:30 +02:00
Federico Ciardi
10640b2aad
perf: partially replace .concat with .push ( #13609 )
2021-08-14 16:57:06 +02:00
J. S. Choi
6276853eb9
Add support for the "Hack" pipeline proposal ( #13191 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-08-03 23:30:16 +02:00
王清雨
1960f23c22
Add typings to create-class-features-plugin helper ( #13570 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-08-02 21:22:37 +02:00
王清雨
d45ad500e7
Improve path.get typings with TS template literal types ( #13588 )
2021-07-28 21:47:29 +02:00
Anna Henningsen
d1f908924c
Fix completion record for variable declarations ( #13596 )
2021-07-27 23:50:47 +02:00
王清雨
e0dc925bbe
feat(traverse): specific return type for virtual types' validators ( #13578 )
...
* feat(traverse): specific return type for virtual types' validators
update generator script to use virtualType.types[0] as it's type
fix #13576
* fix: remove unused ts-expect-error
so glad that it works
* feat: use VirtualTypeAliases to generate validators for virtual types
* fix: return boolean when it doesn't have any alias
* fix: use type only import and simplify condition
2021-07-27 10:02:09 -04:00
Andy Edwards
1d48bb0d8c
add 12 missing NODE_FIELDS ( #13577 )
...
* test: add fields test
* fix(babel-types): add missing NODE_FIELDS and tests
fix #13558
fix #13563
* chore: avoid using fs-extra
* chore: code cleanup
* chore: avoid util.promisify
* fix: remove bad ts-expect-error suppressions
2021-07-23 09:36:08 -04:00
Nitin Kumar
bc1b9537b0
Fix arrow transformation when arguments is defined as variable ( #12344 )
...
* fix: arrow-fn transformation when 'arguments' is defined as var
* fix: tests
* refactor: code
* Review by @nicolo-ribaudo
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-07-06 13:59:24 -04:00
Colin Wang
a5a63e3033
fix: accept duplicated import/variable in different module ( #13527 )
...
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2021-07-06 19:18:12 +02:00
Huáng Jùnliàng
dddb4133d2
fix: remove traverse trap on NODE_ENV == "test" ( #13475 )
2021-06-17 16:29:56 +02:00
Huáng Jùnliàng
8720919665
fix: hoist variable declaration within do block ( #13122 )
...
* fix: hoist variable declaration within do block
* test: add input for variable-declaration-start
* test: actually write a test for this issue
* make prettier happy
2021-06-03 21:39:19 -04:00
Huáng Jùnliàng
875fc8e693
[babel 8] Do not skip requeued paths ( #13291 )
2021-05-11 23:55:23 +02:00
Sosuke Suzuki
b2d9156cc6
Update to Prettier 2.3 ( #13288 )
2021-05-10 15:34:13 +02:00
George Zahariev
8433cd0c05
Support parsing Flow's Optional Indexed Access Types ( #13224 )
2021-04-28 18:21:31 +02:00
Sosuke Suzuki
f8aa32f767
Support parsing Flow's Indexed Access Types ( #13053 )
2021-04-28 18:21:31 +02:00
Anna Henningsen
b971e00eb0
Fix completion record for labeled statement ( #13084 )
...
`{labelAlthoughIMeantItToBeAKey: value}` strikes again :)
2021-04-20 11:08:46 -04:00
Tan Li Hau
6b57145d38
Support yield in do expression ( #10101 )
...
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2021-04-06 17:09:14 +02:00
Huáng Jùnliàng
b577e44d16
Refactor switch support in NodePath#getCompletionRecords ( #13030 )
2021-04-02 13:36:05 -04:00
Anna Henningsen
1ef78ca55b
Expand type definitions for path.{get,set}Data to cover symbols ( #13044 )
2021-03-24 14:04:13 +01:00
Sosuke Suzuki
9c567baa9b
Parse JS Module Blocks proposal ( #12469 )
2021-02-21 20:08:20 +01:00
Tim Seckinger
774c526390
referencesImport: support named exports accessed via * imports ( #12603 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-02-21 17:54:43 +01:00
Nicolò Ribaudo
6ef7b51a11
Implement assumptions defined in the babel/rfcs#5 RFC
...
- `mutableTemplateObject` and `ignoreToPrimitiveHint` (#12408 )
- `setClassMethods` (#12407 )
- `setComputedProperties` (#12490 )
- `ignoreFunctionLength` (#12491 )
- `noDocumentAll` (#12481 )
- `iterableIsArray` and `arrayLikeIsIterable` (#12489 )
- `pureGetters` (#12504 )
- `skipForOfIteratorClosing` (#12496 )
- `objectRestNoSymbols`, `setSpreadProperties` and `pureGetters` (#12505 )
- `noNewArrows` (#12613 , #12793 )
- `setPublicClassFields` and `privateFieldsAsProperties` (#12497 )
- `constantReexports` and `enumerableModuleMeta` (#12618 )
- `constantSuper`, `superIsCallableConstructor` and `noClassCalls` (#12726 )
Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Co-authored-by: Huáng Jùnliàng <JLHwung@users.noreply.github.com>
2021-02-21 17:09:45 +01:00
Federico Ciardi
8316cdaa8a
typo: correct variable name ( #12837 )
2021-02-20 22:03:24 +01:00
overlookmotel
792672ec60
Fix scope of computed method keys ( #12812 )
...
* Fix scope of computed method keys
* Test for nested computed keys
* Fix scope.rename with computed method keys
* Optional chaining tests
2021-02-19 02:36:34 +01:00
Huáng Jùnliàng
4462eeae6b
Clean up traverse scope ( #12797 )
2021-02-16 23:23:34 +01:00
Nicolò Ribaudo
bab5c62f90
Fix class fields when super() is in a default param ( #12729 )
...
* Fix class fields when `super()` is in a default param
* Use assertion instead of type cast
2021-02-02 15:38:07 +01:00
Bogdan Savluk
d98418efbe
Convert @babel/traverse to TypeScript ( #12488 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-01-24 01:33:09 +01:00
Brian Ng
fec4a132ad
Bump prettier@2.2.1 ( #12633 )
2021-01-14 14:10:47 -05:00
Zen
e08f68bf61
Skip discriminant when renaming starting from SwitchStatement ( #12530 )
2020-12-22 03:10:43 +01:00
Nicolò Ribaudo
695abb8dfc
Set correct path.context un push/unshiftContainer ( #12394 )
2020-11-25 16:51:58 +01:00
Huáng Jùnliàng
eea3065039
Update pathCache in NodePath#_replaceWith ( #12391 )
...
* add tests on regression 12386
* fix: update cache on _replaceWith
* fix: pathCache in replaceWithMultiple could be nullish
* Update packages/babel-traverse/src/path/replacement.js
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* test: add replaceWith test to traverse
Co-authored-by: Brian Ng <bng412@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-11-24 15:07:20 -05:00
Nicolò Ribaudo
4f9ad5cc3a
Avoid infinite loops in type inference logic ( #12390 )
2020-11-23 17:03:01 +01:00
Nicolò Ribaudo
7d2a14b856
Initialize NodePath context when using getSibling ( #12387 )
2020-11-23 16:03:11 +01:00
Nicolò Ribaudo
2984f0cb88
Use the correct context when re-using a cached NodePath ( #12331 )
2020-11-10 15:03:21 +01:00
Huáng Jùnliàng
0641a15030
Reduce linear search on list traversing ( #12302 )
...
* perf: reduce linear search on list traversing
* fix: remove parent cache when replacing node
2020-11-04 20:14:51 -05:00
Huáng Jùnliàng
ea2892fefc
add declare to class properties type annotations ( #12257 )
...
* add declare to class properties type annotations
* chore: use preset-flow
2020-10-27 10:05:01 -04:00
Huáng Jùnliàng
f697e7995d
Transform class static block ( #12143 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Brian Ng <bng412@gmail.com>
2020-10-14 21:16:24 +02:00
James Addison
94b5f92e39
Replace lodash 'defaults' usage with ES6 Spread initializer ( #11797 )
...
Co-authored-by: Corey Farrell <git@cfware.com>
2020-10-14 20:10:44 +02:00
Huáng Jùnliàng
e0b2bfb78f
fix: mark Pattern in CatchClause as scope ( #12119 )
2020-09-29 15:04:24 -04:00
Barron Wei
1a8e7ff2ec
fix(do-expr): SwitchStatement with IfStatement cases ( #11728 )
...
* test(do-expr): condition before break
* test(do-expr): labeled break
* fix(do-expr): add check for break in BlockStatement
* fix(do-expr): add LabeledStatement case for getCompletionRecords
* test(do-expr): rename condition before break to condition before expression
* revert(do-expr): undo remove break for do switch
* revert(do-expr): undo remove labeled break
* test(do-expr): add condition before break
* test(do-expr): update condition before break
* test(do-expr): remove labeled break
* fix(do-expr): add tree search in findBreak
* fix(do-expr): ignore isFunction case in findBreak
2020-09-18 10:34:35 -04:00
Johan Holmerin
b9407d7660
Forward deopt node path in NodePath#evaludate ( #11832 )
...
* Forward deopt node path
* Move deopt evaluation tests
* Document evaluate deopt property
2020-08-20 16:20:19 -04:00
James Addison
9daa50e005
babel-traverse: prefer clearer, reduced-bias option naming ( #11791 )
...
* babel-traverse: prefer clearer, reduced-bias option naming
* Apply suggestions from code review
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-07-29 16:41:20 -04:00