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,