ReSharper 2025.3 ヘルプ

HTML の EditorConfig プロパティ: スタイルのフォーマット

タブとインデント

インデントスタイル

プロパティ名:

indent_style , [resharper_]html_indent_style

使用可能な値:

  • tab : タブ

  • space : スペース

例:

タブ

<div> <div> text </div> </div>

スペース

<div> <div> text </div> </div>

インデントサイズ

プロパティ名:

indent_size , [resharper_]html_indent_size

使用可能な値:

整数

例:

値: 0

<div> <div> text </div> </div>

値: 1

<div> <div> text </div> </div>

値: 2

<div> <div> text </div> </div>

タブの幅

プロパティ名:

tab_width , [resharper_]html_tab_width

使用可能な値:

整数

例:

値: 0

<div> <div> text </div> </div>

値: 1

<div> <div> text </div> </div>

値: 2

<div> <div> text </div> </div>

タブがインデントに使用されているときの整列方法

プロパティ名:

[resharper_]html_alignment_tab_fill_style , [resharper_]alignment_tab_fill_style

使用可能な値:

  • use_spaces : スペースを使用する (任意のタブサイズで整列して見える)

  • use_tabs_only : タブのみを使用する (不正確)

  • optimal_fill : 最適な塗りつぶしのためにタブとスペースをミックス

結果のくぼみが大きすぎても位置合わせする

プロパティ名:

[resharper_]html_allow_far_alignment , [resharper_]allow_far_alignment

Allow alignment even if construct is located too far to the right, more than 2/3 of `Hard wrap at` limit

使用可能な値:

true | false

処理命令

属性の '=' の周囲のスペース

プロパティ名:

[resharper_]html_spaces_around_eq_in_pi_attribute , [resharper_]spaces_around_eq_in_pi_attribute

使用可能な値:

true | false

例:

true

<?xml version = '1.0' encoding = 'utf-8'?>

false

<?xml version='1.0' encoding='utf-8'?>

最後の属性の後のスペース

プロパティ名:

[resharper_]html_space_after_last_pi_attribute , [resharper_]space_after_last_pi_attribute

使用可能な値:

true | false

例:

true

<?xml version='1.0' encoding='utf-8' ?>

false

<?xml version='1.0' encoding='utf-8'?>

アトリビュートフォーマット

プロパティ名:

[resharper_]html_pi_attribute_style , [resharper_]pi_attribute_style

使用可能な値:

  • on_single_line : 単一行

  • first_attribute_on_single_line : 1 行の最初の属性

  • on_different_lines : 別々の行にある各属性

  • do_not_touch : 何もしない

例:

on_single_line

<?xml version='1.0' encoding='utf-8'?>

first_attribute_on_single_line

<?xml version='1.0' encoding='utf-8'?>

on_different_lines

<?xml version='1.0' encoding='utf-8'?>

do_not_touch

<?xml version='1.0' encoding='utf-8'?>

字下げ属性

プロパティ名:

[resharper_]html_pi_attributes_indent , [resharper_]pi_attributes_indent

使用可能な値:

  • single_indent : シングルインデント

  • double_indent : 二重インデント

  • align_by_first_attribute : 最初の属性で整列する

例:

single_indent

<?xml version='1.0' encoding='utf-8'?>

double_indent

<?xml version='1.0' encoding='utf-8'?>

align_by_first_attribute

<?xml version='1.0' encoding='utf-8'?>

命令処理後の空白行

プロパティ名:

[resharper_]html_blank_line_after_pi , [resharper_]blank_line_after_pi

使用可能な値:

true | false

例:

true

<?xml version='1.0' encoding='utf-8'?> <a/>

false

<?xml version='1.0' encoding='utf-8'?> <a/>

タグヘッダーの内側

属性の '=' の周囲のスペース

プロパティ名:

[resharper_]html_spaces_around_eq_in_attribute , [resharper_]spaces_around_eq_in_attribute

使用可能な値:

true | false

例:

true

<a x = '1' y = '2' z = '3'/>

false

<a x='1' y='2' z='3'/>

最後の属性の後のスペース

プロパティ名:

[resharper_]html_space_after_last_attribute , [resharper_]space_after_last_attribute

使用可能な値:

true | false

例:

true

<a x='1' y='2' z='3' >text</a>

false

<a x='1' y='2' z='3'>text</a>

'/> の前のスペース

プロパティ名:

[resharper_]html_space_before_self_closing , [resharper_]space_before_self_closing

使用可能な値:

true | false

例:

true

<a />

false

<a/>

アトリビュートフォーマット

プロパティ名:

[resharper_]html_attribute_style , [resharper_]attribute_style

使用可能な値:

  • on_single_line : 単一行

  • first_attribute_on_single_line : 1 行の最初の属性

  • on_different_lines : 別々の行にある各属性

  • do_not_touch : 何もしない

例:

on_single_line

<a x='1' y='2' z='3'/>

first_attribute_on_single_line

<a x='1' y='2' z='3'/>

on_different_lines

<a x='1' y='2' z='3'/>

do_not_touch

<a x='1' y='2' z='3'/>

字下げ属性

プロパティ名:

[resharper_]html_attribute_indent , [resharper_]attribute_indent

使用可能な値:

  • single_indent : シングルインデント

  • double_indent : 二重インデント

  • align_by_first_attribute : 最初の属性で整列する

例:

single_indent

<div class='a' style='color:red' data-attr='3'/>

double_indent

<div class='a' style='color:red' data-attr='3'/>

align_by_first_attribute

<div class='a' style='color:red' data-attr='3'/>

属性のソート

プロパティ名:

[resharper_]html_sort_attributes , [resharper_]sort_attributes

使用可能な値:

true | false

例:

true

<div class='a' data-attr='3' style='color:red'/>

false

<div data-attr='3' style='color:red' class='a'/>

クラスセレクタをソートする

プロパティ名:

[resharper_]html_sort_class_selectors , [resharper_]sort_class_selectors

使用可能な値:

true | false

例:

true

<div class="a b c"/>

false

<div class="b c a"/>

タグの周囲

タグ間の空白行の最大数

プロパティ名:

[resharper_]html_max_blank_lines_between_tags , [resharper_]max_blank_lines_between_tags

使用可能な値:

整数

例:

値: 0

<br/> <br/>

値: 1

<br/> <br/>

値: 2

<br/> <br/>

すべての要素を新しい行に配置する

プロパティ名:

[resharper_]html_linebreak_before_all_elements , [resharper_]linebreak_before_all_elements

使用可能な値:

true | false

例:

true

Hi! <br/> <i>some text</i> <b>some text</b>

false

Hi! <br/><i>some text</i><b>some text</b>

複数行の要素を新しい行に配置する

プロパティ名:

[resharper_]html_linebreak_before_multiline_elements , [resharper_]linebreak_before_multiline_elements

使用可能な値:

true | false

例:

true

Hi! <br/><i>some text</i> <b> more text </b> <img data-attr='3' class='a'/>

false

Hi! <br/><i>some text</i><b> more text </b><img data-attr='3' class='a'/>

次の要素を新しい行に配置する

プロパティ名:

[resharper_]html_linebreak_before_elements , [resharper_]linebreak_before_elements

次のタグの子はインデントしない

プロパティ名:

[resharper_]html_no_indent_inside_elements , [resharper_]no_indent_inside_elements

要素の行数が複数ある場合、子要素をインデントしないでください。

プロパティ名:

[resharper_]html_no_indent_inside_if_element_longer_than , [resharper_]no_indent_inside_if_element_longer_than

使用可能な値:

整数

内側に空白を維持する

プロパティ名:

[resharper_]html_preserve_spaces_inside_tags , [resharper_]preserve_spaces_inside_tags

複数行要素の開始タグと終了タグの後の改行

プロパティ名:

[resharper_]html_linebreaks_inside_tags_for_multiline_elements , [resharper_]linebreaks_inside_tags_for_multiline_elements

使用可能な値:

true | false

例:

true

<tag> text text text Text text text text text text text text text </tag>

false

<tag>text text text Text text text text text text text text text</tag>

他の要素とテキストを含まない要素の開始タグの後と終了タグの前の改行

プロパティ名:

[resharper_]html_linebreaks_inside_tags_for_elements_with_child_elements , [resharper_]linebreaks_inside_tags_for_elements_with_child_elements

使用可能な値:

true | false

例:

true

<tag> <othertag>text</othertag> </tag>

false

<tag><othertag>text</othertag></tag>

その他

ファイルの終わりに改行

プロパティ名:

insert_final_newline , [resharper_]html_insert_final_newline

使用可能な値:

true | false

内部の余分なスペース

プロパティ名:

[resharper_]html_extra_spaces , [resharper_]extra_spaces

使用可能な値:

  • remove_all : 余分なスペースをすべて削除する

  • leave_tabs : 余分なタブを残す

  • leave_multiple : 複数の余分なスペースを残す

  • leave_all : スペースとタブをすべて残す

例:

フォーマット前

フォーマット後 remove_all

<p id = "II" > I </p> <em dir = "rtl" > He </em> <div class = "first" > You </div> <p id = "II" > I </p> <em dir = "rtl" > He </em> <div class = "first" > You </div>
<p id="II"> I </p> <em dir="rtl"> He </em> <div class="first"> You </div> <p id="II"> I </p> <em dir="rtl"> He </em> <div class="first"> You </div>

フォーマット前

フォーマット後 leave_tabs

<p id = "II" > I </p> <em dir = "rtl" > He </em> <div class = "first" > You </div> <p id = "II" > I </p> <em dir = "rtl" > He </em> <div class = "first" > You </div>
<p id="II"> I </p> <em dir="rtl"> He </em> <div class="first"> You </div> <p id = "II" > I </p> <em dir = "rtl" > He </em> <div class = "first" > You </div>

フォーマット前

フォーマット後 leave_multiple

<p id = "II" > I </p> <em dir = "rtl" > He </em> <div class = "first" > You </div> <p id = "II" > I </p> <em dir = "rtl" > He </em> <div class = "first" > You </div>
<p id ="II" > I </p> <em dir ="rtl" > He </em> <div class="first"> You </div> <p id="II"> I </p> <em dir="rtl"> He </em> <div class="first"> You </div>

フォーマット前

フォーマット後 leave_all

<p id = "II" > I </p> <em dir = "rtl" > He </em> <div class = "first" > You </div> <p id = "II" > I </p> <em dir = "rtl" > He </em> <div class = "first" > You </div>
<p id = "II" > I </p> <em dir = "rtl" > He </em> <div class = "first" > You </div> <p id = "II" > I </p> <em dir = "rtl" > He </em> <div class = "first" > You </div>
2024 年 5 月 26 日