ESLint
Docs for semi in ESLintsemi
eslint
Safe autofix
eslint.config.js
export default [
{
rules: {
"semi": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
var name = "ESLint"
object.method = function() {
// ...
}
class Foo {
bar = 1
}var name = "ESLint";
object.method = function() {
// ...
};
class Foo {
bar = 1;
}import a from "a"
(function() {
// ...
})()var name = "ESLint";
object.method = function() {
// ...
};
class Foo {
bar = 1;
}if (foo) { bar() }
if (foo) { bar(); baz() }
function f() { bar(); baz() }
class C {
foo() { bar(); baz() }
static { bar(); baz() }
}export class SomeClass{
logType(){
console.log(this.type);
console.log(this.anotherType);
}
}
export class Variant1 extends SomeClass{type=1}
export class Variant2 extends SomeClass{type=2; anotherType=3}Examples from the ESLint documentation.
semi
eslint
export default [
{
rules: {
"semi": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce the use of variables within the scope they are defined
Require for-in loops to include an if statement
Require var declarations be placed at the top of their containing scope
Disallow the use of alert, confirm, and prompt