Skip to content

[Fix] no-extraneous-dependencies: match dependency globs inside dot directories - #3314

Open
Yurii201811 wants to merge 2 commits into
import-js:mainfrom
Yurii201811:fix/no-extraneous-dependencies-dot-globs-3311
Open

Yurii201811 wants to merge 2 commits into
import-js:mainfrom
Yurii201811:fix/no-extraneous-dependencies-dot-globs-3311

Conversation

@Yurii201811

Copy link
Copy Markdown

I changed testConfig in src/rules/no-extraneous-dependencies.js so dependency globs pass { dot: true } to minimatch. A file under .worktrees/ failed **/libs/**/*.ts because ** skips a directory whose name starts with a dot. src/core/listFilesWithNodeFs.js already matches that way.

Closes #3311

How Has This Been Tested?

On Node v25.4.0, with minimatch 3.1.5 and ESLint 8.57.1, the three new valid cases failed before the change (131 passing, 3 failing). After it:

  • npm run mocha -- tests/src/rules/no-extraneous-dependencies.js passed, 134 tests.
  • npm test passed, 3148 tests, then eslint ., eslint-doc-generator --check, and markdownlint "**/*.md".
  • git diff --check passed.

I did not run the ESLint 8/9/10 matrix, npm run test-compiled, or the example package lints. The new fixture was not checked on Windows. The changelog cites issue #3311. This pull request had no number when that line was written.

Prepared with Cursor assistance.

@codecov

codecov Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.59%. Comparing base (a60d715) to head (ad01cf3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3314   +/-   ##
=======================================
  Coverage   79.59%   79.59%           
=======================================
  Files          98       98           
  Lines        4549     4549           
  Branches     1543     1575   +32     
=======================================
  Hits         3621     3621           
  Misses        928      928           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…re on old Node

CI threw ENOENT from `fs.mkdirSync(path, { recursive: true })` at `tests/src/rules/no-extraneous-dependencies.js:41` on Node v8.17.0 and Node v9.11.2. `fs.mkdtempSync` had already created the temp directory, and those versions ignore the options object. `fs.mkdtempSync` is absent on Node 4, and that major is red too. I added `makeTempDir` and `mkdirpSync`, which call `fs.mkdirSync` one directory at a time.

On Node v25.4.0, `npm run mocha -- tests/src/rules/no-extraneous-dependencies.js` passed 134 tests, and `ESLINT_USE_FLAT_CONFIG=false npx eslint` on that file passed. `git diff --check` passed. I did not rerun the full matrix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

no-extraneous-dependencies: dependency globs don't match files under folders starting with a dot

1 participant