statement(s) templates yields some weird stuff
Author: zpdDG4gta8XKpMCdCreated Mar 10, 2019Updated Jan 29, 2025
Labelsbug
consider the following snippet
const statement = template.statements`const ${name} = require('${name}');
`;the output is as follows:
const range_1 = require('$jscodeshift1441$');
const minimal_connectivity_leg_1 = require('$jscodeshift1443$');
const connectivity_path_1 = require('$jscodeshift1445$');
const connectivity_ref_1 = require('$jscodeshift1447$');
const new_connectivity_path_1 = require('$jscodeshift1449$');
const core_1 = require('$jscodeshift1451$');
const menu_1 = require('$jscodeshift1453$');
const versioned_1 = require('$jscodeshift1455$');note, that the first use of name is correct, whereas the second one takes some of jscodeshift internals
Source: facebook/jscodeshift