lightsout/standards
For a package with no framework pack of its own: one shape at every level, written in one style.
- Rules
- 44
- Deterministic checks
- 32
- Agent checks
- 16
Classes2
Functions4
Named Constants2
Type Safety2
Duplication4
- dead-exportCode that nothing uses any more.DeterministicBlocks
- duplicate-function-bodyFunctions that are copies of each other under new names.DeterministicBlocks
- duplicate-code-blockThe same code written out in more than one place.DeterministicAdvises
- duplicate-export-nameExports in different places that share one name.DeterministicAdvises
Imports4
- import-path-aliasWhen imports use the package's path aliases.DeterministicAdvises
- index-filesWhich folders have an index file, and where an import points.DeterministicAdvises
- index-file-contentsWhat an index file may hold.DeterministicAdvises
- circular-dependenciesModules that depend on each other.DeterministicAdvises
Layout9
- multi-exportHow many things one file may export.DeterministicAdvises
- filename-mismatchHow a file's name follows what it exports.DeterministicAdvises
- module-file-to-folderWhen a module should stay one file, and when it should become a folder.DeterministicAdvises
- file-placementWhere a file belongs, from who uses it.DeterministicAgentAdvises
- common-folder-layoutWhat the inside of a common folder looks like.DeterministicAdvises
- banned-folder-nameFolder names that say nothing about what the folder holds.DeterministicAgentAdvises
- reuse-common-codeLook for existing shared code before writing new code.AgentAdvises
- case-collisionNames that differ only in upper and lower case.DeterministicBlocks
- shared-package-criteriaWhat belongs in the shared package.AgentAdvises
Size3
Test Style10
- existing-testsHow these rules apply to a repo's existing tests.AgentAdvises
- test-structureThe shape of a single test.AgentAdvises
- test-code-path-coverageWhich tests a unit needs.AgentAdvises
- test-jest-importsWhat a test file imports from Jest.AgentAdvises
- no-test-state-in-hooksWhere a test's state is built.DeterministicBlocks
- test-mock-prefixHow mocks are named.DeterministicBlocks
- test-mock-untypedTyping a mock function and the wrapper that forwards to it.DeterministicBlocks
- test-manual-mock-cleanupResetting mocks between tests.DeterministicAdvises
- assertions-pin-contractsWhat a test asserts against.AgentAdvises
- what-to-mockWhat to mock, and with which tool.AgentAdvises
Test Placement4
- test-beside-subjectWhere a unit test file sits, and what it is named.DeterministicAdvises
- test-support-in-srcWhere shared test helpers, mocks and fixtures live.DeterministicAdvises
- test-file-sizeWhen a test file is too long.DeterministicAdvises
- module-boundary-testingTesting a module through what it makes public.AgentAdvises