From 80370115760c74de7aed7991a763169440a91df5 Mon Sep 17 00:00:00 2001 From: Antoine Jaussoin Date: Thu, 17 Oct 2024 20:14:24 +0100 Subject: [PATCH] Lintint --- .github/workflows/ci.yml | 8 ++++---- backend/.eslintignore | 1 - backend/package.json | 3 ++- frontend/package.json | 1 + marketing/package.json | 3 ++- marketing/src/lib/getBlog.ts | 2 +- marketing/src/lib/getLegal.ts | 2 +- package.json | 2 +- 8 files changed, 12 insertions(+), 10 deletions(-) delete mode 100644 backend/.eslintignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cba5cf882..d13c7d7d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: 'Tests & Linting' +name: "Tests & Linting" on: push: @@ -19,7 +19,7 @@ jobs: node-version: 20 - run: yarn - run: yarn ci-test - - run: yarn lint + - run: yarn ci-lint - run: yarn build test-backend: runs-on: ubuntu-latest @@ -33,7 +33,7 @@ jobs: node-version: 20 - run: yarn - run: yarn ci-test - - run: yarn lint + - run: yarn ci-lint - run: yarn build test-marketing: runs-on: ubuntu-latest @@ -46,7 +46,7 @@ jobs: with: node-version: 20 - run: yarn - - run: yarn lint + - run: yarn ci-lint - run: yarn build test-docs: runs-on: ubuntu-latest diff --git a/backend/.eslintignore b/backend/.eslintignore deleted file mode 100644 index 4e67da549..000000000 --- a/backend/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -src/db/migrations \ No newline at end of file diff --git a/backend/package.json b/backend/package.json index c4d0e525d..ad190585d 100644 --- a/backend/package.json +++ b/backend/package.json @@ -14,8 +14,9 @@ "revert": "typeorm-ts-node-esm -d src/db/index.ts migration:revert", "lint": "biome lint", "test": "yarn jest", + "ci-lint": "biome ci", "ci-test": "CI=true yarn test", - "fix": "biome lint --write", + "fix": "biome check --write", "backend-production": "yarn migrate-production && cd ./dist/src && node --import ../instrument.mjs index.js", "migrate-production": "typeorm -d dist/src/db/index.js migration:run", "copy-templates": "copyfiles -u 0 src/**/*.html dist/" diff --git a/frontend/package.json b/frontend/package.json index 634533c57..b1bfbdedd 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -96,6 +96,7 @@ "build": "NODE_ENV=production tsc && vite build", "lint": "biome lint", "test": "vitest", + "ci-lint": "biome ci", "ci-test": "CI=true yarn test", "analyze": "source-map-explorer build/static/js/*", "watch": "tsc --watch --noEmit" diff --git a/marketing/package.json b/marketing/package.json index 087a5a827..41b2bfd24 100644 --- a/marketing/package.json +++ b/marketing/package.json @@ -6,7 +6,8 @@ "dev": "next dev -p 3001", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "ci-lint": "biome ci" }, "dependencies": { "@biomejs/biome": "1.9.4", diff --git a/marketing/src/lib/getBlog.ts b/marketing/src/lib/getBlog.ts index 218f85152..87c89d1b8 100644 --- a/marketing/src/lib/getBlog.ts +++ b/marketing/src/lib/getBlog.ts @@ -1,4 +1,4 @@ -import fs from 'fs'; +import fs from 'node:fs'; import { basename, join } from 'node:path'; import matter from 'gray-matter'; import { groupBy, sortBy, values } from 'lodash-es'; diff --git a/marketing/src/lib/getLegal.ts b/marketing/src/lib/getLegal.ts index 43a4748a9..3aef54cdc 100644 --- a/marketing/src/lib/getLegal.ts +++ b/marketing/src/lib/getLegal.ts @@ -1,4 +1,4 @@ -import fs from 'fs'; +import fs from 'node:fs'; import { join } from 'node:path'; import matter from 'gray-matter'; diff --git a/package.json b/package.json index 3fb691df6..44863ddf9 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "An agile retrospective board - Powering www.retrospected.com", "private": true, "scripts": { - "lint": "cd frontend && yarn lint && cd ../backend && yarn lint", + "lint": "yarn biome ci", "clean": "del ./{frontend,backend,common,maintenance}/yarn.lock && del ./yarn.lock && del ./{frontend,backend,common,maintenance}/node_modules && del ./node_modules", "frontend": "cd frontend && yarn start && cd ..", "backend": "cd backend && yarn start && cd ..",