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

Commit ebde5a7

Browse files
committed
Revert "fix: Allow directory-based ignores for files matches"
This reverts commit 0163f31.
1 parent 2e76711 commit ebde5a7

File tree

2 files changed

+1
-43
lines changed

2 files changed

+1
-43
lines changed

src/config-array.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,7 @@ function shouldIgnorePath(ignores, filePath, relativeFilePath) {
204204

205205
// don't check negated patterns because we're not ignored yet
206206
if (!matcher.startsWith('!')) {
207-
208-
/*
209-
* In order to allow patterns such as "ignore/" to work
210-
* to ignore complete directories, we need to append "**"
211-
* at the end of any pattern that ends with a slash.
212-
* See https://github.com/eslint/eslint/issues/17213
213-
*/
214-
return matcher.endsWith('/')
215-
? doMatch(relativeFilePath, `${matcher}**`)
216-
: doMatch(relativeFilePath, matcher);
207+
return doMatch(relativeFilePath, matcher);
217208
}
218209

219210
// otherwise we're still not ignored

tests/config-array.test.js

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,39 +1252,6 @@ describe('ConfigArray', () => {
12521252
});
12531253
});
12541254

1255-
// https://github.com/eslint/eslint/issues/17213
1256-
describe('ignore entire directory', () => {
1257-
1258-
it('should return true when a subdirectory is ignored with double stars', () => {
1259-
configs = new ConfigArray([
1260-
{
1261-
files: ['**/*.js'],
1262-
ignores: ['ignored/**'],
1263-
}
1264-
], { basePath });
1265-
1266-
configs.normalizeSync();
1267-
const filename = path.resolve(basePath, 'ignored/foo.js');
1268-
1269-
expect(configs.isFileIgnored(filename)).to.be.true;
1270-
});
1271-
1272-
it('should return true when a subdirectory is ignored with trailing slash', () => {
1273-
configs = new ConfigArray([
1274-
{
1275-
files: ['**/*.js'],
1276-
ignores: ['ignored/'],
1277-
}
1278-
], { basePath });
1279-
1280-
configs.normalizeSync();
1281-
const filename = path.resolve(basePath, 'ignored/foo.js');
1282-
1283-
expect(configs.isFileIgnored(filename)).to.be.true;
1284-
});
1285-
1286-
});
1287-
12881255
});
12891256

12901257
describe('isDirectoryIgnored()', () => {

0 commit comments

Comments
 (0)