diff --git a/.eslintrc.js b/.eslintrc.js index bf32149f..75b50972 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,5 @@ module.exports = { + root: true, env: { browser: true, es2021: true, @@ -9,20 +10,23 @@ module.exports = { "plugin:react/recommended", "plugin:react-hooks/recommended", "plugin:@next/next/recommended", + "plugin:tailwindcss/recommended", + "plugin:@typescript-eslint/recommended", "next", "prettier", ], + plugins: ["tailwindcss", "@typescript-eslint"], parserOptions: { ecmaVersion: "latest", sourceType: "module", }, ignorePatterns: ["postcss.config.js"], rules: { - "no-redeclare": "off", "@next/next/no-html-link-for-pages": "off", - "no-undef": "off", - "react/jsx-no-undef": "off", - "no-unused-vars": [ + "tailwindcss/no-custom-classname": "off", + "tailwindcss/migration-from-tailwind-2": "off", + + "@typescript-eslint/no-unused-vars": [ "error", { varsIgnorePattern: "^_", @@ -30,4 +34,10 @@ module.exports = { }, ], }, + overrides: [ + { + files: ["*.ts", "*.tsx"], + parser: "@typescript-eslint/parser", + }, + ], }; diff --git a/.prettierrc b/.prettierrc index 0967ef42..b4bfed35 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1 +1,3 @@ -{} +{ + "plugins": ["prettier-plugin-tailwindcss"] +} diff --git a/Makefile b/Makefile index 78c0da13..4c7bf5b8 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,10 @@ MAKEFLAGS += --always-make format: - yarn prettier . --write && yarn exec 'eslint .' + yarn prettier . --write + +lint: + yarn eslint . prisma: cd packages/db; \ diff --git a/package.json b/package.json index 8df8a09d..3a17a8f7 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,10 @@ "es-errors": "^1.3.0", "eslint": "^8.56.0", "eslint-config-next": "14.1.0", + "eslint-plugin-tailwindcss": "^3.14.2", + "install": "^0.13.0", "prettier": "3.2.5", + "prettier-plugin-tailwindcss": "^0.5.11", "typescript": "^5" }, "packageManager": "yarn@4.1.0" diff --git a/packages/web/app/api/v1/bookmarks/route.ts b/packages/web/app/api/v1/bookmarks/route.ts index b9305ca8..a78535cc 100644 --- a/packages/web/app/api/v1/bookmarks/route.ts +++ b/packages/web/app/api/v1/bookmarks/route.ts @@ -29,7 +29,7 @@ export async function POST(request: NextRequest) { const bookmark = await bookmarkLink(linkRequest.data.url, session.user.id); - let response: ZBookmark = { ...bookmark }; + const response: ZBookmark = { ...bookmark }; return NextResponse.json(response, { status: 201 }); } @@ -42,6 +42,6 @@ export async function GET() { const bookmarks = await getBookmarks(session.user.id); - let response: ZGetBookmarksResponse = { bookmarks }; + const response: ZGetBookmarksResponse = { bookmarks }; return NextResponse.json(response); } diff --git a/packages/web/app/dashboard/bookmarks/components/AddLink.tsx b/packages/web/app/dashboard/bookmarks/components/AddLink.tsx index fb77786c..f99c1655 100644 --- a/packages/web/app/dashboard/bookmarks/components/AddLink.tsx +++ b/packages/web/app/dashboard/bookmarks/components/AddLink.tsx @@ -43,7 +43,7 @@ export default function AddLink() { return (