0
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.

VS Codeでphpcsが動かない問題

Posted at

何だかんだで1時間弱くらいハマってイラッとしたので、インターン生とかにも共有できるようにメモを残しておく

エラー内容

phpcsのエラーでググるとよく出てくるこのエラーが発生。
既存プロジェクトでも上手く動くもの、動かないものがあったり、新規プロジェクトだとやっぱり動かなかったりして謎

image.png

解決方法

シンプルにStack Overflowのベストアンサーをそのまま試したら直った

cf.) https://stackoverflow.com/questions/47174009/visual-studio-code-unable-to-locate-phpcs/52477116

  1. Install the phpcs by using composer with composer global require squizlabs/php_codesniffer
  1. Press Command + , (Click Code -> Preferences -> Settings)
  2. Select User Settings and locate 'PHP CodeSniffer'
  3. Scroll to 'Executatble Path' and put /Users/your-username/.composer/vendor/bin/phpcs
0
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
0
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?