@putout/plugin-convert-template-to-string
Version: 
🐊Putout plugin adds ability to find and remove useless template string
15 lines (11 loc) • 341 B
JavaScript
;
module.exports.report = () => 'Avoid using Template string with only one expression';
module.exports.match = () => ({
    '`${__a}`': (vars, path) => {
        const {parentPath} = path;
        return !parentPath.isTaggedTemplateExpression();
    },
});
module.exports.replace = () => ({
    '`${__a}`': 'String(__a)',
});