arrow-spacing
Configuration
Enforce consistent spacing before and after the => in arrow functions.
Rule Details
This rule normalizes the whitespace around the => token of arrow functions. It also applies to TypeScript function-type and constructor-type annotations (type F = () => void, type C = new () => Foo).
Examples of incorrect code for this rule with the default { "before": true, "after": true } option:
Examples of correct code for this rule with the default { "before": true, "after": true } option:
Options
This rule has an object option:
"before": true(default) requires a space before=>. Set tofalseto forbid the space."after": true(default) requires a space after=>. Set tofalseto forbid the space.
Either key may be omitted; a missing key falls back to its default true.
before
Examples of incorrect code for this rule with the { "before": false } option:
Examples of correct code for this rule with the { "before": false } option:
after
Examples of incorrect code for this rule with the { "after": false } option:
Examples of correct code for this rule with the { "after": false } option: