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..59d50f1 100644 --- a/.eslintrc +++ b/.eslintrc @@ -9,12 +9,20 @@ }, "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..9a7f2f9 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,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 ( <>