facebook twitter hatena line email

「VisualStudioCode/設定/editorconfig」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(ページの作成:「==editroconfig設定方法== プロジェクト直下に.editorconfigファイルを置く 例 <pre> # .editorconfig のルート設定 root = true # すべてのファ...」)
 
行37: 行37:
 
indent_size = 2  # JSON は一般的にスペース 2 が推奨
 
indent_size = 2  # JSON は一般的にスペース 2 が推奨
 
</pre>
 
</pre>
 +
  
 
参考:https://www.neputa-note.net/2020/10/vscode-editorconfig/
 
参考:https://www.neputa-note.net/2020/10/vscode-editorconfig/

2025年3月2日 (日) 00:44時点における版

editroconfig設定方法

プロジェクト直下に.editorconfigファイルを置く

# .editorconfig のルート設定
root = true

# すべてのファイルに適用
[*]
indent_style = space        # インデントをスペースにする(tabs にするとタブ)
indent_size = 4             # インデント幅(タブの場合は `tab_width = 4`)
end_of_line = lf            # 改行コード(lf / crlf / cr)
charset = utf-8             # 文字エンコーディング
trim_trailing_whitespace = true  # 行末の空白を削除
insert_final_newline = true      # ファイルの最後に改行を追加

# C#(.cs)の設定
[*.cs]
indent_style = space
indent_size = 4
dotnet_diagnostic.IDE0055.severity = suggestion  # コードフォーマットの警告を提案レベルにする

# C# コードフォーマット設定
csharp_indent_case_contents = true               # switch の case 内をインデント
csharp_indent_braces = true                      # `{}` をインデント
csharp_new_line_before_else = true               # `else` の前に改行
csharp_new_line_before_catch = true              # `catch` の前に改行
csharp_new_line_before_finally = true            # `finally` の前に改行
csharp_space_after_keywords_in_control_flow_statements = true  # if や for の後にスペース
csharp_space_before_open_square_brackets = false # `array[index]` の `[` の前にスペースを入れない
csharp_space_within_square_brackets = false      # `array[ index ]` のような空白を入れない

# JSON ファイルの設定
[*.json]
indent_style = space
indent_size = 2  # JSON は一般的にスペース 2 が推奨


参考:https://www.neputa-note.net/2020/10/vscode-editorconfig/