Skip to content

Commit a00f643

Browse files
ndcunninghammeeroslav
authored andcommitted
fix(core): Should work if extends is a string
1 parent 64b2396 commit a00f643

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/eslint/src/generators/init/init-migration.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ function migrateEslintFile(projectEslintPath: string, tree: Tree) {
159159
}
160160
// add extends
161161
json.extends = json.extends || [];
162+
163+
// ensure extends is an array
164+
if (typeof json.extends === 'string') {
165+
json.extends = [json.extends];
166+
}
167+
162168
const pathToRootConfig = `${offsetFromRoot(
163169
dirname(projectEslintPath)
164170
)}${baseFile}`;

0 commit comments

Comments
 (0)