1. 程式人生 > >webStorm中的程式碼風格配置

webStorm中的程式碼風格配置

開啟webStorm軟體點選:

File>Settings > Editor > Code Style > Manage >Import 匯入


<code_scheme name="webStrom">
  <option name="LINE_SEPARATOR" value="
" />
  <option name="HTML_ATTRIBUTE_WRAP" value="0" />
  <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
  <CssCodeStyleSettings>
    <option name="VALUE_ALIGNMENT" value="1" />
  </CssCodeStyleSettings>
  <JSCodeStyleSettings>
    <option name="SPACE_BEFORE_TYPE_COLON" value="true" />
    <option name="SPACE_AFTER_TYPE_COLON" value="false" />
    <option name="SPACE_AFTER_PROPERTY_COLON" value="false" />
    <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
    <option name="ALIGN_MULTIPLE_ASSIGNMENTS" value="true" />
    <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
    <option name="SPACES_WITHIN_IMPORTS" value="true" />
    <option name="INDENT_CHAINED_CALLS" value="false" />
    <option name="USE_CHAINED_CALLS_GROUP_INDENTS" value="true" />
  </JSCodeStyleSettings>
  <codeStyleSettings language="CSS">
    <indentOptions>
      <option name="INDENT_SIZE" value="2" />
      <option name="CONTINUATION_INDENT_SIZE" value="2" />
      <option name="TAB_SIZE" value="2" />
    </indentOptions>
  </codeStyleSettings>
  <codeStyleSettings language="HTML">
    <indentOptions>
      <option name="INDENT_SIZE" value="2" />
      <option name="CONTINUATION_INDENT_SIZE" value="2" />
      <option name="TAB_SIZE" value="2" />
    </indentOptions>
  </codeStyleSettings>
  <codeStyleSettings language="JSON">
    <indentOptions>
      <option name="CONTINUATION_INDENT_SIZE" value="2" />
      <option name="TAB_SIZE" value="2" />
    </indentOptions>
  </codeStyleSettings>
  <codeStyleSettings language="Jade">
    <indentOptions>
      <option name="INDENT_SIZE" value="2" />
      <option name="TAB_SIZE" value="2" />
    </indentOptions>
  </codeStyleSettings>
  <codeStyleSettings language="JavaScript">
    <option name="LINE_COMMENT_ADD_SPACE" value="false" />
    <option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
    <option name="KEEP_BLANK_LINES_IN_CODE" value="0" />
    <option name="SPACE_WITHIN_METHOD_CALL_PARENTHESES" value="true" />
    <option name="SPACE_WITHIN_METHOD_PARENTHESES" value="true" />
    <option name="SPACE_WITHIN_IF_PARENTHESES" value="true" />
    <option name="SPACE_WITHIN_WHILE_PARENTHESES" value="true" />
    <option name="SPACE_WITHIN_FOR_PARENTHESES" value="true" />
    <option name="SPACE_WITHIN_CATCH_PARENTHESES" value="true" />
    <option name="SPACE_WITHIN_SWITCH_PARENTHESES" value="true" />
    <option name="SPACE_WITHIN_BRACKETS" value="true" />
    <option name="SPACE_BEFORE_METHOD_PARENTHESES" value="true" />
    <option name="KEEP_SIMPLE_BLOCKS_IN_ONE_LINE" value="true" />
    <option name="WRAP_COMMENTS" value="true" />
    <indentOptions>
      <option name="INDENT_SIZE" value="2" />
      <option name="CONTINUATION_INDENT_SIZE" value="2" />
      <option name="TAB_SIZE" value="2" />
      <option name="KEEP_INDENTS_ON_EMPTY_LINES" value="true" />
    </indentOptions>
  </codeStyleSettings>
  <codeStyleSettings language="LESS">
    <indentOptions>
      <option name="CONTINUATION_INDENT_SIZE" value="2" />
      <option name="TAB_SIZE" value="2" />
    </indentOptions>
  </codeStyleSettings>
  <codeStyleSettings language="SASS">
    <indentOptions>
      <option name="TAB_SIZE" value="2" />
      <option name="KEEP_INDENTS_ON_EMPTY_LINES" value="true" />
    </indentOptions>
  </codeStyleSettings>
  <codeStyleSettings language="SCSS">
    <indentOptions>
      <option name="CONTINUATION_INDENT_SIZE" value="2" />
      <option name="TAB_SIZE" value="2" />
    </indentOptions>
  </codeStyleSettings>
  <codeStyleSettings language="Stylus">
    <indentOptions>
      <option name="CONTINUATION_INDENT_SIZE" value="2" />
      <option name="TAB_SIZE" value="2" />
    </indentOptions>
  </codeStyleSettings>
  <codeStyleSettings language="TypeScript">
    <indentOptions>
      <option name="INDENT_SIZE" value="2" />
      <option name="CONTINUATION_INDENT_SIZE" value="2" />
      <option name="TAB_SIZE" value="2" />
    </indentOptions>
  </codeStyleSettings>
  <codeStyleSettings language="XML">
    <indentOptions>
      <option name="INDENT_SIZE" value="2" />
      <option name="CONTINUATION_INDENT_SIZE" value="2" />
      <option name="TAB_SIZE" value="2" />
    </indentOptions>
  </codeStyleSettings>
</code_scheme>