Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rules): omit arrow function parens unless they are necessary
Remove `requireForBlockBody` option of `arrow-body-style` rule. BREAKING CHANGE: previously, only arrow functions consisting of a single expression were allowed to omit parentheses around the parameter list (and required to, if there's only one parameter in the list). After this change, the parens are only allowed when they are required syntactically. Before: ```js const f = x => x; const g = (x, y) => x + y; const h = (x) => { console.log(x); }; const i = (x, f) => { f(x); }; ``` After: ```js // Not affected const f = x => x; // Not affected const g = (x, y) => x + y; // AFFECTED const h = x => { console.log(x); }; // Not affected const i = (x, f) => { f(x); }; ``` This rule is fixable via `eslint --fix`. Refs: metarhia/Metarhia#22
- Loading branch information