新しいプロジェクトを始めるたびに .editorconfig を変更していてるので、備忘録として残します。
新しい設定が必要なったら編集して記載内容を更新する予定です。
この記事でわかること
- CakePHP4 + Vue.js の .editorconfig の設定内容がわかります。
- この記事内のソースは以下で公開しています。
.editorconfig
CakePHP4 で Vue.js ( Laravel-Mix ) を使えるようにして docker-compose で動くようにする で作ったソースを元に始めます。
CakePHP4 のプロジェクトを作った時点で .editorconfig が用意されるのですが、足りない点があるので追記します。
.editorconfig
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.bat]
end_of_line = crlf
[*.{yml,json,scss,html,js,vue,neon}]
indent_size = 2
[*.md]
trim_trailing_whitespace = false
[*.twig]
insert_final_newline = false
[Makefile]
indent_style = tab
追記した点を補足します。
- [*] > charset = utf-8
- 文字コードの指定です。
- [*.{yml,json,scss,html,js,vue}] > indent_size = 2
- インデント2のファイルは yml のみになっていたので、json, scss, html, js, vue とフロント開発に必要な拡張子を追加します。
- [*.md] > trim_trailing_whitespace = false
- markdown は後方スペースで改行を示す場合がある(使いたくない機能だけど)ので false とします。