mirror of https://github.com/zulip/zulip.git
eslint: Add whitespace indentation configuration.
This should help prevent problems with folks introducing new code that doesn't match our whitespace style. There's a couple things I don't like about this configuration: * How it handles multi-line JS lists (i.e. the [] syntax) * That we ended up having to turn off indentation on a half-dozen files that apparently don't use our standard IIFE indentation style. * That we have it completely turned off for the node tests; ideally, we'd just have slightly different rules around the IIFE identation story. But otherwise, this works pretty well, and should catch a pretty wide range of indentation regressions.
This commit is contained in:
parent
716a4a967d
commit
d3f8208715
|
@ -208,6 +208,15 @@
|
||||||
"eqeqeq": 2,
|
"eqeqeq": 2,
|
||||||
"func-style": [ "off", "expression" ],
|
"func-style": [ "off", "expression" ],
|
||||||
"guard-for-in": 2,
|
"guard-for-in": 2,
|
||||||
|
"indent": ["error", 4, {
|
||||||
|
"ArrayExpression": "first",
|
||||||
|
"outerIIFEBody": 0,
|
||||||
|
"ObjectExpression": "first",
|
||||||
|
"SwitchCase": 0,
|
||||||
|
"CallExpression": {"arguments": "first"},
|
||||||
|
"FunctionExpression": {"parameters": "first"},
|
||||||
|
"FunctionDeclaration": {"parameters": "first"}
|
||||||
|
}],
|
||||||
"keyword-spacing": [ "error",
|
"keyword-spacing": [ "error",
|
||||||
{
|
{
|
||||||
"before": true,
|
"before": true,
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-sync": 0,
|
"no-sync": 0,
|
||||||
|
"indent": 0,
|
||||||
"prefer-const": "error"
|
"prefer-const": "error"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue