12 JavaScript allows you to place newlines before or after a dot in a member expression.
14 Consistency in placing a newline before or after the dot can greatly increase readability.
26 This rule aims to enforce newline consistency in member expressions. This rule prevents the use of mixed newlines around the dot in a member expression.
30 The rule takes one option, a string:
32 * If it is `"object"` (default), the dot in a member expression should be on the same line as the object portion.
33 * If it is `"property"`, the dot in a member expression should be on the same line as the property portion.
37 The default `"object"` option requires the dot to be on the same line as the object.
39 Examples of **incorrect** code for the default `"object"` option:
44 /*eslint dot-location: ["error", "object"]*/
52 Examples of **correct** code for the default `"object"` option:
57 /*eslint dot-location: ["error", "object"]*/
67 var baz = object.property;
74 The `"property"` option requires the dot to be on the same line as the property.
76 Examples of **incorrect** code for the `"property"` option:
81 /*eslint dot-location: ["error", "property"]*/
89 Examples of **correct** code for the `"property"` option:
94 /*eslint dot-location: ["error", "property"]*/
98 var bar = object.property;
103 ## When Not To Use It
105 You can turn this rule off if you are not concerned with the consistency of newlines before or after dots in member expressions.