tsconfig / bases

Hosts TSConfigs to extend in a TypeScript app, tuned to a particular runtime environment
MIT License
6.33k stars 237 forks source link

tsconfig issue with incorrect argument for lib #257

Closed GordonHPepBoys closed 7 months ago

GordonHPepBoys commented 7 months ago

I have a lambda project that is currently using TypeScript 4.7.4 and we are in the process of upgrading from nodejs16 to nodejs20. The nodejs 20 version is

"@tsconfig/node20": "20.1.2",

Below is my configuration: { "extends": "@tsconfig/node20/tsconfig.json", "compilerOptions": { "lib": ["ES2023"], "module": "node16", "target": "ES2022", "moduleResolution": "node16", "outDir": "dist", "sourceMap": true, "typeRoots": ["/node_modules/@types", "/types"], "types": ["node", "jest"], "strict": false, "noImplicitAny": false, "esModuleInterop": true, "skipLibCheck": false, "forceConsistentCasingInFileNames": false }, "include": ["*/.ts"], "exclude": ["node_modules"] }

Below is the exception:

16.15 tsconfig.json(4,13): error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref'.

Please advise on how to fix the issue. Thanks, Gordon

orta commented 7 months ago

Upgrade your typescript version, or use an older version of the tsconfig base to get access to the referenced lib value