Skip to content

developブランチでpnpm lintがpassしない #10131

@pushback

Description

@pushback

💡 Summary

developブランチでhttps://github.com/misskey-dev/misskey/blob/develop/CONTRIBUTING.md#creating-a-prの手順にある、PRの前提条件となるpnpm lintを実行するとerrorが7件検出されpassしない。

🥰 Expected Behavior

pnpm lintでerrorが0件となりpassする。

🤬 Actual Behavior

実行ログ(対象:developブランチの 81e6a21

$ pnpm lint

> [email protected] lint /workspace
> pnpm -r lint

Scope: 3 of 4 workspace projects
packages/backend lint$ pnpm typecheck && pnpm eslint
│ > backend@ typecheck /workspace/packages/backend
│ > tsc --noEmit
└─ Running...
packages/frontend lint$ pnpm typecheck && pnpm eslint
│ > frontend@ typecheck /workspace/packages/frontend
│ > vue-tsc --noEmit
└─ Running...
packages/sw lint$ pnpm typecheck && pnpm eslint
│ > sw@ typecheck /workspace/packages/sw
│ > tsc --noEmit
│ src/scripts/create-notification.ts(170,12): error TS6133: 'tag' is declared but its value is never read.
│ src/scripts/create-notification.ts(185,10): error TS2678: Type '"pollEnded"' is not comparable to type '"follow" | "reaction" | "reply" | "renote" | "quote" | "m
│ src/scripts/create-notification.ts(187,23): error TS2339: Property 'note' does not exist on type 'never'.
│ src/scripts/create-notification.ts(189,30): error TS2339: Property 'note' does not exist on type 'never'.
│ src/scripts/notification-read.ts(42,51): error TS2345: Argument of type '{ notificationIds: string[]; }' is not assignable to parameter of type '{ notificationId
│   Object literal may only specify known properties, but 'notificationIds' does not exist in type '{ notificationId: string; }'. Did you mean to write 'notificati
│ src/scripts/notification-read.ts(53,45): error TS2345: Argument of type '{ notificationIds: string[]; }' is not assignable to parameter of type '{ notificationId
│   Object literal may only specify known properties, but 'notificationIds' does not exist in type '{ notificationId: string; }'. Did you mean to write 'notificati
│ src/scripts/operations.ts(7,1): error TS6133: 'getAcct' is declared but its value is never read.
│  ELIFECYCLE  Command failed with exit code 2.
└─ Failed in 1.5s at /workspace/packages/sw
/workspace/packages/sw:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  sw@ lint: `pnpm typecheck && pnpm eslint`
Exit status 1
 ELIFECYCLE  Command failed with exit code 1.

📝 Steps to Reproduce

  1. git clone [email protected]:misskey-dev/misskey.git
  2. pnpm install
  3. pnpm lint

📌 Environment

Misskey version: 13.8.1
Your OS: Ubuntu20.04.5 LTS on WSL2/windows11
Your browser: -

pnpm versionログ

$ pnpm version
{
  misskey: '13.8.1',
  npm: '8.19.3',
  node: '18.13.0',
  v8: '10.2.154.23-node.21',
  uv: '1.44.2',
  zlib: '1.2.13',
  brotli: '1.0.9',
  ares: '1.18.1',
  modules: '108',
  nghttp2: '1.51.0',
  napi: '8',
  llhttp: '6.0.10',
  uvwasi: '0.0.13',
  openssl: '3.0.7+quic',
  cldr: '42.0',
  icu: '72.1',
  tz: '2022f',
  unicode: '15.0',
  ngtcp2: '0.8.1',
  nghttp3: '0.7.0'
}

ご参考: 問題と想定される対策

src/scripts/create-notification.ts(170,12): error TS6133: 'tag' is declared but its value is never read.

問題:未使用の変数
対策:何もしない。別のPR(#10122)で使われるようになり、自然に解消されるされる見込み

│ src/scripts/create-notification.ts(185,10): error TS2678: Type '"pollEnded"' is not comparable to type '"follow" | "reaction" | "reply" | "renote" | "quote" | "m
│ src/scripts/create-notification.ts(187,23): error TS2339: Property 'note' does not exist on type 'never'.
│ src/scripts/create-notification.ts(189,30): error TS2339: Property 'note' does not exist on type 'never'.

問題:Notification型でtype: 'pollEnded'の場合の定義がmisskey.jsにない
対策:misskey.jsの修正。すでにIssue(misskey-dev/misskey.js#45)もマージ待ちのPR(misskey-dev/misskey.js#51, misskey-dev/misskey.js#56)もあり。マージ後のバージョンへ更新で解消される見込み
備考:misskey.jsでもこのIssue同様にnpm lintしたときエラーが出ており、その解消のためmisskey-dev/misskey.js#51が必要

│ src/scripts/notification-read.ts(42,51): error TS2345: Argument of type '{ notificationIds: string[]; }' is not assignable to parameter of type '{ notificationId
│ Object literal may only specify known properties, but 'notificationIds' does not exist in type '{ notificationId: string; }'. Did you mean to write 'notificati
│ src/scripts/notification-read.ts(53,45): error TS2345: Argument of type '{ notificationIds: string[]; }' is not assignable to parameter of type '{ notificationId
│ Object literal may only specify known properties, but 'notificationIds' does not exist in type '{ notificationId: string; }'. Did you mean to write 'notificati

問題:notifications/readに投げるときのパラメータの型が不一致。misskeyはnotificationIds: string[]を想定していて、misskey.jsはnotificationId: stringになっている
対策:misskey.jsの修正。マージ待ちのPR(misskey-dev/misskey.js#51, misskey-dev/misskey.js#56)あり。マージ後のバージョンへ更新で解消される見込み

│ src/scripts/operations.ts(7,1): error TS6133: 'getAcct' is declared but its value is never read.

問題:8caf288 で使用箇所がなくなったため、importが不要
対策:不要なimportを削除

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions