From 4979c085f0878cad88843db1d838f4bfac2da211 Mon Sep 17 00:00:00 2001 From: thelooter Date: Wed, 27 Nov 2024 19:57:49 +0100 Subject: [PATCH] feat: add eslint --- .github/workflows/lint.yaml | 58 + components/NavBar.vue | 6 +- components/footer/Footer.vue | 2 +- components/footer/FooterCategory.vue | 2 +- components/highlight/HighlightCard.vue | 2 +- components/highlight/HighlightSection.vue | 11 +- components/team/ContributorsSection.vue | 33 +- components/team/TeamCard.vue | 22 +- eslint.config.js | 15 + layouts/default.vue | 8 +- nuxt.config.ts | 3 +- package.json | 20 +- pages/cookies.vue | 2 +- pages/index.vue | 28 +- pages/legal.vue | 2 +- pages/privacy.vue | 2 +- pages/team.vue | 25 +- pnpm-lock.yaml | 2593 ++++++++++++++++++++- 18 files changed, 2680 insertions(+), 154 deletions(-) create mode 100644 .github/workflows/lint.yaml create mode 100644 eslint.config.js diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..110622e --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,58 @@ +name: Lint + +permissions: read-all + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + permissions: + contents: read + packages: read + pull-requests: write + checks: write + strategy: + matrix: + node-version: + - "18" + - "20" + - "lts/*" + - "latest" + steps: + - uses: actions/checkout@v2 + + - name: Get PNPM version from package.json + id: pnpm-version + shell: bash + run: echo "pnpm_version=$(node -p "require('./package.json').engines.pnpm")" >> "$GITHUB_OUTPUT" + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: ${{ steps.pnpm-version.outputs.pnpm_version }} + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Gather lint results + run: pnpm run lint:report + continue-on-error: true + + - name: Upload lint results + uses: ataylorme/eslint-annotate-action@v3 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + report-json: "eslint_report.json" diff --git a/components/NavBar.vue b/components/NavBar.vue index 1870d55..5e08c4b 100644 --- a/components/NavBar.vue +++ b/components/NavBar.vue @@ -9,13 +9,13 @@