Skip to content

Commit

Permalink
fix(eslint): do not set files if ignores is set (#2552)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu-crouzet authored Dec 5, 2024
2 parents e6dd36e + 2f75fbc commit 352c82a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 4 additions & 5 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import {
dirname,
posix,
relative,
sep
sep,
} from 'node:path';
import {
fileURLToPath,
pathToFileURL
pathToFileURL,
} from 'node:url';
import shared from './eslint.shared.config.mjs';
import {
sync
sync,
} from 'globby';

const __filename = fileURLToPath(import.meta.url);
Expand Down Expand Up @@ -43,11 +43,10 @@ const mergeESLintConfigs = async (globs) => {
localConfigs = localConfigs.concat(
configArray.map((config) => ({
...config,
files: (config.files || ['**/*']).flat().map((pathGlob) => addPrefix(directory, pathGlob)),
...(
config.ignores
? { ignores: config.ignores.map((pathGlob) => addPrefix(directory, pathGlob)) }
: {}
: { files: (config.files || ['**/*']).flat().map((pathGlob) => addPrefix(directory, pathGlob)) }
)
}))
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ const mergeESLintConfigs = async (globs) => {
localConfigs = localConfigs.concat(
configArray.map((config) => ({
...config,
files: (config.files || ['**/*']).flat().map((pathGlob) => addPrefix(directory, pathGlob)),
...(
config.ignores
? { ignores: config.ignores.map((pathGlob) => addPrefix(directory, pathGlob)) }
: {}
: { files: (config.files || ['**/*']).flat().map((pathGlob) => addPrefix(directory, pathGlob)) }
)
}))
);
Expand Down

0 comments on commit 352c82a

Please sign in to comment.