eslint-plugin-destructuring icon indicating copy to clipboard operation
eslint-plugin-destructuring copied to clipboard

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

Open coderaiser opened this issue 4 years ago • 0 comments

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');

coderaiser avatar Mar 26 '21 11:03 coderaiser