hermes-eslint
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -35,4 +35,28 @@ /** | ||
this._typeAnnotationCallback = typeAnnotationCallback; | ||
} // | ||
// Helpers | ||
// | ||
visitCallExpression(node) { | ||
// arguments are right hand nodes. | ||
node.arguments.forEach(a => { | ||
this.rightHandNodes.push(a); | ||
}); | ||
this.visit(node.callee); | ||
} | ||
visitMemberExpression(node) { | ||
// Computed property's key is a right hand node. | ||
if (node.computed === true) { | ||
this.rightHandNodes.push(node.property); | ||
} // the object is only read, write to its property. | ||
this.rightHandNodes.push(node.object); | ||
} // | ||
// Visitors | ||
// | ||
ArrayExpression(node) { | ||
@@ -71,7 +95,3 @@ this.visitArray(node.elements); | ||
CallExpression(node) { | ||
// arguments are right hand nodes. | ||
node.arguments.forEach(a => { | ||
this.rightHandNodes.push(a); | ||
}); | ||
this.visit(node.callee); | ||
this.visitCallExpression(node); | ||
} | ||
@@ -96,9 +116,11 @@ | ||
MemberExpression(node) { | ||
// Computed property's key is a right hand node. | ||
if (node.computed === true) { | ||
this.rightHandNodes.push(node.property); | ||
} // the object is only read, write to its property. | ||
this.visitMemberExpression(node); | ||
} | ||
OptionalCallExpression(node) { | ||
this.visitCallExpression(node); | ||
} | ||
this.rightHandNodes.push(node.object); | ||
OptionalMemberExpression(node) { | ||
this.visitMemberExpression(node); | ||
} | ||
@@ -105,0 +127,0 @@ |
@@ -128,2 +128,7 @@ /** | ||
visitCallExpression(node) { | ||
this.visitChildren(node, ['typeArguments']); | ||
this.visitType(node.typeArguments); | ||
} | ||
visitClass(node) { | ||
@@ -300,4 +305,3 @@ _ClassVisitor.ClassVisitor.visit(this, node); | ||
CallExpression(node) { | ||
this.visitChildren(node, ['typeArguments']); | ||
this.visitType(node.typeArguments); | ||
this.visitCallExpression(node); | ||
} | ||
@@ -465,2 +469,6 @@ | ||
OptionalCallExpression(node) { | ||
this.visitCallExpression(node); | ||
} | ||
OptionalMemberExpression(node) { | ||
@@ -578,2 +586,6 @@ this.visitMemberExpression(node); | ||
DeclareModuleExports(node) { | ||
this.visitType(node); | ||
} | ||
DeclareInterface(node) { | ||
@@ -580,0 +592,0 @@ this.visitType(node); |
@@ -121,2 +121,6 @@ /** | ||
DeclareModuleExports(node) { | ||
this.visit(node.typeAnnotation); | ||
} | ||
DeclareFunction(node) { | ||
@@ -227,6 +231,14 @@ this._referencer.currentScope().defineIdentifier(node.id, new _definition.FunctionNameDefinition(node.id, node)); // the function type is stored as an annotation on the ID | ||
currentNode = currentNode.qualification; | ||
} // qualified names can only reference values! | ||
} // qualified names *usually* only reference values like | ||
// import * as Foo from 'foo'; | ||
// type T = Foo.Bar; | ||
// however, it is possible for a module to do something like | ||
// class Class { ... } | ||
// export default { Class } | ||
// meaning this is also valid | ||
// import type Foo from 'foo'; | ||
// type T = Foo.Class; | ||
this._referencer.currentScope().referenceValue(currentNode); | ||
this._referencer.currentScope().referenceDualValueType(currentNode); | ||
} | ||
@@ -233,0 +245,0 @@ |
{ | ||
"name": "hermes-eslint", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "A custom parser for ESLint using the Hermes parser", | ||
@@ -16,5 +16,5 @@ "main": "dist/index.js", | ||
"esrecurse": "^4.3.0", | ||
"hermes-estree": "0.6.0", | ||
"hermes-parser": "0.6.0" | ||
"hermes-estree": "0.7.0", | ||
"hermes-parser": "0.7.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
232699
3290
0
+ Addedhermes-estree@0.7.0(transitive)
+ Addedhermes-parser@0.7.0(transitive)
- Removedhermes-estree@0.6.0(transitive)
- Removedhermes-parser@0.6.0(transitive)
Updatedhermes-estree@0.7.0
Updatedhermes-parser@0.7.0