From 05894c2b0ae435bb51a3f36186d054c068068b8d Mon Sep 17 00:00:00 2001 From: Cliff Hill Date: Tue, 30 Sep 2025 15:44:12 -0400 Subject: [PATCH] Trying to make sure eslint works right for pre-commit. Signed-off-by: Cliff Hill --- frontend/lint-staged.js | 16 +++++++++++++--- noxfile.py | 6 ------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/frontend/lint-staged.js b/frontend/lint-staged.js index 491fc1de..824d4423 100644 --- a/frontend/lint-staged.js +++ b/frontend/lint-staged.js @@ -1,8 +1,18 @@ // lint-staged.js const { execSync } = require("child_process"); -const files = process.argv - .slice(2) - .filter((f) => /^src\/.*\.(js|jsx|ts|tsx)$/.test(f)); +const allFilesMode = process.argv.includes("--all-files"); +let files; + +if (allFilesMode) { + // Lint all frontend files + files = ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]; +} else { + // Only lint staged files + files = process.argv + .slice(2) + .filter((f) => /^src\/.*\.(js|jsx|ts|tsx)$/.test(f)); +} + if (files.length) { execSync(`yarn eslint ${files.join(" ")}`, { stdio: "inherit" }); } diff --git a/noxfile.py b/noxfile.py index 86a243eb..cbdc158d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -3,12 +3,9 @@ Run with `nox -s ` from the project root. """ -import os - import nox from nox_poetry import Session - python_versions = ["3.13"] @@ -40,9 +37,6 @@ def precommit(session: Session) -> None: "pyupgrade", ) session.run("pre-commit", *args) - # Run frontend lint using yarn lint - os.chdir("frontend") - session.run("yarn", "lint", external=True) backend_sessions = [