Trying to make sure eslint works right for pre-commit.

Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
2025-09-30 15:44:12 -04:00
parent 6fecd8b879
commit 05894c2b0a
2 changed files with 13 additions and 9 deletions

View File

@@ -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" });
}

View File

@@ -3,12 +3,9 @@
Run with `nox -s <session>` 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 = [