From 398e87490d78970dbf434f660d91865d39f27c82 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 18 Sep 2025 13:27:12 -0700 Subject: [PATCH] Add coding guidelines and lint-fix script - Add coding guidelines section to copilot instructions - Specify rule about avoiding comments in unit tests - Add lint-fix npm script for auto-fixing ESLint issues --- .github/copilot-instructions.md | 4 ++++ package.json | 1 + 2 files changed, 5 insertions(+) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 99c70f1f..26de82b9 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -7,6 +7,10 @@ Please follow these guidelines when contributing: - Install dependencies: `npm install && npm run setup` - Build and bundle demo: `npm run build && npm run esbuild` +## Coding guidelines + +- Do not write comments in unit tests unless the test is particularly complex. When they are complex, add the descriptions into the assertion calls where possible. + ## Unit tests Unit tests are run with `yarn test-unit`: diff --git a/package.json b/package.json index 003d3ff0..8e006373 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "test": "npm run test-unit", "posttest": "npm run lint", "lint": "eslint -c .eslintrc.json --max-warnings 0 --ext .ts src/ addons/", + "lint-fix": "eslint -c .eslintrc.json --fix --ext .ts src/ addons/", "lint-api": "eslint --no-eslintrc -c .eslintrc.json.typings --max-warnings 0 --no-ignore --ext .d.ts typings/", "test-unit": "node ./bin/test_unit.js", "test-unit-coverage": "node ./bin/test_unit.js --coverage",