Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Allow to define patterns against absolute file path (again) #589

@Avaq

Description

@Avaq

Hi! I'm opening this issue because it seems that the last time this issue was solved, the solution got lost at some point.

The solution introduced most notably this change:

depcheck/src/check.js

Lines 123 to 126 in 98ad446

function checkFile(dir, filename, deps, parsers, detectors) {
const targets = lodash(parsers)
.keys()
.filter(glob => minimatch(filename, glob, { dot: true }))

But on main and master, the change has gone missing, and the code still checks against the basename of files, making it impossible to have different parsers on different directories:

depcheck/src/check.js

Lines 97 to 103 in adb2166

function checkFile(dir, filename, deps, parsers, detectors) {
debug('depcheck:checkFile')(filename);
const basename = path.basename(filename);
const targets = lodash(parsers)
.keys()
.filter((glob) => minimatch(basename, glob, { dot: true }))

Could it be that this change was lost when 0.7.0 was released? The change was part of 0.7.0-beta, and it seems there were some chronology issues during that time: #304

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions