From 66767ecb536cb7b408f31ecef30154f0870bdb16 Mon Sep 17 00:00:00 2001 From: Hendrik Schmidt Date: Tue, 21 Jan 2025 12:23:02 +0100 Subject: [PATCH] Introduce eslint tailwind plugin --- .eslintrc.cjs | 4 ++++ package-lock.json | 20 +++++++++++++++- package.json | 3 ++- packages/dito/app/components/Accordion.tsx | 2 +- .../dito/app/components/AccordionItem.tsx | 12 +++++----- packages/dito/app/components/FeedbackForm.tsx | 8 +++---- .../dito/app/components/InterviewBanner.tsx | 2 +- packages/dito/app/components/LinkBar.tsx | 2 +- .../dito/app/components/ParagraphList.tsx | 4 ++-- .../dito/app/components/VisualisationItem.tsx | 10 ++++---- packages/dito/app/root.tsx | 6 ++--- packages/dito/app/routes/_index.tsx | 16 ++++++------- packages/dito/app/routes/beispiele._index.tsx | 2 +- .../routes/beispiele.prinzipien.$prinzip.tsx | 6 ++--- .../routes/beispiele.regelungen.$regelung.tsx | 12 +++++----- packages/dito/app/routes/methoden.tsx | 4 ++-- .../dito/app/routes/methoden_.$subPage.tsx | 8 +++---- .../app/routes/methoden_.fuenf-prinzipien.tsx | 2 +- packages/dito/app/routes/sitemap.tsx | 4 ++-- .../routes/unterstuetzung/SupportTabList.tsx | 10 ++++---- .../dito/app/routes/unterstuetzung/route.tsx | 24 +++++++++---------- .../PreCheckNavigation.tsx | 4 ++-- .../routes/vorpruefung.$questionId/route.tsx | 6 ++--- .../dito/app/routes/vorpruefung._index.tsx | 4 ++-- .../vorpruefung.ergebnis/ResultPage.tsx | 10 ++++---- .../dito/app/routes/vorpruefung.hinweise.tsx | 4 ++-- packages/shared/components/BetaBanner.tsx | 4 ++-- packages/shared/components/Breadcrumbs.tsx | 4 ++-- packages/shared/components/DetailsSummary.tsx | 4 ++-- packages/shared/components/FeedbackBanner.tsx | 6 ++--- packages/shared/components/FeedbackForm.tsx | 14 +++++------ packages/shared/components/Footer.tsx | 6 ++--- packages/shared/components/InfoBoxItem.tsx | 2 +- packages/shared/components/InlineNotice.tsx | 8 +++---- packages/shared/components/Input.tsx | 2 +- packages/shared/components/InputError.tsx | 6 ++--- packages/shared/components/InputWarning.tsx | 4 ++-- packages/shared/components/LabelWithIcon.tsx | 2 +- packages/shared/components/List.tsx | 14 +++++------ packages/shared/components/ListItem.tsx | 19 +++++++-------- packages/shared/components/RadioGroup.tsx | 4 ++-- .../shared/components/openInNewWindow.tsx | 2 +- packages/tool-finder/src/App.tsx | 6 ++--- .../tool-finder/src/MaintenanceModeApp.tsx | 6 ++--- .../tool-finder/src/components/PageHeader.tsx | 2 +- .../src/components/Recommendation.tsx | 6 ++--- .../tool-finder/src/routes/Accessibility.tsx | 6 ++--- .../tool-finder/src/routes/DecisionTree.tsx | 6 ++--- packages/tool-finder/src/routes/Diagram.tsx | 6 ++--- packages/tool-finder/src/routes/Flowchart.tsx | 14 +++++------ packages/tool-finder/src/routes/Imprint.tsx | 6 ++--- packages/tool-finder/src/routes/InfoPage.tsx | 12 +++++----- .../src/routes/MaintenanceModePage.tsx | 6 ++--- packages/tool-finder/src/routes/Privacy.tsx | 6 ++--- packages/tool-finder/src/routes/QuizPage.tsx | 8 +++---- .../tool-finder/src/routes/ResultPage.tsx | 14 +++++------ 56 files changed, 207 insertions(+), 187 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 75fc7cea..b0e48fea 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -91,6 +91,7 @@ module.exports = { "plugin:@typescript-eslint/recommended-type-checked", "plugin:import/recommended", "plugin:import/typescript", + "plugin:tailwindcss/recommended", ], parser: "@typescript-eslint/parser", parserOptions: { @@ -111,6 +112,9 @@ module.exports = { project: ["**/tsconfig.json"], }, }, + tailwindcss: { + whitelist: ["ds\\-(.*)", "plausible\\-(.*)", "parent-bg-blue"], + }, }, rules: { "@typescript-eslint/ban-ts-comment": "warn", diff --git a/package-lock.json b/package-lock.json index 99654413..8988fd2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,7 @@ "@typescript-eslint/parser": "^8.21.0", "@vitejs/plugin-react": "^4.3.0", "autoprefixer": "^10.4.16", - "eslint": "^8.57.0", + "eslint": "^8.57.1", "eslint-config-prettier": "^10.0.1", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.31.0", @@ -40,6 +40,7 @@ "eslint-plugin-react": "^7.37.0", "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-refresh": "^0.4.3", + "eslint-plugin-tailwindcss": "^3.18.0", "eslint-plugin-testing-library": "^7.0.0", "license-checker": "^25.0.0", "prettier": "^3.4.1", @@ -7593,6 +7594,23 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-tailwindcss": { + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-tailwindcss/-/eslint-plugin-tailwindcss-3.18.0.tgz", + "integrity": "sha512-PQDU4ZMzFH0eb2DrfHPpbgo87Zgg2EXSMOj1NSfzdZm+aJzpuwGerfowMIaVehSREEa0idbf/eoNYAOHSJoDAQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-glob": "^3.2.5", + "postcss": "^8.4.4" + }, + "engines": { + "node": ">=18.12.0" + }, + "peerDependencies": { + "tailwindcss": "^3.4.0" + } + }, "node_modules/eslint-plugin-testing-library": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/eslint-plugin-testing-library/-/eslint-plugin-testing-library-7.1.1.tgz", diff --git a/package.json b/package.json index 13fcc6df..457a97ff 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@typescript-eslint/parser": "^8.21.0", "@vitejs/plugin-react": "^4.3.0", "autoprefixer": "^10.4.16", - "eslint": "^8.57.0", + "eslint": "^8.57.1", "eslint-config-prettier": "^10.0.1", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.31.0", @@ -62,6 +62,7 @@ "eslint-plugin-react": "^7.37.0", "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-refresh": "^0.4.3", + "eslint-plugin-tailwindcss": "^3.18.0", "eslint-plugin-testing-library": "^7.0.0", "license-checker": "^25.0.0", "prettier": "^3.4.1", diff --git a/packages/dito/app/components/Accordion.tsx b/packages/dito/app/components/Accordion.tsx index ca25692d..82e19cb3 100644 --- a/packages/dito/app/components/Accordion.tsx +++ b/packages/dito/app/components/Accordion.tsx @@ -4,7 +4,7 @@ export default function Accordion({ items, }: Readonly<{ items: AccordionItemProps[] }>) { return ( -
+
{items.map((item) => ( ) { return ( -
- -
+
+ +
{headline}
- - + +
-
+
{typeof content === "string" ? ( ) : ( diff --git a/packages/dito/app/components/FeedbackForm.tsx b/packages/dito/app/components/FeedbackForm.tsx index 76df515a..9a114974 100644 --- a/packages/dito/app/components/FeedbackForm.tsx +++ b/packages/dito/app/components/FeedbackForm.tsx @@ -141,7 +141,7 @@ function FeedbackQuestion({ ); })}
-
+
{feedbackForm.labels[0]} {feedbackForm.labels[4]}
@@ -186,7 +186,7 @@ export default function FeedbackForm() { if (submitted) { return (
- +

Vielen Dank für Ihr Feedback!


@@ -201,7 +201,7 @@ export default function FeedbackForm() { } return ( - +

{feedbackForm.heading}

@@ -216,7 +216,7 @@ export default function FeedbackForm() { /> diff --git a/packages/dito/app/components/InterviewBanner.tsx b/packages/dito/app/components/InterviewBanner.tsx index ffccc723..6c334445 100644 --- a/packages/dito/app/components/InterviewBanner.tsx +++ b/packages/dito/app/components/InterviewBanner.tsx @@ -5,7 +5,7 @@ import { interviewBanner } from "resources/content"; export default function InterviewBanner() { return ( diff --git a/packages/dito/app/components/LinkBar.tsx b/packages/dito/app/components/LinkBar.tsx index 3b64b537..6cb5b527 100644 --- a/packages/dito/app/components/LinkBar.tsx +++ b/packages/dito/app/components/LinkBar.tsx @@ -12,7 +12,7 @@ const LinkBar = ({ ); return ( -
+
{elements.map((element, index) => ( -
+

{paragraph.Titel}

-
+
{groupedAbsaetze.map((absatzGroup) => ( +
-
+
-
+
{visualisierung.Titel} diff --git a/packages/dito/app/root.tsx b/packages/dito/app/root.tsx index 01c63d8f..90bbc8ee 100644 --- a/packages/dito/app/root.tsx +++ b/packages/dito/app/root.tsx @@ -217,7 +217,7 @@ const PageHeader = ({ includeBreadcrumbs?: boolean; }) => (
-
+
Logo des Bundes @@ -231,7 +231,7 @@ const PageHeader = ({ | {header.contact.msg}
- + - + {children}