@@ -60,11 +60,15 @@ possible.
6060- Use ` pnpm ` for package management
6161- ** IMPORTANT** : NEVER EVER use ` npx ` without permission!
6262- Use ` pnpm vitest run $FILE_TO_TEST ` to run tests
63+ - Use ` pnpm lint ` to run eslint and prettier in parallel
64+ - Use ` pnpm lint:fix ` to ask eslint and prettier to auto-fix issues
6365- Run ` pnpm build ` to ensure that the code compiles correctly
66+ - Run ` pnpm rolod0x ` to test the CLI
6467- Run ` pnpm link --global ` to install CLI scripts globally
6568
6669### Code Quality
6770
71+ - Honour settings in ` .editorconfig `
6872- ESLint for code linting
6973- Prettier for code formatting
7074- Commitlint for conventional commit messages, with appropriate commit types:
@@ -87,13 +91,25 @@ possible.
8791### General best practices
8892
8993- Avoid code duplication as much as possible
94+ - Keep code files under 300 lines
95+ - One class per file
96+ - .ts files should use kebab-case.ts not camelCase.ts or another style
97+ - .tsx files should use CamelCase.tsx, except for ` index.tsx `
9098- Follow TypeScript best practices
9199- Use proper type annotations
92100- Document complex logic
93101- Follow the principle of least privilege for extension permissions
94102
95103### Testing best practices
96104
105+ ** IMPORTANT** : These are all non-negotiable best practices!
106+
107+ - ** Test runs must be 100% clean** with no stderr output. Always
108+ mock console.error, console.warn, or any logging that would appear in test
109+ output, and verify the expected messages in assertions instead.
110+ - ** NEVER EVER** copy code to be tested from the source files
111+ into the test files!! The test suite should ONLY ever test code which
112+ exists in the main implementation source files.
97113- Write tests for new features and ensure they pass
98114- Use React Testing Library for component tests
99115- Test behavior, not implementation
0 commit comments