tslint-no-circular-imports
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -39,3 +39,5 @@ "use strict"; | ||
// roots defined in tsconfig.json. | ||
const resolvedImportFileName = path_1.resolve(path_1.dirname(thisFileName), importFileName + '.ts'); | ||
const resolvedImportFileName = isImportFromNPMPackage(importFileName) | ||
? importFileName | ||
: path_1.resolve(path_1.dirname(thisFileName), importFileName + '.ts'); | ||
// add to import graph | ||
@@ -72,2 +74,5 @@ this.addToGraph(resolvedThisFileName, resolvedImportFileName); | ||
} | ||
function isImportFromNPMPackage(filename) { | ||
return !(filename.startsWith('.') || filename.startsWith('/') || filename.startsWith('~')); | ||
} | ||
//# sourceMappingURL=noCircularImportsRule.js.map |
@@ -45,3 +45,5 @@ import { basename, resolve, dirname } from 'path' | ||
// roots defined in tsconfig.json. | ||
const resolvedImportFileName = resolve(dirname(thisFileName), importFileName + '.ts') | ||
const resolvedImportFileName = isImportFromNPMPackage(importFileName) | ||
? importFileName | ||
: resolve(dirname(thisFileName), importFileName + '.ts') | ||
@@ -86,2 +88,6 @@ // add to import graph | ||
} | ||
} | ||
function isImportFromNPMPackage(filename: string) { | ||
return !(filename.startsWith('.') || filename.startsWith('/') || filename.startsWith('~')) | ||
} |
{ | ||
"name": "tslint-no-circular-imports", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "TSLint plugin to detect and warn about circular imports", | ||
@@ -5,0 +5,0 @@ "main": "tslint-no-circular-imports.json", |
Sorry, the diff of this file is not supported yet
21790
258