firescript-linter
Advanced tools
Comparing version 0.7.0 to 0.8.0
{ | ||
"name": "firescript-linter", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "Linter for Firescript", | ||
@@ -5,0 +5,0 @@ "main": "app.js", |
const LinterNode = require('../LinterNode').LinterNode | ||
const { VariableNotDeclared } = require('../exceptions/VariableNotDeclared') | ||
class MemberExpression extends LinterNode { | ||
lint (ast) { | ||
this.lintNode(ast.object) | ||
const obj = this.getObjectNode(ast.object) | ||
if (obj.type === 'Identifier') { | ||
if (!this.isScopeVar(obj.name)) { | ||
this.lintException(new VariableNotDeclared(obj, obj.name)) | ||
} | ||
} else { | ||
this.debug('TODO: lint MemberExpression.object of type', obj.type) | ||
} | ||
this.lintNode(ast.property) | ||
this.debug('TODO: check whether MemberExpression root is defined') | ||
} | ||
getObjectNode (ast) { | ||
return ast.type === 'MemberExpression' ? this.getObjectNode(ast.object) : ast | ||
} | ||
} | ||
module.exports.MemberExpression = MemberExpression |
@@ -8,3 +8,2 @@ const { LinterNode } = require('../LinterNode') | ||
if (ast.value.type === 'Identifier') { | ||
// Right is a variable | ||
if (!this.isScopeVar(ast.value.name)) { | ||
@@ -11,0 +10,0 @@ this.lintException(new VariableNotDeclared(ast.value, ast.value.name)) |
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
62515
157
1854