From e94ed03896f13f92de8463fc79aa417622109357 Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Thu, 24 Oct 2024 15:14:30 -0700 Subject: [PATCH 1/2] Update Github actions to use Biome for formatting / linting --- .github/dependabot.yml | 3 +-- .github/workflows/node-ci.yml | 14 +++++++------- package.json | 5 ++--- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2be174af9d..36d725d48a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,5 +8,4 @@ updates: schedule: interval: "daily" allow: - - dependency-name: "@khanacademy/eslint-config" - - dependency-name: "@khanacademy/eslint-plugin" + - dependency-name: "@biomejs/biome" diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 6a201c607f..fb486f91ae 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -80,7 +80,7 @@ jobs: - name: Check formatting run: | - yarn -s prettier --check . + yarn -s biome --check . - id: js-files name: Find .js(x)/.ts(x) changed files @@ -90,19 +90,19 @@ jobs: extensions: ".js,.jsx,.ts,.tsx" files: "yarn.lock" - - id: eslint-reset + - id: biome-reset uses: Khan/actions@filter-files-v1 - name: Files that would trigger a full eslint run + name: Files that would trigger a full Biome run with: changed-files: ${{ steps.changed.outputs.files }} - files: ".eslintrc.js,package.json,yarn.lock,.eslintignore" + files: "biome.jsonc,package.json,yarn.lock" # Linting / type checking - - name: Eslint + - name: Biome uses: Khan/actions@full-or-limited-v0 with: - full-trigger: ${{ steps.eslint-reset.outputs.filtered }} - full: yarn lint packages + full-trigger: ${{ steps.biome-reset.outputs.filtered }} + full: yarn biome check . limited-trigger: ${{ steps.js-files.outputs.filtered }} limited: yarn lint {} diff --git a/package.json b/package.json index dd74da4bc2..131bfe839f 100644 --- a/package.json +++ b/package.json @@ -133,8 +133,7 @@ "clean": "./utils/clean.sh", "coverage": "./utils/test-with-coverage.sh", "dev": "yarn --cwd dev dev", - "lint": "eslint . --ext .js --ext .jsx --ext .ts --ext .tsx", - "lint:timing": "cross-env TIMING=1 yarn lint", + "lint": "biome check", "publish:ci": "utils/pre-publish-check-ci.ts && git diff --stat --exit-code HEAD && yarn build && yarn build:types && changeset publish", "sloc": "sloc packages --exclude node_modules", "test": "jest", @@ -143,7 +142,7 @@ "build-storybook": "storybook build", "cypress": "cypress open --component", "cypress:ci": "cross-env cypress run --component", - "format": "prettier --write .", + "format": "biome format --write .", "typecheck": "tsc", "knip": "knip --config knip.config.ts" }, From 4006479f3eeb604bea3c16763a5d37c5eeb31239 Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Thu, 24 Oct 2024 15:36:24 -0700 Subject: [PATCH 2/2] Fix 'Check formatting' in lint action --- .github/workflows/node-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index fb486f91ae..38eca3698a 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -80,7 +80,7 @@ jobs: - name: Check formatting run: | - yarn -s biome --check . + yarn -s biome check - id: js-files name: Find .js(x)/.ts(x) changed files