Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commitlint: resolve strict build errors
I had to use downlevelIteration flag because typeScript is unable to iterate over certain types of objects without the --downlevelIteration flag or a --target of es2015 or higher. ``` commitlint/plugins.ts:94:29 - error TS2802: Type 'IterableIterator<[number, string]>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher. commitlint/plugins.ts:216:29 - error TS2802: Type 'Set<unknown>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher. commitlint/plugins.ts:222:29 - error TS2802: Type 'Set<unknown>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher. ``` This error occurs when a function declaration is inside a block in strict mode when targeting ‘ES3’ or ‘ES5’. One way to fix this is to assign a function expression to a variable name instead. ``` commitlint/plugins.ts:19:26 - error TS1251: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode. ``` To fix this error, we can add "ES2021" or "ES2021.String" to the lib array in your tsconfig.json file. ``` commitlint/helpers.ts:191:14 - error TS2550: Property 'replaceAll' does not exist on type 'string'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2021' or later ```
- Loading branch information