2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

package.jsonのdependenciesにコメントを残す(yarn限定)

Posted at

前提

  • yarn 1.x でしか動かず、npm installは失敗する
  • yarn 2.x は未調査

概要

package.jsonのdependencies, devDependenciesなど何らかの事情で依存ライブラリを固定したときにその事情を残す場所に困って解決したのでメモ

方法

"stylelint": "13.3.0 because of https://github.com/stylelint/stylelint/issues/4732",

みたいに書く
このときyarn.lockはちゃんと

"stylelint@13.3.0 because of https://github.com/stylelint/stylelint/issues/4732":
  version "13.3.0"

のようになる

利点

1つ上の行にパッケージ風のコメントを書く方法もあるが、これなら一番近くに事情を残せるし、package.jsonを自動ソートしていてもどこかに行かない

他の方法

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?