eslint-plugin-module-resolver
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -15,3 +15,3 @@ "use strict"; | ||
var findBabelConfig = require('find-babel-config'); | ||
var babel = require('@babel/core'); | ||
@@ -81,19 +81,17 @@ var path = require('path'); | ||
var alias = {}; | ||
var babelDir = projectRootAbsolutePath || '.'; | ||
var partialConfig = babel.loadPartialConfig(); | ||
var configOptions = partialConfig.options; | ||
var _findBabelConfig$sync = findBabelConfig.sync(babelDir), | ||
config = _findBabelConfig$sync.config; | ||
try { | ||
var validPluginNames = new Set(['babel-plugin-module-resolver', 'module-resolver']); | ||
var _config$plugins$filte = config.plugins.filter(function (plugins) { | ||
if (Array.isArray(plugins) && validPluginNames.has(plugins[0])) { | ||
return plugins; | ||
var _configOptions$plugin = configOptions.plugins.filter(function (plugin) { | ||
if (validPluginNames.has(plugin.file && plugin.file.request)) { | ||
return plugin; | ||
} | ||
}), | ||
_config$plugins$filte2 = _slicedToArray(_config$plugins$filte, 1), | ||
moduleResolver = _config$plugins$filte2[0]; | ||
_configOptions$plugin2 = _slicedToArray(_configOptions$plugin, 1), | ||
moduleResolver = _configOptions$plugin2[0]; | ||
alias = moduleResolver[1].alias || {}; | ||
alias = moduleResolver.options.alias || {}; | ||
} catch (error) { | ||
@@ -100,0 +98,0 @@ var message = 'Unable to find config for babel-plugin-module-resolver'; |
{ | ||
"name": "eslint-plugin-module-resolver", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Warn when using relative paths to modules aliased", | ||
@@ -40,5 +40,2 @@ "repository": "HeroProtagonist/eslint-plugin-module-resolver", | ||
}, | ||
"dependencies": { | ||
"find-babel-config": "^1.2.0" | ||
}, | ||
"devDependencies": { | ||
@@ -45,0 +42,0 @@ "@babel/cli": "^7.7.7", |
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
0
20971
309
- Removedfind-babel-config@^1.2.0
- Removedfind-babel-config@1.2.2(transitive)
- Removedjson5@1.0.2(transitive)
- Removedminimist@1.2.8(transitive)
- Removedpath-exists@3.0.0(transitive)