lukeapage / eslint-plugin-destructuring

Eslint rules related to ES2015 destructuring
17 stars 5 forks source link

docs: in-params: changed not valid assignment to arrow function #45

Open coderaiser opened 3 years ago

coderaiser commented 3 years ago

This code is not valid:

const t2 = (b, {a}) = a;

Sometimes because of a typo such valid code can be written as well:

const createRegExp = (a) = RegExp(a, 'g');

You can handle such cases in js and readme files using putout super linter with help of @putout/plugin-convert-assignment-to-arrow-function.

It will fix it to:

const createRegExp = (a) => RegExp(a, 'g');