Styledictionary/4/Hook Api Preprocessors

1.0.2Last update Oct 7, 2024
by@manishjha-04

This codemod updates registered preprocessors to be placed inside the hooks.preprocessors property, instead of preprocessor, with a shift from the singular to the plural form. Registered preprocessors now apply globally without requiring explicit application in the config.

Before

export default {
preprocessors: {
foo: (dictionary) => {
// preprocess it
return dictionary;
},
},
preprocessors: ['foo'],
platforms: {
css: {
preprocessors: ['foo'],
},
},
};

After

export default {
preprocessors: ['foo'],
platforms: {
css: {
preprocessors: ['foo'],
},
},
hooks: {
preprocessors: {
foo: (dictionary) => {
// preprocess it
return dictionary;
},
},
},
};

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now