Skip to content

Commit

Permalink
Fix overrides property ignoring dot directories (#5629)
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Oct 22, 2021
1 parent 482dcb1 commit 397586e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions lib/__tests__/applyOverrides.test.js
Expand Up @@ -99,6 +99,29 @@ describe('single matching override', () => {

expect(applied).toEqual(expectedConfig);
});

test('override with dot dir', () => {
const config = {
overrides: [
{
files: ['**/*.scss'],
customSyntax: 'postcss-scss',
},
],
};

const expectedConfig = {
customSyntax: 'postcss-scss',
};

const applied = applyOverrides(
config,
__dirname,
path.join(__dirname, '.dot-dir', 'style.scss'),
);

expect(applied).toEqual(expectedConfig);
});
});

describe('two matching overrides', () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/augmentConfig.js
Expand Up @@ -415,7 +415,7 @@ function applyOverrides(fullConfig, configDir, filePath) {
// Glob patterns for micromatch should be in POSIX-style
.map((s) => normalizePath(s));

if (micromatch.isMatch(filePath, filesGlobs)) {
if (micromatch.isMatch(filePath, filesGlobs, { dot: true })) {
config = mergeConfigs(config, configOverrides);
}
}
Expand Down

0 comments on commit 397586e

Please sign in to comment.