eslint / rewrite

Monorepo for the new version of ESLint
Apache License 2.0
169 stars 11 forks source link

fix: `basePath` directory can never be ignored #92

Closed mdjermanovic closed 4 months ago

mdjermanovic commented 4 months ago

Prerequisites checklist

What is the purpose of this pull request?

Fixes a bug in ConfigArray#isDirectoryIgnored().

When basePath directory is passed in as the directoryPath to check, isDirectoryIgnored() mistakenly checks / against ignore patterns. Then it can match, and thus return true, patterns like / (which should be no-op/invalid as an absolute path pattern) or ** (which is valid but should not match the basePath directory).

What changes did you make? (Give an overview)

Fixed isDirectoryIgnored() to always return false for the basePath directory.

Related Issues

refs https://github.com/eslint/eslint/issues/18706

Is there anything you'd like reviewers to focus on?

nzakas commented 4 months ago

Just a reminder, we shouldn't be merging PRs that are opened over the weekend during the weekend. We need to give others a chance to review even if they're not online. (ref: when to merge)