diff --git a/lib/__tests__/applyOverrides.test.js b/lib/__tests__/applyOverrides.test.js index c44b3c7a2a..c9eefd1310 100644 --- a/lib/__tests__/applyOverrides.test.js +++ b/lib/__tests__/applyOverrides.test.js @@ -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', () => { diff --git a/lib/augmentConfig.js b/lib/augmentConfig.js index 6519311949..337affc102 100644 --- a/lib/augmentConfig.js +++ b/lib/augmentConfig.js @@ -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); } }