🔧 The --fix
option on the command line can automatically fix some of the problems reported by this rule.
We like to enforce the rule that when you use chaining with line breaks, you put the final semicolon on a new line at the same indentation as the first line of the chain.
var a = b
.c()
.d
.e()
;
👎 Examples of incorrect code for this rule:
// eslint chained-semi: ["error"]
var a = b
.c()
.d
.e();
// eslint chained-semi: ["error"]
var a = b
.c()
.d
.e()
;
👍 Examples of correct code for this rule:
// eslint chained-semi: ["error"]
var a = b
.c()
.d
.e()
;
// eslint chained-semi: ["error"]
var a = b.c.d.e;
If you don't want to enforce semicolon placement after chained statements.