Skip to content

Commit

Permalink
Change ignoreFiles to be extendable (#5596)
Browse files Browse the repository at this point in the history
  • Loading branch information
Airkro committed Oct 18, 2021
1 parent 1b4162f commit 367142a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions docs/user-guide/configure.md
Expand Up @@ -385,8 +385,6 @@ If the globs are absolute paths, they are used as is. If they are relative, they
- the config's filepath, if the config is a file that Stylelint found a loaded;
- or `process.cwd()`.

The `ignoreFiles` property is stripped from extended configs: only the root-level config can ignore files.

_Note that this is not an efficient method for ignoring lots of files._ If you want to ignore a lot of files efficiently, use [`.stylelintignore`](ignore-code.md) or adjust your files globs.

## `processors`
Expand Down
4 changes: 2 additions & 2 deletions lib/__tests__/ignore.test.js
Expand Up @@ -245,8 +245,8 @@ test('extending a config that ignores files', async () => {
// empty-block.css found
expect(results[0].source).toContain('empty-block.css');

// empty-block.css linted
expect(results[0].warnings).toHaveLength(1);
// empty-block.css not linted
expect(results[0].warnings).toHaveLength(0);

// invalid-hex.css found
expect(results[1].source).toContain('invalid-hex.css');
Expand Down
4 changes: 2 additions & 2 deletions lib/augmentConfig.js
Expand Up @@ -58,9 +58,9 @@ async function augmentConfigExtended(stylelint, cosmiconfigResult) {
}

const configDir = path.dirname(cosmiconfigResult.filepath || '');
const { ignoreFiles, ...cleanedConfig } = cosmiconfigResult.config;
const { config } = cosmiconfigResult;

const augmentedConfig = await augmentConfigBasic(stylelint, cleanedConfig, configDir);
const augmentedConfig = await augmentConfigBasic(stylelint, config, configDir);

return {
config: augmentedConfig,
Expand Down

0 comments on commit 367142a

Please sign in to comment.