From 4b2e4a0da185c8a4544c201cd0c7df82c4697ccb Mon Sep 17 00:00:00 2001 From: zernonia Date: Tue, 18 Jun 2024 22:26:18 +0800 Subject: [PATCH] chore: cleanup --- .../src/utils/transformers/transform-css-vars.ts | 13 ++----------- .../cli/src/utils/transformers/transform-import.ts | 10 +--------- .../src/utils/transformers/transform-tw-prefix.ts | 13 ++----------- 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/packages/cli/src/utils/transformers/transform-css-vars.ts b/packages/cli/src/utils/transformers/transform-css-vars.ts index 764a5ef3..abb86364 100644 --- a/packages/cli/src/utils/transformers/transform-css-vars.ts +++ b/packages/cli/src/utils/transformers/transform-css-vars.ts @@ -8,21 +8,14 @@ export function transformCssVars(opts: TransformOpts): CodemodPlugin { type: 'codemod', name: 'add prefix to tailwind classes', - // eslint-disable-next-line unused-imports/no-unused-vars - transform({ scriptASTs, sfcAST, styleASTs, filename, utils: { traverseScriptAST, traverseTemplateAST } }) { - // codemod plugins self-report the number of transforms it made - // this is only used to print the stats in CLI output + transform({ scriptASTs, sfcAST, utils: { traverseScriptAST, traverseTemplateAST } }) { let transformCount = 0 const { baseColor, config } = opts + if (config.tailwind?.cssVariables || !baseColor?.inlineColors) return transformCount - // scriptASTs is an array of Program ASTs - // in a js/ts file, this array will only have one item - // in a vue file, this array will have one item for each