scratch-paint's npm test does not run lint, so CI never lints paint; one lint error is currently in develop

オープン 初心者向け
#754 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@jonathanmendoza-tx がすでに取り組んでいます。

2026年11月7日 から。

  • #755 @jonathanmendoza-tx による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
86/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
eslint, javascript, node.js
領域
ci-cd, testing

調査の方向性

まず packages/scratch-paint/package.json と .github/actions/test-package/action.yml を確認し、CI でパッケージのテストがどのように実行されるかを確かめます。packages/scratch-paint で npm run lint を実行し、src/containers/paper-canvas.jsx:236 で報告されたメソッドチェーンのエラーを修正します。次に、パッケージの test スクリプトでユニットテストの前に lint を実行するよう設定します。npm test が両方を正常に実行すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Expected Behavior

npm test in packages/scratch-paint runs lint and then the unit tests, like every other package in the monorepo, so that CI (which runs npm run test per package) catches lint errors in paint.

Actual Behavior

packages/scratch-paint/package.json has

"lint": "eslint",
"test": "npm run unit",

so npm test runs only Jest. .github/actions/test-package/action.yml runs npm run test, so paint is the only package whose lint never runs in CI.

How it got this way: in the standalone scratch-paint repo, test was npm run lint && npm run unit until commit 433c0ae45f (2023-10-17, "ci: update package.json and package-lock"), which trimmed it to npm run unit at the same time as a deploy.yml change. That made sense while paint had its own workflow; after the monorepo import, where CI only runs each package's npm run test, the lint step silently disappeared.

As a result there is a lint error in develop today that CI did not catch. npm run lint in packages/scratch-paint reports:

src/containers/paper-canvas.jsx
  236:63  error  Expected line break before `.then`  @stylistic/newline-per-chained-call

The line is

getPaperSandbox().then(sandbox => sandbox.send({svg})).then(result => {

Steps to Reproduce

  1. Clone scratch-editor, check out develop, run npm ci from the repo root.
  2. cd packages/scratch-paint.
  3. Run npm test: lint does not run.
  4. Run npm run lint: see the newline-per-chained-call error in paper-canvas.jsx:236.

System Details

  • Observed on Windows 10 Pro 22H2 (build 19045), Node v24.21.0, npm 12.0.2; the missing lint step and the paper-canvas.jsx error are not platform-specific.
  • scratch-editor develop at 7b5559d29 (v15.3.0), fresh npm ci

Notes

Suggested fix in two steps so each commit stays small: first fix the one chained-call line, then change paint's test script to npm run lint && npm run unit. Neither changes published code.

主要言語
JavaScript
スター
310
フォーク
299
平均マージ
19時間 41分
マージ済み PR(30日)
14

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

scratchfoundation/scratch-editor のほかの issue

scratchfoundation/scratch-editor の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。