Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ignoreFiles to be extendable #5596

Merged
merged 1 commit into from Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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