dot-location

在点之前和之后强制执行一致的换行符

一些该规则报告的问题可以通过 --fix 命令行选项 自动修复

JavaScript 允许您在成员表达式中的点之前或之后放置换行符。

在点之前或之后放置换行符的一致性可以大大提高可读性。

var a = universe.
        galaxy;

var b = universe
       .galaxy;

规则详情

此规则旨在强制成员表达式中的换行符一致性。此规则防止在成员表达式中的点周围使用混合换行符。

选项

xX6mdHtiflgxkX5jKDVWy09IiElGjM0H0/lUFkJYnFpTUQYQGD/1VpKQRNi3ZEDJXTJg+TP6lEjtcdkz96CzWA==

    om91l/Rn5KGZXFnJJnkfHnOGdersqudJUk4ymkpKwLWycJ7Yit8Hf7UJdz9J20S50+g1cG5NenYBC7cvc2U8XRrD1kwBGo5bEco+6EEFLtYZC3zMWgSiFI+rH3vOtuGwg/pn5vRf0qnSzKJAOUFFA60UDeE3CwcDAwWWJWnAAOTZlU4jE0xRorHptVjP3alBm0zRaa8fRavuNAinNiw/+x8Ngt+rGTc26oQHh2IpfqqtUpwAylDbopjw278IJsZKYFbZwwkEreSEvfuMWutRxW9UD5cQT6EI7WZa4y4BoydOWKtgqVAJ+1mtwuNRIBLf

object

VXvbiog8P09+bLxYZjznB5oXgohChTDV50Idab00nIVPGvb13vOdshmatjXOOoIFVe1cCfZN5YJBEsCRed13CaoUQZYspAqvOTQJk/Z2Ymw=

VXvbiog8P09+bLxYZjznB5oXgohChTDV50Idab00nIUSyp21E7c8xGO99c1VL1KG4xhYYY3z1pqn+Cr863uXKQ==

/*eslint dot-location: ["error", "object"]*/

var foo = object
.property;

VXvbiog8P09+bLxYZjznB5oXgohChTDV50Idab00nIW8+hbfO9e1dmESBVIO2q4n9zI6ddzplQRHu3DGPysK5Q==

/*eslint dot-location: ["error", "object"]*/

var foo = object.
property;

var bar = (
    object
).
property;

var baz = object.property;

property

D/amQS3/KbFrpBi5q1f7elTG3cqaf0CaPQ1KBLyv+rdHoTIsbnWBuTFZZYqCXtmr+1UFJ6f1m+cLVB2nRxHrNec3NHgWmvGZvyN85m3QiUE=

D/amQS3/KbFrpBi5q1f7eul05rythEfEeH6IN1cF9mf2xXn7ZXFJO3i/YRg5e07iR7QLbx3OseDWKZefCfcxtA==

/*eslint dot-location: ["error", "property"]*/

var foo = object.
property;

D/amQS3/KbFrpBi5q1f7eul05rythEfEeH6IN1cF9mdEsz8ytNadUPeKgA0zheZep7lvyq24piDPsgwgHvuA7A==

/*eslint dot-location: ["error", "property"]*/

var foo = object
.property;
var bar = object.property;

何时不使用

mMx/FQV1L6oUUbC3LYsGWrbFDkKxFLQERjJXDl1LlbGAeeOdzinGa0ALofVHkoYnlB7AOcPPDgcHtgeR8phGQu7KcUQDxCgDPDplEy/9G/KgrkOMRwlGCDZU3F8v3j/+6ORvm4p90E5HBzsGBCiIkA==