Adds a codemod for moving from chalk to picocolors.
This will throw if exports are encountered which picocolors doesn't provide. For example, as of writing this, picocolors doesn't support bright colours (but soon will). That means chalk.redBright will throw since picocolors has no redBright export.
These patterns are supported:
// Before
chalk.red.bold(str);
// After
pc.red(pc.bold(str));
// Before
chalk.red`i am red`;
// After
pc.red(`i am red`);
// Before
chalk.red`i am red and ${chalk.bold('bold')}!`;
// After
pc.red(`i am red and ${pc.bold('bold')}!`);
Some patterns will not be detected. For example:
// Not detected since it isn't a call expression
chalk.red;
// Similarly not detected
const red = chalk.red;
red(str);
Adds a codemod for moving from
chalk
topicocolors
.This will throw if exports are encountered which picocolors doesn't provide. For example, as of writing this, picocolors doesn't support bright colours (but soon will). That means
chalk.redBright
will throw since picocolors has noredBright
export.These patterns are supported:
Some patterns will not be detected. For example: