Registry
M

styledictionary/4/hook-api-filters

No description available

manishjha-0410,619 executions

  • Legacy
  • styledictionary
  • 4
  • migration
Connect a repo
npx codemod styledictionary/4/hook-api-filters

What Changed

This codemod updates registered filters to be placed inside the hooks.filters property, instead of filter. Note the shift from the singular to the plural form in this update.

Before

jsx
export default {
  filter: {
    "colors-only": (token) => token.type === "color",
  },
  platforms: {
    css: {
      files: [
        {
          format: "css/variables",
          destination: "_variables.css",
          filter: "colors-only",
        },
      ],
    },
  },
};

After

jsx
export default {
  platforms: {
    css: {
      files: [
        {
          format: "css/variables",
          destination: "_variables.css",
          filter: "colors-only",
        },
      ],
    },
  },

  hooks: {
    filters: {
      "colors-only": (token) => token.type === "color",
    },
  },
};

Ready to evolve your codebase?

Build tailored, compiler-aware skills to assess, plan, and automate complex codebase changes.