Possible Errors

Best Practices

Strict Mode

Variables

Node.js and CommonJS

Stylistic Issues

ECMAScript 6

keyword-spacing

- Enforce consistent spacing before and after keywords

Fixable

This rule enforces consistent spacing around keywords and keyword-like tokens: as (in module declarations), async (of async functions), await (of await expressions), break, case, catch, class, const, continue, debugger, default, delete, do, else, export, extends, finally, for, from (in module declarations), function, get (of getters), if, import, in, instanceof, let, new, of (in for-of statements), return, set (of setters), static, super, switch, this, throw, try, typeof, var, void, while, with, and yield. This rule is designed carefully not to conflict with other spacing rules: it does not apply to spacing where other rules report problems.

What ESLint should do when it catches the rule break

Show a warning

Options

before

Requires at least one space before keywords.

after

Requires at least one space after keywords.

Rule examples

You can check them out here.