Search code examples
jscs

jscs validateIndentation with spaces .editorconfig


Having this .editorconfig:

# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

what's the syntax for .jscsrc I know for tab is like

"validateIndentation": "\t",

but what's the syntax for 4 spaces ?


Solution

  • The syntax for spaces is to just use an integer, so:

    "validateIndentation": 4,

    Relevant excerpt from the docs:

    validateIndentation

    Validates indentation for switch statements and block statements

    Types: Integer, String or Object

    Values:

    Integer: A positive number of spaces