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
This commit is contained in:
Daniel Imms
2025-09-18 13:27:12 -07:00
parent a191370d54
commit 398e87490d
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -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`:
+1
View File
@@ -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",