Disallow unnecessary semicolons
The "extends": "eslint:recommended"
property in a configuration file enables this rule
Some problems reported by this rule are automatically fixable by the --fix
command line option
Typing mistakes and misunderstandings about where semicolons are required can lead to semicolons that are unnecessary. While not technically an error, extra semicolons can cause confusion when reading code.
This rule disallows unnecessary semicolons.
Examples of incorrect code for this rule:
/*eslint no-extra-semi: "error"*/
var x = 5;;
function foo() {
// code
};
class C {
field;;
method() {
// code
};
static {
// code
};
};
Examples of correct code for this rule:
/*eslint no-extra-semi: "error"*/
var x = 5;
function foo() {
// code
}
var bar = function() {
// code
};
class C {
field;
method() {
// code
}
static {
// code
}
}
If you intentionally use extra semicolons then you can disable this rule.
This rule was introduced in ESLint v0.0.9.
© OpenJS Foundation and other contributors
Licensed under the MIT License.
https://eslint.org/docs/latest/rules/no-extra-semi