estree-to-babel
Advanced tools
Comparing version 4.8.0 to 4.9.0
'use strict'; | ||
const traverse = require('@babel/traverse').default; | ||
const {isObjectExpression} = require('@babel/types'); | ||
const { | ||
isObjectExpression, | ||
isExportDeclaration, | ||
} = require('@babel/types'); | ||
@@ -13,2 +16,3 @@ const traverseObjectExpression = require('./traverse-object-expression'); | ||
const convertImportDeclaration = require('./convert-import-declaration'); | ||
const convertExportDeclaration = require('./convert-export-declaration'); | ||
const { | ||
@@ -59,2 +63,5 @@ convertTSClassImplements, | ||
if (isExportDeclaration(path)) | ||
return convertExportDeclaration(path); | ||
if (type === 'ChainExpression') | ||
@@ -61,0 +68,0 @@ return convertChainExpression(path); |
{ | ||
"name": "estree-to-babel", | ||
"version": "4.8.0", | ||
"version": "4.9.0", | ||
"type": "commonjs", | ||
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", | ||
@@ -44,3 +45,3 @@ "description": "convert estree ast to babel", | ||
"eslint-plugin-node": "^11.0.0", | ||
"eslint-plugin-putout": "^11.11.0", | ||
"eslint-plugin-putout": "^13.6.0", | ||
"espree": "^9.0.0", | ||
@@ -50,3 +51,3 @@ "estree-util-attach-comments": "^2.0.0", | ||
"nodemon": "^2.0.2", | ||
"putout": "^22.1.1", | ||
"putout": "^24.2.2", | ||
"supertape": "^6.0.5", | ||
@@ -53,0 +54,0 @@ "typescript": "^4.5.2" |
@@ -11,3 +11,3 @@ # Estree-to-babel [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL] | ||
Convert [`ESTree`](https://github.com/estree/estree) compatible `JavaScript AST` to [`Babel AST`](https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md). | ||
Convert [`ESTree`](https://github.com/estree/estree)-compatible `JavaScript AST` to [`Babel AST`](https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md). | ||
@@ -29,3 +29,3 @@ To use parsers like: | ||
- `Property` of `ObjectExpression` called `ObjectProperty`; | ||
- `Property` of `ObjectExpression` and `ObjectPattern` called `ObjectProperty`; | ||
- `FunctionExpression` of a `Property` located in `ObjectMethod` node; | ||
@@ -40,21 +40,14 @@ - `File` node; | ||
- `OptionalMemberExpression` and `OptionalCallExpression` instead of `ChainExpression`; | ||
- `ImportDeclaration` has `assertions`; | ||
- `ImportDeclaration` and `ExportNamedDeclaration` has `assertions`; | ||
- etc... | ||
Also `@babel/parser` has differences with [typescript-estree](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/typescript-estree): | ||
Also [`@babel/parser`](https://babeljs.io/docs/en/babel-parser) has differences with [`typescript-estree`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/typescript-estree): | ||
- `TSExpressionWithTypeArguments` instead of `TSClassImplements`; | ||
- `ClassPrivateProperty` instead of `PropertyDefinition` when `key.type=PrivateName`; | ||
- `ClasseProperty` instead of `PropertyDefinition` when `key.type=Identifier`; | ||
- `PrivateName` instead of `PrivateIdentifier`; | ||
- `TSInterfaceHeritage` instead of `TSExpressionWithTypeArguments`; | ||
- `TSQualifiedName` instead of `MemberExpression` in `TSInterfaceHeritage`; | ||
- `TSDeclaredMethod` with `abstract=true` instead of `TSAbstractMethodDefinition`; | ||
- etc... | ||
@@ -61,0 +54,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22336
17
378
83