From 3de248f635861b67613df3531c383b73f9e92c8a Mon Sep 17 00:00:00 2001 From: Erik Taubeneck Date: Fri, 28 Jun 2024 14:32:58 -0700 Subject: [PATCH 1/5] add tailwind linter update packages prettier .eslintrc have prettier check .json files --- .pre-commit-config.yaml | 2 +- server/.eslintrc.json | 2 +- server/package-lock.json | 27 ++++++++++++++++++++++----- server/package.json | 6 ++++-- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 39e4674..8c2a2ce 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: entry: npx --prefix server prettier --config=server/.prettierrc --ignore-path=server/.prettierignore --check server language: system files: ^server/ - types_or: [javascript, jsx, ts, tsx] + types_or: [javascript, jsx, ts, tsx, json] - id: jest-tests name: jest-tests entry: npm --prefix server run test diff --git a/server/.eslintrc.json b/server/.eslintrc.json index bffb357..aa05915 100644 --- a/server/.eslintrc.json +++ b/server/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "next/core-web-vitals" + "extends": ["next/core-web-vitals", "plugin:tailwindcss/recommended"] } diff --git a/server/package-lock.json b/server/package-lock.json index cd99c0c..908a5f5 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -39,12 +39,13 @@ "dotenv": "^16.4.5", "eslint": "^8", "eslint-config-next": "14.0.3", + "eslint-plugin-tailwindcss": "^3.17.4", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "next-test-api-route-handler": "^4.0.8", "postcss": "^8", "prettier": "3.3.1", - "tailwindcss": "^3.3.0", + "tailwindcss": "^3.4.4", "typescript": "^5" } }, @@ -5814,6 +5815,22 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-tailwindcss": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-tailwindcss/-/eslint-plugin-tailwindcss-3.17.4.tgz", + "integrity": "sha512-gJAEHmCq2XFfUP/+vwEfEJ9igrPeZFg+skeMtsxquSQdxba9XRk5bn0Bp9jxG1VV9/wwPKi1g3ZjItu6MIjhNg==", + "dev": true, + "dependencies": { + "fast-glob": "^3.2.5", + "postcss": "^8.4.4" + }, + "engines": { + "node": ">=18.12.0" + }, + "peerDependencies": { + "tailwindcss": "^3.4.0" + } + }, "node_modules/eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", @@ -10441,9 +10458,9 @@ "dev": true }, "node_modules/tailwindcss": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.5.tgz", - "integrity": "sha512-5SEZU4J7pxZgSkv7FP1zY8i2TIAOooNZ1e/OGtxIEv6GltpoiXUqWvLy89+a10qYTB1N5Ifkuw9lqQkN9sscvA==", + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.4.tgz", + "integrity": "sha512-ZoyXOdJjISB7/BcLTR6SEsLgKtDStYyYZVLsUtWChO4Ps20CBad7lfJKVDiejocV4ME1hLmyY0WJE3hSDcmQ2A==", "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", @@ -10453,7 +10470,7 @@ "fast-glob": "^3.3.0", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", - "jiti": "^1.19.1", + "jiti": "^1.21.0", "lilconfig": "^2.1.0", "micromatch": "^4.0.5", "normalize-path": "^3.0.0", diff --git a/server/package.json b/server/package.json index e7aaad0..60e74c1 100644 --- a/server/package.json +++ b/server/package.json @@ -6,7 +6,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint", + "lint": "next lint --max-warnings 0", + "lint:fix": "next lint --fix", "//": "run in band to avoid db overlap. not ideal but works for now", "test": "jest --runInBand" }, @@ -42,12 +43,13 @@ "dotenv": "^16.4.5", "eslint": "^8", "eslint-config-next": "14.0.3", + "eslint-plugin-tailwindcss": "^3.17.4", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "next-test-api-route-handler": "^4.0.8", "postcss": "^8", "prettier": "3.3.1", - "tailwindcss": "^3.3.0", + "tailwindcss": "^3.4.4", "typescript": "^5" } } From f602f2993f173c2a5e7f5f17cc8d9a96d88abfc8 Mon Sep 17 00:00:00 2001 From: Erik Taubeneck Date: Fri, 28 Jun 2024 14:33:36 -0700 Subject: [PATCH 2/5] add nextjs linter to precommit --- .pre-commit-config.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8c2a2ce..877f29c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,6 +25,13 @@ repos: language: system types: [python] pass_filenames: false + - id: npm-lint + name: npm-lint + entry: npm --prefix server run lint + language: system + files: ^server/ + types_or: [javascript, jsx, ts, tsx] + pass_filenames: false - id: npm-build name: npm-build entry: npm --prefix server run build From be06788c7b4a1041e2f13d2262eeccde74294c7f Mon Sep 17 00:00:00 2001 From: Erik Taubeneck Date: Fri, 28 Jun 2024 14:34:24 -0700 Subject: [PATCH 3/5] tailwind linter fixes --- server/app/alert.tsx | 8 ++--- server/app/footer.tsx | 8 ++--- server/app/header.tsx | 26 +++++++------- server/app/login/GitHubOAuthComponent.tsx | 2 +- server/app/login/page.tsx | 4 +-- server/app/page.tsx | 8 ++--- server/app/query/create/page.tsx | 44 +++++++++++------------ server/app/query/layout.tsx | 2 +- server/app/query/view/[id]/charts.tsx | 8 ++--- server/app/query/view/[id]/components.tsx | 12 +++---- server/app/query/view/[id]/page.tsx | 34 +++++++++--------- 11 files changed, 78 insertions(+), 78 deletions(-) diff --git a/server/app/alert.tsx b/server/app/alert.tsx index be49468..37434a5 100644 --- a/server/app/alert.tsx +++ b/server/app/alert.tsx @@ -5,9 +5,9 @@ export default function QueryStartedAlert({ queryId }: { queryId: string }) { return (
-
+
@@ -20,13 +20,13 @@ export default function QueryStartedAlert({ queryId }: { queryId: string }) {

-
+
diff --git a/server/app/footer.tsx b/server/app/footer.tsx index b713b0c..d672af1 100644 --- a/server/app/footer.tsx +++ b/server/app/footer.tsx @@ -1,19 +1,19 @@ export default function Example() { return ( -