From e20b3e95d6e2b089dd24d73c7d8226581a81c3e4 Mon Sep 17 00:00:00 2001 From: "Babanazar Kamyljanov [SSW]" <138548013+babakamyljanovssw@users.noreply.github.com> Date: Tue, 7 Jan 2025 07:14:16 +0800 Subject: [PATCH] Enabled tailwindcss rules in eslint and prettier (#3417) * turned on eslint classname order rule * changed classname orders as per eslint warning * added prettier tailwindcss plugin * enabled plugin in .prettierrc * changed classname order as per prettier plugin warning * testing ubuntu 22-04 * fix ubuntu version * changed ubuntu version for linting * test different node version * added focus:ring class * test node 23.4.0 version * testing latest eslint with latest node js versions * revert eslint version to 8.57.1 * use .nvmrc * used .eslintrc.json * added root * added tailwind classname order * changed the classnames order, refactor eslintrc and packages * fix classnames order * added tailwindcss to eslint * fix prettier issue --------- Co-authored-by: Calinator444 Co-authored-by: Caleb Williams [SSW] <65635198+Calinator444@users.noreply.github.com> --- .eslintrc => .eslintrc.json | 23 +- .prettierrc | 3 +- components/consulting/index/pageCard.tsx | 2 +- components/layout/v2ComponentWrapper.tsx | 6 +- .../textInputWithCount/textInputWithCount.tsx | 8 +- package.json | 9 +- pnpm-lock.yaml | 1126 ++++++++++------- 7 files changed, 679 insertions(+), 498 deletions(-) rename .eslintrc => .eslintrc.json (72%) diff --git a/.eslintrc b/.eslintrc.json similarity index 72% rename from .eslintrc rename to .eslintrc.json index d73d92de19..8c5c6aa48f 100644 --- a/.eslintrc +++ b/.eslintrc.json @@ -4,36 +4,35 @@ "plugins": ["@typescript-eslint", "tailwindcss"], "extends": [ "eslint:recommended", + "next/core-web-vitals", "next/typescript", - "plugin:react/recommended", "plugin:tailwindcss/recommended", - "next/core-web-vitals", - "plugin:prettier/recommended", + "plugin:prettier/recommended" ], "rules": { "@typescript-eslint/no-unused-expressions": [ "error", { "allowShortCircuit": true, - "allowTernary": true, - }, + "allowTernary": true + } ], "quotes": ["error", "double"], "no-console": "warn", "tailwindcss/no-arbitrary-value": "error", - "tailwindcss/classnames-order": "off", + "tailwindcss/classnames-order": "error", "tailwindcss/no-custom-classname": [ "error", { - "whitelist": ["g\\-yt.+", "prose-.+", "text-3xl/9", "legend", "dark"], - }, + "whitelist": ["g\\-yt.+", "prose-.+", "text-3xl/9", "legend", "dark"] + } ], "prettier/prettier": [ "error", { - "endOfLine": "auto", - }, - ], + "endOfLine": "auto" + } + ] }, - "reportUnusedDisableDirectives": true, + "reportUnusedDisableDirectives": true } diff --git a/.prettierrc b/.prettierrc index 40a6371f94..4e2de380e3 100644 --- a/.prettierrc +++ b/.prettierrc @@ -3,5 +3,6 @@ "singleQuote": false, "tabWidth": 2, "trailingComma": "es5", - "tailwindConfig": "./tailwind.config.js" + "tailwindConfig": "./tailwind.config.js", + "plugins": ["prettier-plugin-tailwindcss"] } diff --git a/components/consulting/index/pageCard.tsx b/components/consulting/index/pageCard.tsx index 1a6a32d05d..cabfd58e38 100644 --- a/components/consulting/index/pageCard.tsx +++ b/components/consulting/index/pageCard.tsx @@ -17,7 +17,7 @@ export const PageCard = ({ page, category, pageIndex }) => {
{page.logo && ( { return value.reference === data.background?.backgroundColour; })?.classes, - "w-full relative overflow-visible", + "relative w-full overflow-visible", className )} > @@ -67,7 +67,7 @@ const V2ComponentWrapper = ({ background image
{isTextArea ? (