From 66ae83e5693c0051c3199d0c7e54f4e34c9f0d6a Mon Sep 17 00:00:00 2001 From: Nicholas Cunningham Date: Tue, 19 Mar 2024 12:00:35 -0600 Subject: [PATCH] fix(core): Should work if extends is a string (cherry picked from commit a00f6438b9c4ed1aaae1dc4d3965dd9ec026a515) --- packages/eslint/src/generators/init/init-migration.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/eslint/src/generators/init/init-migration.ts b/packages/eslint/src/generators/init/init-migration.ts index 372b5b04548d3..15e86df79b171 100644 --- a/packages/eslint/src/generators/init/init-migration.ts +++ b/packages/eslint/src/generators/init/init-migration.ts @@ -159,6 +159,12 @@ function migrateEslintFile(projectEslintPath: string, tree: Tree) { } // add extends json.extends = json.extends || []; + + // ensure extends is an array + if (typeof json.extends === 'string') { + json.extends = [json.extends]; + } + const pathToRootConfig = `${offsetFromRoot( dirname(projectEslintPath) )}${baseFile}`;