@putout/plugin-add-missing-parens
v2.0.1
Published
šPutout plugin adds missing parens
Downloads
6,557
Maintainers
Readme
@putout/plugin-add-missing-parens
The JavaScript exception "tagged template cannot be used with optional chain" occurs when the tag expression of a tagged template literal is an optional chain, or if there's an optional chain between the tag and the template.
(c) MDN
šPutout plugin adds ability to add missing parens. Check out in šPutout Editor. Merged to @putout/plugin-parens
.
Install
npm i @putout/plugin-add-missing-parens
Rule
{
"rules": {
"add-missing-parens": "on"
}
}
ā Example of incorrect code
getConsoleLog?.()``;
String?.raw``;
String?.raw!``;
await asyncFn()?.filter((x) => x);
ā Example of correct code
(getConsoleLog?.())``;
(String?.raw)``;
String?.raw!``;
(await asyncFn())?.filter((x) => x);
License
MIT