From b4f521d8bc70b614a5c69773bf0344bc1894a6dc Mon Sep 17 00:00:00 2001 From: Victor Diez Date: Tue, 3 Dec 2024 11:03:44 +0100 Subject: [PATCH 1/2] ESLINTJS-61 Move Typescript as peerDependency --- generate-eslint-package-json.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-eslint-package-json.mjs b/generate-eslint-package-json.mjs index b1568e7f632..9814ec3e887 100644 --- a/generate-eslint-package-json.mjs +++ b/generate-eslint-package-json.mjs @@ -33,7 +33,6 @@ const eslintPluginDependencies = [ 'minimatch', 'scslre', 'semver', - 'typescript', ]; const mainPackageJson = JSON.parse( @@ -83,6 +82,7 @@ await fs.writeFile( dependencies, peerDependencies: { eslint: '^8.0.0 || ^9.0.0', + typescript: '>=5.0.0', }, }, null, From b87aaa2eeeb323323ff99f89d27fad7014f45443 Mon Sep 17 00:00:00 2001 From: Victor Diez Date: Tue, 3 Dec 2024 12:11:20 +0100 Subject: [PATCH 2/2] ESLINTJS-61 Move Typescript as peerDependency --- generate-eslint-package-json.mjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/generate-eslint-package-json.mjs b/generate-eslint-package-json.mjs index 9814ec3e887..a25d2eedcb9 100644 --- a/generate-eslint-package-json.mjs +++ b/generate-eslint-package-json.mjs @@ -33,8 +33,13 @@ const eslintPluginDependencies = [ 'minimatch', 'scslre', 'semver', + 'typescript', ]; +const fixedVersions = { + typescript: '^5', +}; + const mainPackageJson = JSON.parse( await fs.readFile(join(dirname(fileURLToPath(import.meta.url)), 'package.json'), 'utf8'), ); @@ -46,7 +51,7 @@ for (const [name, value] of Object.entries(mainPackageJson.dependencies).concat( Object.entries(mainPackageJson.devDependencies), )) { if (eslintPluginDependencies.includes(name)) { - dependencies[name] = value; + dependencies[name] = fixedVersions[name] ?? value; const i = missingDependencies.indexOf(name); missingDependencies.splice(i, 1); } @@ -82,7 +87,6 @@ await fs.writeFile( dependencies, peerDependencies: { eslint: '^8.0.0 || ^9.0.0', - typescript: '>=5.0.0', }, }, null,