semi-style

强制分号的位置

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

通常,分号位于行尾。但是,在无分号样式中,分号位于行首。此规则强制分号位于配置的位置。

规则详情

此规则报告分号周围的行终止符。

该规则有一个选项。

{
    "semi-style": ["error", "last"],
}
    UoY16LGRaBbLHdb6X0sOq8F0apBznRtkmYi3EVGzgAFalvARcBKffk3zxgI0WWcv8IMJ5EjVK/HetH9xfCaTohsNh2N8kog+szF7KaYGE90L2IDELqwhpcUj2BeMrO53up+k3YazuW+wVwEzKd3/ZopGsuFqfWVFndiOIkCKNyxgdW2kLbUy5MgGM7XzOY7NAKsV+jLrs27IbeuNULtQe7UCJllWf6AR89KNfKYGN9MULQlNUbu2H1wd0d4u4rtLHjglL0FRvrKRtrNt2NaOPC+BL6XoVVLd0IVL7wpWaNsUtgteXxTx5fxiLZfXfh4RnAVRNiqwC38Tr/RlBUYIwgzv9RicvWpvOnYRaav/nY0=

RACldf1US4dq3VsTUR9LKp+RzZyWsEOQkdrRHJ/fqPkVNcRZXEJuWnaXXoVnH8iEMn1Bnc8LYXhTeW2KNn+v54cVWs/KEHD5/O5r5H8wdkg=

/*eslint semi-style: ["error", "last"]*/

foo()
;[1, 2, 3].forEach(bar)

for (
    var i = 0
    ; i < 10
    ; ++i
) {
    foo()
}

class C {
    static {
        foo()
        ;bar()
    }
}

zsV3VIEaArmSNnLhUR0dDxTZusluZRnGbHMK3nAQLU3obE11/4jO3QmZrO7RSkib8Oe3RUpQM3ehMN7Nqkbz6BVPNJm0WD2O+x04KvPpbJg=

/*eslint semi-style: ["error", "last"]*/

foo();
[1, 2, 3].forEach(bar)

for (
    var i = 0;
    i < 10;
    ++i
) {
    foo()
}

class C {
    static {
        foo();
        bar()
    }
}

xgGjLA1mW8bCI3SWaVo5zOoAlgSG8hZ2HSiZNg5KM1zSI6LQ8iNvuDRVj/GcVOn23Ot6AcOYmcOeMeZ6pUliR5Jrdxy3c+AHjiiwu5GvnCU=

/*eslint semi-style: ["error", "first"]*/

foo();
[1, 2, 3].forEach(bar)

for (
    var i = 0
    ; i < 10
    ; ++i
) {
    foo()
}

class C {
    static {
        foo();
        bar()
    }
}

zsV3VIEaArmSNnLhUR0dD/BAUnw+Y/w8LTf0VQxw0cSwl/TR6MXKGWG6OZvz2vwNPQZONVduxed6eopyEWTH6XBrmOlCOTAc7nKullwD7Rw=

/*eslint semi-style: ["error", "first"]*/

foo()
;[1, 2, 3].forEach(bar)

for (
    var i = 0;
    i < 10;
    ++i
) {
    foo()
}

class C {
    static {
        foo()
        ;bar()
    }
}

何时不使用

Gc4r9C0iXuRFyiquXRkB2UISut6zfrn1oHO4qP6W5rD5EXx2C7PEfeTdGozdxf85+JNw2DTRBBYDPJcprpCTPRb5fuNWde9hjzLgc1wkOoA=