I'm looking for a rule which aligns all =
on assignments.
Something like this would be positive:
var foo = 12;
var barfoo = 21;
var barfoobar = 22;
Something like this would be negative:
var foo = 12;
var barfoobar = 21;
Rubocop has a rule called ForceEqualSignAlignment
for exactly this. I wonder if there is something like that for ESLint
?
Check out https://www.npmjs.com/package/eslint-plugin-align-assignments. It works well.
Unfortunately it seems to conflict with no-multi-spaces because of the spaces in front of the variable name.
let a1 = 2; // (no-multi-spaces) Multiple spaces found before 'a1'.
const a = a1;
const b = a;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With