Skip to content

Commit

Permalink
[fix] no-unused-modules: make appveyor tests passing
Browse files Browse the repository at this point in the history
Fixes #1317.
  • Loading branch information
rfermann authored and ljharb committed Apr 16, 2019
1 parent eddcfa9 commit 12bbfca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rules/no-unused-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ module.exports = {
// support for export { value } from 'module'
if (astNode.type === EXPORT_NAMED_DECLARATION) {
if (astNode.source) {
resolvedPath = resolve(astNode.source.value, context)
resolvedPath = resolve(astNode.source.raw.replace(/('|")/g, ''), context)
astNode.specifiers.forEach(specifier => {
let name
if (specifier.exported.name === DEFAULT) {
Expand All @@ -476,12 +476,12 @@ module.exports = {
}

if (astNode.type === EXPORT_ALL_DECLARATION) {
resolvedPath = resolve(astNode.source.value, context)
resolvedPath = resolve(astNode.source.raw.replace(/('|")/g, ''), context)
newExportAll.add(resolvedPath)
}

if (astNode.type === IMPORT_DECLARATION) {
resolvedPath = resolve(astNode.source.value, context)
resolvedPath = resolve(astNode.source.raw.replace(/('|")/g, ''), context)
if (!resolvedPath) {
return
}
Expand Down

0 comments on commit 12bbfca

Please sign in to comment.