I use ESLint so that my JavaScript code style is consistent. My favorite indentation level is 4, and I want my ad style to be as follows:
function () {
let a = 1,
bbb = 2;
const cc = 3,
ddd = 4;
}
However, there is a problem because the indent rule for each structure takes a number, which is a multiplication of the base indent. If I set my main indent to 4, I didn't seem to be able to align the constants.
If I set a rule:
"indent": ["error", 4, {"VariableDeclarator": {"const": 1}}],
Correct align will be 4 spaces:
const cc = 3,
ddd = 4;
And if I set the rule to 2:
"indent": ["error", 4, {"VariableDeclarator": {"const": 2}}],
8 spaces expected:
const cc = 3,
ddd = 4;
It does not accept floating numbers. How can I align var, let and const the way I want using ESLint?