semi-spacing
在分号前后强制保持一致的间距
一些该规则报告的问题可以通过 --fix 命令行选项 自动修复
JavaScript 允许您在分号之前或之后放置不必要的空格。
禁止或强制使用分号周围的空格可以提高程序的可读性。
var a = "b" ;
var c = "d";var e = "f";
规则详情
此规则旨在强制在分号周围使用空格。此规则防止在表达式中的分号前使用空格。
aPUhu3DTJodNDelxmAYaZ3e+wcCjL7ox0P9SUPz2lHz2+50cr5YHAQ1HlW7hYirSaECAvIlN67+7gR271YKskA==
- ijeJdalrE0PHxw1KodZEQ4n6Wl//UVg95GFyM/CGOL53RBOuBY85B20gqEDt8IuF+wZwmMNlNI/0fwL66wF8vPrSPpHdH2bUAs9wzKt15Y7Js6sfSuhDVwA6/AjIexYETV5bgNki4/yeqC1V3R7houdHhJLQxDd6UxhKz1NTQZuWxpXZx3guwcI3MgiRJn/4g4fKRAtC+/cqEPkhpY4iG4b/u8SOSefMX6X1gZbMQCvVH2BWSFRNjSeae6ja2u4AwP4e8b5Nz2sIXNQRVKxv10xZMc7YAkqNcYpY5g9VPAKwvSoVTX/34DXcBiR1nLrTF+DmfE+U4+m/OSvMlKeG+Hixz8McROUKyByOkCcmDd2tiLg8ZFM+qoWeng0nCfjD903pNksnIa2epZwsc32FoT3/OFRXNtsdAwmWGNPW80cFSnwXgzKvqArdvzVQ+rlyYSeYFgkip2XwHSjFrvUXdw9goa1TJai5nbNf3RZA3/ExGwOdmxbJehwUqQ9qsIc1Txlmdf7ItNKD6X/gvXNGmj2KjU+U1ZchGByCuzzkK4sh046TjCBEjEY9iPodyojSP8y/yh3SEBA2aUUKoWQummXIiV164Cv3f7e1aKRjFtIsMTAhaisoMzG0kz72a6r3
选项
xX6mdHtiflgxkX5jKDVWy09IiElGjM0H0/lUFkJYnFrTaC17nUo85yXU7OoR7EMaIzfxFIw7s2HF9Ri8mHNGq63a4VHKp4LHH+H8Pce9SBZk0HmQ7JlCLxGPycSaGO/JF1e4JnoySknwuHxSnvL/Bp7OiaWD1bTlOKfFS6Riu78sCgD5HWo72f6Fqk+kr3kqL0f+1XPzF04+ULSIppEHIssJarrbZpCWJrFKwC7oIpqtKCnPCJWdzllPKw4BmeJDOfpqz6WSxcSOxf+tkPka+TRc7FiU7M2259KqXdNH2O6mXguCRognAZXUAL1/cNedjOVF/Q3thB8wfGFqKZUxo+BHXLnjZaCaRjxJN+cMrAsz4M8FmeV1JRH3MFzhzyItWZSwHCxlezCWjy7QtzvZk6QZlnkSq0NzoRpVa0h2cybo2YnCH+rpANFYnIBwuQYLsQpYYMoMEea4J48X6EvvQLW7xXYiwPQnnjHa+w0qrBHesVO5ZjhBzFjR0frXWapAJ1Oz1vg6k2a2uVWtc36yq56yiTxCeqXY3mt1WcgYBRqQPdbKYBa37oqv1oEJHefGhwy6yF1R8oNRgM0ST4h7SPYEmBchtWi9A0R/VFrpw+eDJxJGXGnMd2MlzxyHxzyBoGomoYpigXoMB/fO2bKESYCCtEjqIXWCfCQqUfV7rv0=
z/irrDwFX5AkaaEzRertAMBMaR7F83/euec1wkHYboRcddvsz/mekC3xjeiM1wtNcOQOS1i+6pefFJ6BNbqpOg==
"semi-spacing": ["error", {"before": false, "after": true}]
{"before": false, "after": true}
M2qnSdpTYo4w3G2dWMzjYx7odR9Lc5AtpcgtTHoAC599gvEyJ+PmOHN6vj+64nVkF/9OdRHxUHC3u8cveXT4LDcqfQfWEmOAqURd1FR9oq924kNWlCSvrQ4V9K9Giw2i
k7HkpyhTRoT9T3bsrVJ1W9IUT56r3GvYicL0qS8XjwbDvDXG9eGk/CkswpMjh9k+
/*eslint semi-spacing: "error"*/
var foo ;
var foo;var bar;
throw new Error("error") ;
while (a) { break ; }
for (i = 0 ; i < 10 ; i++) {}
for (i = 0;i < 10;i++) {}
f/g6SKVZdhoBiPVtnee0m+uPEv1T4kMgIaFUpxdtFwzAZHGBqJ5dJxRHxHHP/cP8
/*eslint semi-spacing: "error"*/
var foo;
var foo; var bar;
throw new Error("error");
while (a) { break; }
for (i = 0; i < 10; i++) {}
for (;;) {}
if (true) {;}
;foo();
{"before": true, "after": false}
yIO7KukCthWt8yraOnWVrj5wr55/yjop2MSv3ipgqCIvaUB2Se+6+bL7id7Ww6nexawHFxzM3JQfpgyjinouxmUsgll9WwfyDMzxhu8hNfk=
gXTXeFewMhKUGG8XamsAXYZfTWkOSWYIGWs0YrfZl4XcYcMb6GIHgxyaFhZIyofYfGsnf06RaJSEOHEzkGr/hL1JBrVFxxSZ1r19fzdl6334sccg1WM5xT/kfSRWT+6A
/*eslint semi-spacing: ["error", { "before": true, "after": false }]*/
var foo;
var foo ; var bar;
throw new Error("error");
while (a) { break; }
for (i = 0;i < 10;i++) {}
for (i = 0; i < 10; i++) {}
gXTXeFewMhKUGG8XamsAXYZfTWkOSWYIGWs0YrfZl4XcYcMb6GIHgxyaFhZIyofYfGsnf06RaJSEOHEzkGr/hM+SxFqA2X75UqPPyr63OpPCobIwEz0HaqtOYB4waJqy
/*eslint semi-spacing: ["error", { "before": true, "after": false }]*/
var foo ;
var foo ;var bar ;
throw new Error("error") ;
while (a) {break ;}
for (i = 0 ;i < 10 ;i++) {}
何时不使用
mMx/FQV1L6oUUbC3LYsGWu6rLZT6EDAFn7Ebfpui1W1cs8hGbmJ50RsWslfdnlRBRcV3P+uavUYfIDy7E4H+cI5QhwP5ONc4IUPvhwzBntY=