# no-extra-semi

Disallow unneeded semicolons.

Unneeded semicolons are often caused by typing mistakes, while this is not an error, it can cause confusion when reading the code. This rule disallows empty statements (extra semicolons).

# Invalid Code Examples

if (foo) {
    ;
}
class Foo {
    constructor() {};
}
More incorrect examples
;
if (foo) {
  ;
}
class Foo {
  ;
}
class Foo extends Bar {
  constructor() {};
}
More correct examples
class Foo {}

Source (opens new window)

Last Updated: 11/18/2020, 9:36:33 PM