Skip to content

Commit

Permalink
Remove tab
Browse files Browse the repository at this point in the history
  • Loading branch information
nadongguri committed Feb 14, 2018
1 parent 0950403 commit 0d2ea77
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lint_rules/noImportOtherModulesRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ export class Rule extends Lint.Rules.AbstractRule {
class NoImportOtherModulesWalker extends Lint.RuleWalker {
public visitImportDeclaration(node: ts.ImportDeclaration) {
// create a failure at the current position
const PROJECT_STRING = "bacardi";
const sourcePath = (node.parent as ts.SourceFile).fileName;
const importPath = (node.moduleSpecifier as any).text as string;
if (importPath.includes('/')) {
let importModuleName = importPath.split('/')[0];
let relativeSourcePath = sourcePath.split(PROJECT_STRING)[1];
let sourceModuleName = relativeSourcePath.split('/')[1];
if (importModuleName != sourceModuleName) {
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING));
}
}
const PROJECT_STRING = "bacardi";
const sourcePath = (node.parent as ts.SourceFile).fileName;
const importPath = (node.moduleSpecifier as any).text as string;
if (importPath.includes('/')) {
let importModuleName = importPath.split('/')[0];
let relativeSourcePath = sourcePath.split(PROJECT_STRING)[1];
let sourceModuleName = relativeSourcePath.split('/')[1];
if (importModuleName != sourceModuleName) {
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING));
}
}

// call the base version of this visitor to actually parse this node
super.visitImportDeclaration(node);
Expand Down

0 comments on commit 0d2ea77

Please sign in to comment.