eslint-import-resolver-typescript
Advanced tools
Comparing version 1.0.0 to 1.0.1
25
index.js
const resolve = require('resolve'); | ||
const path = require('path'); | ||
module.exports.interfaceVersion = 2; | ||
function opts(file, config) { | ||
@@ -11,16 +9,19 @@ return Object.assign( | ||
// path.resolve will handle paths relative to CWD | ||
{ basedir: path.dirname(path.resolve(file)) }, | ||
{ basedir: path.dirname(path.resolve(file)) } | ||
); | ||
} | ||
module.exports.resolve = function(source, file, config) { | ||
if (resolve.isCore(source)) { | ||
return { found: true, path: null }; | ||
} | ||
module.exports = { | ||
interfaceVersion: 2, | ||
resolve: function(source, file, config) { | ||
if (resolve.isCore(source)) { | ||
return { found: true, path: null }; | ||
} | ||
try { | ||
return { found: true, path: resolve.sync(source, opts(file, config)) }; | ||
} catch (err) { | ||
return { found: false }; | ||
} | ||
try { | ||
return { found: true, path: resolve.sync(source, opts(file, config)) }; | ||
} catch (err) { | ||
return { found: false }; | ||
} | ||
}, | ||
}; |
{ | ||
"name": "eslint-import-resolver-typescript", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "TypeScript .ts .tsx module resolver for `eslint-plugin-import`.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
1544
23