Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/dependency-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,15 @@ function gatherImported() {

for (const {imports} of dependencyGraph.values()) {
for (const [importedFilename, importedIdentifiers] of imports) {
filenames.add(importedFilename)
// require.resolve will expand any symlinks to their fully qualified
// directories. We can use this (with the absolute path given in
// importedFilename to quickly expand symlinks, which allows us to have
// symlinks (aka workspaces) in node_modules, and not fail the lint.
const fullyQualifiedImportedFilename = require.resolve(importedFilename)
filenames.add(fullyQualifiedImportedFilename)

for (const importedIdentifier of importedIdentifiers) {
identifiers.add(`${importedFilename}#${importedIdentifier}`)
identifiers.add(`${fullyQualifiedImportedFilename}#${importedIdentifier}`)
}
}
}
Expand Down