From 3609fc9c92542a457f514d403335ce15cda619b3 Mon Sep 17 00:00:00 2001 From: Jason Stirnaman Date: Mon, 9 Jun 2025 17:07:09 -0500 Subject: [PATCH] chore(ci): Fail the commit if a module imports or uses debug helpers --- assets/js/code-controls.js | 1 - lefthook.yml | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/assets/js/code-controls.js b/assets/js/code-controls.js index daaa1184b..17018a8e8 100644 --- a/assets/js/code-controls.js +++ b/assets/js/code-controls.js @@ -1,5 +1,4 @@ import $ from 'jquery'; -import { debugBreak } from './utils/debug-helpers.js'; function initialize() { var codeBlockSelector = '.article--content pre'; diff --git a/lefthook.yml b/lefthook.yml index a3f2ae759..f405bf84a 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -5,6 +5,10 @@ pre-commit: parallel: true commands: + eslint-debug-check: + glob: "assets/js/*.js" + run: yarn eslint {staged_files} + fail_text: "Debug helpers found! Remove debug imports and calls before committing." build-copilot-instructions: glob: "CONTRIBUTING.md" run: yarn build:copilot-instructions @@ -58,6 +62,10 @@ pre-commit: { echo "⚠️ Prettier found formatting issues. Automatic formatting applied." git add {staged_files} } + lint-js: + glob: "assets/js/*.{js,ts}" + run: yarn eslint {staged_files} + fail_text: "JavaScript linting failed. Fix errors before committing." pre-push: commands: packages-audit: