Two TS linting errors in `main.ts`
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Find the ng new workspace template that emits src/main.ts (the angular-cli schematics workspace files, ending in .ts.template) and update the .catch callback to the block-bodied err: unknown form shown in the issue. Verify by generating a project with ng new, adding @angular-eslint/schematics, switching to tseslint.configs.strictTypeChecked with typed linting parser options, and running ng lint — done means both rules pass. Note an open pull request (#34268) already targets this issue, so check its status before starting.
索引モデルが issue の本文から書いたものです。
説明
Command
new
Is this a regression?
- Yes, this behavior used to work in the previous version
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/schematicsto add eslint. In eslint.config.js, changetseslintConfigs.recommendedtotseslint.configs.strictTypeChecked.- Add
languageOptions.parserOptionsas described in thets-eslintdocs. - 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.
- 主要言語
- TypeScript
- スター
- 27k
- フォーク
- 11.8k
- 平均マージ
- 1日 32分
- マージ済み PR(30日)
- 138
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
angular/angular-cli のほかの issue
-
area: @angular/cli
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
angular/angular-cli#34307 ·
メンテナーはふだん 1 日以内に返信
-
area: @angular/build gemini-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
angular/angular-cli#33955 ·
メンテナーはふだん 1 日以内に返信
-
area: @angular/cli gemini-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
angular/angular-cli#33055 · コメント 1 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
SSR resolves relative `redirectTo` against the wrong base when the route path has several segments対応中かも @bschaeublin が 2 日前に担当しました。 オープンarea: @angular/ssr
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
angular/angular-cli#34300 ·
メンテナーはふだん 1 日以内に返信
-
SSR route redirects drop the query string on relative `redirectTo`対応中かも @bschaeublin が 2 日前に担当しました。 オープンarea: @angular/ssr
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
angular/angular-cli#34298 ·
メンテナーはふだん 1 日以内に返信
angular/angular-cli の issue をすべて見る
似ている issue
-
Bayern feature:Application ready web
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
digitalfabrik/entitlementcard#3176 ·
メンテナーはふだん 7 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NanmiCoder/cc-haha#1533 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
🐛 Bug: Calendar work items cannot be opened on mobile対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100