diff --git a/.env b/.env.local.example similarity index 57% rename from .env rename to .env.local.example index 2fc88aa..65e08d6 100644 --- a/.env +++ b/.env.local.example @@ -1,7 +1,3 @@ -NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in -NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up -NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/ -NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/ NEXT_PUBLIC_GRAPHQL_ENDPOINT='https://api.jsconf.dev/graphql' NEXT_PUBLIC_TOKEN_STORAGE_KEY='HS:token_storage_key' NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY='pk_test_ZnVua3ktZ3JpZmZvbi04NC5jbGVyay5hY2NvdW50cy5kZXYk' diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..5a7019d --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +# # GQL / code-generation +src/api/gql/**/* +src/**/*.generated.* diff --git a/.eslintrc b/.eslintrc index c3377a4..0b77c75 100644 --- a/.eslintrc +++ b/.eslintrc @@ -2,19 +2,46 @@ "root": true, "overrides": [ { - "files": ["*.ts", "*.tsx", "*.js"], + "files": ["*.js", "*.jsx"], + "extends": [ + "eslint:recommended", + "plugin:react/recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + "plugin:tailwindcss/recommended", + "plugin:@next/next/recommended" + ], + "settings": { + "react": { + "version": "detect" + } + }, + "rules": { + "react/react-in-jsx-scope": "off" + } + }, + { + "files": ["*.ts", "*.tsx"], "parser": "@typescript-eslint/parser", "parserOptions": { "project": "./tsconfig.json" }, "extends": [ "eslint:recommended", + "plugin:react/recommended", + "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended-requiring-type-checking", "plugin:tailwindcss/recommended", - "plugin:react/recommended", - "next/core-web-vitals", "plugin:@next/next/recommended" - ] + ], + "settings": { + "react": { + "version": "detect" + } + }, + "rules": { + "react/react-in-jsx-scope": "off" + } }, { "files": ["*.graphql", "*.gql"], diff --git a/.github/workflows/lint_and_typecheck.yml b/.github/workflows/lint_and_typecheck.yml new file mode 100644 index 0000000..d7c9a59 --- /dev/null +++ b/.github/workflows/lint_and_typecheck.yml @@ -0,0 +1,61 @@ +name: Lint and Typecheck + +on: + push: + branches: + - main + pull_request: + +jobs: + linting-and-typechecking: + runs-on: ubuntu-latest + name: Linting and Typechecking + + # Considerar Mover clone/setup/caches a un composite action 🙏 + steps: + - name: ⏳ Cloning repo + uses: actions/checkout@v3 + + - name: ⬢ Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: 📦 Download Cached Package Dependencies + uses: actions/cache@v3 + env: + cache-name: NPM + with: + path: ~/.npm + key: CACHE-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }} + + - name: 📦 Download Cached Eslint output + uses: actions/cache@v3 + env: + cache-name: ESLINT + with: + path: .eslintcache + key: CACHE-${{ env.cache-name }}-${{ hashFiles('.eslintcache') }} + + - name: 📦 Download Cached Typescript output + uses: actions/cache@v3 + env: + cache-name: TYPESCRIPT + with: + path: tsconfig.tsbuildinfo + key: CACHE-${{ env.cache-name }}-${{ hashFiles('tsconfig.tsbuildinfo') }} + + - name: 📥 Install dependencies + run: npm ci --prefer-offline --no-audit --legacy-peer-deps --cache ~/.npm + + - name: Run Prettier + run: npm run prettier:ci + + - name: Run Linter + run: npm run lint + + - name: Run Typecheck + run: npm run typecheck + + - name: Run Next Linter + run: npx next lint diff --git a/.gitignore b/.gitignore index 0d57ee3..14d2a3a 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,8 @@ npm-debug.log* yarn-debug.log* yarn-error.log* -# local env files +# env files +.env* .env*.local # vercel @@ -34,6 +35,9 @@ yarn-error.log* *.tsbuildinfo next-env.d.ts +# eslint +.eslintcache + # # GQL / code-generation # src/api/gql/**/* # src/**/*.generated.* diff --git a/.prettierrc b/.prettierrc index 9e26dfe..0967ef4 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1 +1 @@ -{} \ No newline at end of file +{} diff --git a/app/(transition)/(root)/layout.tsx b/app/(transition)/(root)/layout.tsx index adf60e3..6e99975 100644 --- a/app/(transition)/(root)/layout.tsx +++ b/app/(transition)/(root)/layout.tsx @@ -1,10 +1,7 @@ import PageTransition from "@/components/PageTransition"; import { Nav } from "@/components/nav"; -export default async function Template({ - children, -}: { - children: React.ReactNode; -}) { + +export default function Template({ children }: { children: React.ReactNode }) { return ( <>