From 6a64683621417edd8ed018baabc236a6c66a8b49 Mon Sep 17 00:00:00 2001 From: Peng-Yu Chen Date: Thu, 2 Jan 2025 22:24:28 -0500 Subject: [PATCH] chore(eslint): use imported `tailwindcssAnimate` People with the following settings ```.eslintrc.json "rules": { "@typescript-eslint/no-require-imports": "error" } ``` will get the error: ``` A `require()` style import is forbidden.eslint@typescript-eslint/no-require-imports ``` --- packages/cli/src/utils/templates.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/utils/templates.ts b/packages/cli/src/utils/templates.ts index f602416b4d3..96b546cf64a 100644 --- a/packages/cli/src/utils/templates.ts +++ b/packages/cli/src/utils/templates.ts @@ -131,6 +131,7 @@ module.exports = { }` export const TAILWIND_CONFIG_TS = `import type { Config } from "tailwindcss" +import tailwindcssAnimate from "tailwindcss-animate" const config = { darkMode: ["class"], @@ -166,12 +167,13 @@ const config = { }, }, }, - plugins: [require("tailwindcss-animate")], + plugins: [tailwindcssAnimate], } satisfies Config export default config` export const TAILWIND_CONFIG_TS_WITH_VARIABLES = `import type { Config } from "tailwindcss" +import tailwindcssAnimate from "tailwindcss-animate" const config = { darkMode: ["class"], @@ -247,7 +249,7 @@ const config = { }, }, }, - plugins: [require("tailwindcss-animate")], + plugins: [tailwindcssAnimate], } satisfies Config export default config`