From 2f75fbc95ff51b7c575c14bb2a6e4373a1667b4a Mon Sep 17 00:00:00 2001 From: matthieu-crouzet Date: Wed, 4 Dec 2024 14:52:17 +0100 Subject: [PATCH] fix(eslint): do not set files if ignores is set --- eslint.config.mjs | 9 ++++----- .../workspace/eslint.config.__extension__.template | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index a8ed02634d..a0a307dd48 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -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); @@ -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)) } ) })) ); diff --git a/packages/@o3r/eslint-config/schematics/ng-add/eslint/templates/workspace/eslint.config.__extension__.template b/packages/@o3r/eslint-config/schematics/ng-add/eslint/templates/workspace/eslint.config.__extension__.template index c51b535874..cdee83a998 100644 --- a/packages/@o3r/eslint-config/schematics/ng-add/eslint/templates/workspace/eslint.config.__extension__.template +++ b/packages/@o3r/eslint-config/schematics/ng-add/eslint/templates/workspace/eslint.config.__extension__.template @@ -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)) } ) })) );