Command
new
Is this a regression?
The previous version in which this bug was not present was
No response
Description
ng new generates boilerplate that contains two linting errors. They appear when linting with type information:
<path>\src\main.ts
6:11 error Prefer the safe `: unknown` for a `catch` callback variable @typescript-eslint/use-unknown-in-catch-callback-variable
6:19 error Returning a void expression from an arrow function shorthand is forbidden. Please add braces to the arrow function @typescript-eslint/no-confusing-void-expression
The two issues can be fixed by changing the offending code to:
bootstrapApplication(App, appConfig).catch((err: unknown) => {
console.error(err);
});
See the ts-eslint doc pages for no-confusing-void-expression and use-unknown-in-catch-callback-variable.
Minimal Reproduction
- Generate a new project with
ng new.
- Run
ng add @angular-eslint/schematics to add eslint.
In eslint.config.js, change tseslintConfigs.recommended to tseslint.configs.strictTypeChecked.
- Add
languageOptions.parserOptions as described in the ts-eslint docs.
- Run
ng lint.
Exception or Error
Your Environment
Angular CLI : 22.0.1
Angular : 22.0.1
Node.js : 26.9.0
Package Manager : npm 11.16.0
Operating System : win32 x64
Anything else relevant?
TS 7.1 is expected to bring a faster typed linting API, so typed linting will become even more common.
Command
new
Is this a regression?
The previous version in which this bug was not present was
No response
Description
ng newgenerates boilerplate that contains two linting errors. They appear when linting with type information:The two issues can be fixed by changing the offending code to:
See the ts-eslint doc pages for no-confusing-void-expression and use-unknown-in-catch-callback-variable.
Minimal Reproduction
ng new.ng add @angular-eslint/schematicsto add eslint.In eslint.config.js, changetseslintConfigs.recommendedtotseslint.configs.strictTypeChecked.languageOptions.parserOptionsas described in thets-eslintdocs.ng lint.Exception or Error
Your Environment
Anything else relevant?
TS 7.1 is expected to bring a faster typed linting API, so typed linting will become even more common.