@hailstails/hone 2.0.0-pre.3 → 2.0.0-pre.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ADOPTING.md +9 -20
- package/CHANGELOG.md +104 -0
- package/MIGRATING.md +18 -9
- package/README.md +15 -17
- package/chunks/chunk-3CWFUD5B.js +38 -0
- package/chunks/chunk-4AJQHZ7I.js +191 -0
- package/chunks/chunk-5AKHEW6V.js +15 -0
- package/chunks/{chunk-L7BGRC6D.js → chunk-6LTJRJOE.js} +1 -1
- package/chunks/chunk-75XWZYNN.js +64 -0
- package/chunks/{chunk-ASUN4AVC.js → chunk-BISP2JOL.js} +73 -9
- package/chunks/chunk-COQMPHWZ.js +37 -0
- package/chunks/chunk-D6645WPB.js +6 -0
- package/chunks/chunk-DJMF6JIM.js +42 -0
- package/chunks/chunk-EBX57Z3V.js +8 -0
- package/chunks/chunk-EFUWHLZK.js +426 -0
- package/chunks/chunk-FHVNKG5Q.js +19 -0
- package/chunks/{chunk-NRIQD3PI.js → chunk-FRE5IA3C.js} +3 -5
- package/chunks/{chunk-OKLYWD2Z.js → chunk-GMLT3MHO.js} +262 -257
- package/chunks/{chunk-QP5TLOBY.js → chunk-HVZVKZPW.js} +12 -9
- package/chunks/chunk-LEFM7OPS.js +41 -0
- package/chunks/chunk-LNMDMRGQ.js +51 -0
- package/chunks/chunk-M4VSJ27S.js +139 -0
- package/chunks/{chunk-RGSHTPLA.js → chunk-MBEDAFVC.js} +3 -11
- package/chunks/chunk-ND3EOGDK.js +2350 -0
- package/chunks/chunk-ONDBACCR.js +14332 -0
- package/chunks/chunk-OO5KV7KN.js +17 -0
- package/chunks/chunk-SKDQ3QJD.js +75 -0
- package/chunks/chunk-U6W65ZOF.js +86 -0
- package/chunks/chunk-W5OIAUDW.js +18 -0
- package/chunks/{chunk-GNOMK7CR.js → chunk-WPEOCLTP.js} +495 -52
- package/chunks/chunk-X73RZUPO.js +63 -0
- package/chunks/chunk-XE2KKWYH.js +45 -0
- package/chunks/chunk-XNIXPQQ5.js +179 -0
- package/chunks/chunk-YONPKP3C.js +15 -0
- package/docs/adding-a-discipline-or-mechanism.md +1 -1
- package/docs/extending.md +7 -388
- package/methods/lenses/function-first.md +2 -2
- package/package.json +7 -6
- package/rules/README.md +7 -5
- package/rules/SPIRIT.md +1 -1
- package/rules/numbers.md +4 -4
- package/rules/principles/no-leak-across-a-boundary.md +1 -1
- package/rules/principles.md +1 -1
- package/rules/record-kinds/authorised-location.md +1 -1
- package/rules/records.md +11 -19
- package/rules/rules.md +5 -5
- package/rules/sources.md +6 -7
- package/rules/typescript/checks.md +280 -394
- package/rules/typescript/recipes/adapter-per-outside-party.md +10 -5
- package/rules/typescript/recipes/assert-to-narrow.md +114 -4
- package/rules/typescript/recipes/closure-factory.md +5 -5
- package/rules/typescript/recipes/companion-test-file.md +5 -3
- package/rules/typescript/recipes/composed-orchestrator.md +6 -4
- package/rules/typescript/recipes/composition-root.md +5 -3
- package/rules/typescript/recipes/{bounded-context-generic.md → constrained-context-generic.md} +6 -4
- package/rules/typescript/recipes/copy-never-write-in.md +6 -4
- package/rules/typescript/recipes/declared-not-bundled.md +5 -3
- package/rules/typescript/recipes/dependency-record.md +5 -3
- package/rules/typescript/recipes/domain-vocabulary-list.md +5 -3
- package/rules/typescript/recipes/entity-module.md +8 -5
- package/rules/typescript/recipes/exact-pins-and-a-lock-file.md +5 -3
- package/rules/typescript/recipes/extension-outside-the-vendored-code.md +5 -3
- package/rules/typescript/recipes/failure-asserted-as-a-value.md +44 -4
- package/rules/typescript/recipes/failure-mapping-at-the-adapter.md +8 -5
- package/rules/typescript/recipes/fix-the-declaration-not-the-value.md +5 -3
- package/rules/typescript/recipes/functional-iteration.md +8 -3
- package/rules/typescript/recipes/guard-clauses.md +5 -3
- package/rules/typescript/recipes/integration-test-owns-its-scratch.md +5 -3
- package/rules/typescript/recipes/integration-test-suffix.md +5 -3
- package/rules/typescript/recipes/it-each-over-typed-rows.md +117 -0
- package/rules/typescript/recipes/map-out-at-the-adapter.md +36 -4
- package/rules/typescript/recipes/meaning-in-names-not-comments.md +5 -5
- package/rules/typescript/recipes/named-exported-type.md +5 -3
- package/rules/typescript/recipes/narrow-ports.md +5 -3
- package/rules/typescript/recipes/one-argument-object.md +8 -3
- package/rules/typescript/recipes/{port-in-the-domain.md → port-in-a-module-of-its-own.md} +7 -5
- package/rules/typescript/recipes/ports-in-the-argument.md +5 -3
- package/rules/typescript/recipes/repo-scripts-only.md +5 -3
- package/rules/typescript/recipes/result-union.md +5 -5
- package/rules/typescript/recipes/screaming-folders.md +5 -5
- package/rules/typescript/recipes/shared-strict-base-config.md +5 -5
- package/rules/typescript/recipes/stub-with-vi-fn.md +130 -0
- package/rules/typescript/recipes/tagged-union-and-exhaustive-switch.md +5 -3
- package/rules/typescript/recipes/whole-words.md +5 -3
- package/rules/typescript/recipes/whole-written-out-expectation.md +284 -4
- package/rules/typescript/recipes/world-values-through-a-port.md +5 -3
- package/rules/typescript/recipes/zod-at-the-producers-adapter.md +8 -3
- package/rules/typescript/recipes.md +567 -21
- package/rules/typescript/symptoms/ambient-randomness/random-call.md +10 -0
- package/rules/typescript/symptoms/ambient-randomness.md +1 -1
- package/rules/typescript/symptoms/answer-set-in-a-hook/hook-answer.md +10 -0
- package/rules/typescript/symptoms/answer-set-in-a-hook.md +1 -1
- package/rules/typescript/symptoms/assertion-outside-a-test-body/assertion-site.md +10 -0
- package/rules/typescript/symptoms/assertion-outside-a-test-body.md +25 -0
- package/rules/typescript/symptoms/branch-in-a-test/test-body.md +10 -184
- package/rules/typescript/symptoms/branch-in-a-test.md +11 -1
- package/rules/typescript/symptoms/built-unit-called-in-place/call-of-a-call.md +10 -0
- package/rules/typescript/symptoms/built-unit-called-in-place.md +25 -0
- package/rules/typescript/symptoms/claimed-type/non-null-assertions.md +1 -1
- package/rules/typescript/symptoms/code-or-prose-read-as-text-in-a-test/raw-read.md +10 -0
- package/rules/typescript/symptoms/code-or-prose-read-as-text-in-a-test.md +31 -0
- package/rules/typescript/symptoms/computed-value-in-a-test/test-body.md +26 -117
- package/rules/typescript/symptoms/computed-value-in-a-test.md +1 -1
- package/rules/typescript/symptoms/date-used-directly.md +1 -1
- package/rules/typescript/symptoms/default-for-a-required-value.md +1 -1
- package/rules/typescript/symptoms/double-with-a-body/logic-in-a-passed-function.md +2 -19
- package/rules/typescript/symptoms/double-with-a-body/stub-implementation.md +2 -2
- package/rules/typescript/symptoms/double-with-a-body.md +1 -1
- package/rules/typescript/symptoms/export-from-a-test/test-file-export.md +10 -0
- package/rules/typescript/symptoms/export-from-a-test.md +33 -0
- package/rules/typescript/symptoms/failure-shaped-as-success/empty-catch.md +10 -0
- package/rules/typescript/symptoms/failure-shaped-as-success.md +1 -1
- package/rules/typescript/symptoms/floating-version/version-selector.md +10 -0
- package/rules/typescript/symptoms/inherited-environment-in-a-subprocess/git-spawn-environment.md +2 -2
- package/rules/typescript/symptoms/inner-layer-imports-outer.md +1 -1
- package/rules/typescript/symptoms/library-class-built-in-place.md +1 -1
- package/rules/typescript/symptoms/loop-keyword/loop-statement.md +1 -1
- package/rules/typescript/symptoms/many-spellings-of-one-concept/test-call-aliases.md +10 -0
- package/rules/typescript/symptoms/many-spellings-of-one-concept.md +3 -2
- package/rules/typescript/symptoms/module-or-global-patched/module-mock-call.md +4 -4
- package/rules/typescript/symptoms/no-lock-file/committed-lock-file.md +12 -0
- package/rules/typescript/symptoms/outside-import-past-a-boundary/import-or-require.md +1 -0
- package/rules/typescript/symptoms/outside-import-past-a-boundary.md +5 -4
- package/rules/typescript/symptoms/outside-type-in-a-signature.md +2 -2
- package/rules/typescript/symptoms/{port-outside-the-domain.md → port-beside-its-adapter.md} +2 -2
- package/rules/typescript/symptoms/port-named-for-a-mechanism.md +1 -1
- package/rules/typescript/symptoms/process-global-used-in-place/debugger-statement.md +10 -0
- package/rules/typescript/symptoms/process-global-used-in-place/direct-global-use.md +14 -0
- package/rules/typescript/symptoms/process-global-used-in-place.md +2 -2
- package/rules/typescript/symptoms/prose-in-code/comment-prose.md +12 -0
- package/rules/typescript/symptoms/rebinding/test-body.md +1 -18
- package/rules/typescript/symptoms/rebinding.md +11 -1
- package/rules/typescript/symptoms/schema-past-its-adapter.md +2 -2
- package/rules/typescript/symptoms/test-switched-off/skipped-tests.md +3 -6
- package/rules/typescript/symptoms/test-switched-off.md +1 -1
- package/rules/typescript/symptoms/text-past-its-reader/test-body.md +2 -17
- package/rules/typescript/symptoms/text-past-its-reader.md +1 -1
- package/rules/typescript/symptoms/throw-between-our-units/throw-statement.md +10 -0
- package/rules/typescript/symptoms/throw-or-catch-in-a-test/throw-statement.md +1 -1
- package/rules/typescript/symptoms/throw-or-catch-in-a-test/try-block.md +1 -25
- package/rules/typescript/symptoms/tool-fetched-at-run-time/fetch-command.md +10 -0
- package/rules/typescript/symptoms/type-declared-in-a-test/test-type-declaration.md +10 -0
- package/rules/typescript/symptoms/type-declared-in-a-test.md +33 -0
- package/rules/typescript/symptoms/unasserted-call.md +1 -1
- package/rules/typescript/symptoms/unit-without-a-running-test/companion-test-file.md +2 -2
- package/rules/typescript/symptoms/wide-input/unread-parameter.md +10 -0
- package/rules/typescript/symptoms/wide-input.md +3 -2
- package/rules/typescript/symptoms.md +210 -148
- package/src/application/conformance/conformance-testing-types.d.ts +13 -16
- package/src/domain/language-layer/authored-item-types.d.ts +66 -0
- package/src/domain/language-layer/catalogue-name.d.ts +5 -0
- package/src/domain/language-layer/check-address-text.d.ts +12 -0
- package/src/domain/rule-set/authored-rule-set-types.d.ts +31 -32
- package/src/domain/rule-set/clause-address-types.d.ts +4 -3
- package/src/domain/rule-set/rule-set-name-of.d.ts +10 -0
- package/src/domain/runner/check-binding.d.ts +18 -0
- package/src/domain/runner/check-observations.d.ts +39 -0
- package/src/domain/runner/conformance-types.d.ts +8 -2
- package/src/domain/runner/runner-result-types.d.ts +1 -2
- package/src/domain/settings/test-files.d.ts +7 -0
- package/src/eslint-plugin.js +45 -39
- package/src/hone.js +16 -13716
- package/src/infrastructure/disciplines-file/version-one-names.json +4 -5
- package/src/infrastructure/engines/eslint/authored-class-or-this/static-members-only/piece.json +0 -6
- package/src/infrastructure/engines/eslint/long-function/function-length/piece.json +0 -6
- package/src/infrastructure/engines/eslint/runner/pieces/eslint-piece-settings-types.d.ts +2 -0
- package/src/infrastructure/engines/eslint/runner/runner.js +1001 -1234
- package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/README.md +0 -3
- package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/eslint-plugin.js +33 -21
- package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/piece.json +11 -4
- package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/skipped-tests.examples.json +28 -0
- package/src/infrastructure/engines/eslint/untyped-value/implicit-any-let/piece.json +0 -2
- package/src/infrastructure/engines/eslint/wide-input/unread-parameter/eslint-plugin.js +94 -0
- package/src/infrastructure/engines/eslint/wide-input/unread-parameter/piece.json +11 -0
- package/src/infrastructure/engines/eslint/wide-input/unread-parameter/unread-parameter.examples.json +48 -0
- package/src/infrastructure/engines/walker/ambient-randomness/random-call/ambient-randomness.js +109 -0
- package/src/infrastructure/engines/walker/ambient-randomness/random-call/piece.json +9 -0
- package/src/infrastructure/engines/walker/ambient-randomness/random-call/random-call.examples.json +48 -0
- package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/hook-answer.examples.json +42 -0
- package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/hook-answers.js +72 -0
- package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/piece.json +9 -0
- package/src/infrastructure/engines/walker/assertion-outside-a-test-body/assertion-site/assertion-site.examples.json +30 -0
- package/src/infrastructure/engines/walker/assertion-outside-a-test-body/assertion-site/assertion-site.js +123 -0
- package/src/infrastructure/engines/walker/assertion-outside-a-test-body/assertion-site/piece.json +9 -0
- package/src/infrastructure/engines/walker/authored-class-or-this/class-keyword/class-syntax.js +3 -3
- package/src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation/boolean-signatures.js +7 -5
- package/src/infrastructure/engines/walker/branch-in-a-test/test-body/test-body-logic.js +192 -147
- package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/call-of-a-call.examples.json +24 -0
- package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/call-of-a-call.js +34 -0
- package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/piece.json +9 -0
- package/src/infrastructure/engines/walker/claimed-type/cast-to-any/any-cast.js +6 -4
- package/src/infrastructure/engines/walker/claimed-type/unlisted-cast-site/cast-expressions.js +6 -4
- package/src/infrastructure/engines/walker/code-or-prose-read-as-text-in-a-test/raw-read/piece.json +9 -0
- package/src/infrastructure/engines/walker/code-or-prose-read-as-text-in-a-test/raw-read/raw-read.examples.json +30 -0
- package/src/infrastructure/engines/walker/code-or-prose-read-as-text-in-a-test/raw-read/raw-read.js +166 -0
- package/src/infrastructure/engines/walker/computed-value-in-a-test/test-body/piece.json +0 -10
- package/src/infrastructure/engines/walker/date-used-directly/clock-sources/clock-sources.js +4 -4
- package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/switch-defaults.js +8 -6
- package/src/infrastructure/engines/walker/double-with-a-body/logic-in-a-passed-function/piece.json +0 -10
- package/src/infrastructure/engines/walker/double-with-a-body/stub-implementation/dependency-isolation.js +9 -14
- package/src/infrastructure/engines/walker/drawer-path/drawer-names/categorical-paths.js +4 -4
- package/src/infrastructure/engines/walker/export-from-a-test/test-file-export/piece.json +9 -0
- package/src/infrastructure/engines/walker/export-from-a-test/test-file-export/test-file-export.examples.json +30 -0
- package/src/infrastructure/engines/walker/export-from-a-test/test-file-export/test-file-export.js +31 -0
- package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/empty-catch.examples.json +18 -0
- package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/empty-catch.js +32 -0
- package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/piece.json +9 -0
- package/src/infrastructure/engines/walker/floating-version/version-selector/piece.json +9 -0
- package/src/infrastructure/engines/walker/floating-version/version-selector/version-selector.examples.json +54 -0
- package/src/infrastructure/engines/walker/floating-version/version-selector/version-selector.js +75 -0
- package/src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment/hermetic-git-spawns.js +8 -17
- package/src/infrastructure/engines/walker/loop-keyword/loop-statement/loops.js +8 -6
- package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/piece.json +9 -0
- package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/test-call-aliases.examples.json +36 -0
- package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/test-call-aliases.js +67 -0
- package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/module-mock-call.examples.json +34 -0
- package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/module-mocking.js +64 -16
- package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/piece.json +5 -1
- package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/committed-lock-file.examples.json +24 -0
- package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/committed-lock-file.js +41 -0
- package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/piece.json +9 -0
- package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/import-boundaries.js +18 -16
- package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/piece.json +1 -1
- package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/debugger-statement.examples.json +18 -0
- package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/debugger-statement.js +17 -0
- package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/piece.json +9 -0
- package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/direct-global-use.examples.json +63 -0
- package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/piece.json +13 -0
- package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/process-global-used-in-place.js +126 -0
- package/src/infrastructure/engines/walker/prose-in-code/comment-prose/comment-prose.examples.json +42 -0
- package/src/infrastructure/engines/walker/prose-in-code/comment-prose/piece.json +16 -0
- package/src/infrastructure/engines/walker/prose-in-code/comment-prose/prose-in-code.js +90 -0
- package/src/infrastructure/engines/walker/rebinding/test-body/piece.json +0 -10
- package/src/infrastructure/engines/walker/runner/pieces/walker-piece.d.ts +7 -5
- package/src/infrastructure/engines/walker/runner/runner.js +268 -79
- package/src/infrastructure/engines/walker/runner/toolchain/typescript-parse.d.ts +3 -0
- package/src/infrastructure/engines/walker/shorthand-name/identifier-names/identifier-names.js +12 -7
- package/src/infrastructure/engines/walker/strictness-weakened/exact-optional-property-types/piece.json +0 -10
- package/src/infrastructure/engines/walker/strictness-weakened/no-fallthrough-cases-in-switch/piece.json +0 -10
- package/src/infrastructure/engines/walker/strictness-weakened/no-implicit-override/piece.json +0 -10
- package/src/infrastructure/engines/walker/strictness-weakened/no-property-access-from-index-signature/piece.json +0 -10
- package/src/infrastructure/engines/walker/strictness-weakened/no-unchecked-indexed-access/piece.json +0 -10
- package/src/infrastructure/engines/walker/strictness-weakened/strict/compiler-overrides.js +30 -52
- package/src/infrastructure/engines/walker/strictness-weakened/use-unknown-in-catch-variables/piece.json +0 -10
- package/src/infrastructure/engines/walker/text-past-its-reader/test-body/piece.json +0 -10
- package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/piece.json +9 -0
- package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/throw-statement.examples.json +36 -0
- package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/throws-in-production.js +12 -0
- package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/throw-statement.examples.json +6 -6
- package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/throws-in-tests.js +5 -44
- package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/try-block/piece.json +0 -10
- package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/fetch-command.examples.json +42 -0
- package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/fetch-command.js +152 -0
- package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/piece.json +9 -0
- package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/piece.json +9 -0
- package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.examples.json +36 -0
- package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.js +141 -0
- package/src/infrastructure/engines/walker/type-derived-from-code/factory-return-types/factory-return-types.js +8 -6
- package/src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file/export-test-sibling.js +16 -10
- package/src/infrastructure/engines/walker/untracked-escape/directive-pointers/comments-directives.js +18 -64
- package/src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation/parameter-mutation.js +7 -5
- package/src/measure-engines.process.js +80 -0
- package/src/rule-set.d.ts +2 -1
- package/src/testing.d.ts +2 -4
- package/src/testing.js +173 -314
- package/src/{audit.d.ts → walker.d.ts} +13 -8
- package/src/walker.js +28 -0
- package/chunks/chunk-5HRMJ4O2.js +0 -608
- package/chunks/chunk-IX2VZTBO.js +0 -887
- package/chunks/chunk-K2W3D3NB.js +0 -17
- package/chunks/chunk-M6SOGWT7.js +0 -82
- package/chunks/chunk-Q62Y25WS.js +0 -843
- package/chunks/chunk-R75QELTA.js +0 -481
- package/chunks/chunk-RANAKCTW.js +0 -31
- package/chunks/chunk-TNY2PASL.js +0 -38
- package/chunks/chunk-UJONWHA4.js +0 -22
- package/docs/output-contract.md +0 -1155
- package/rules/record-kinds/boundary-record.md +0 -9
- package/rules/typescript/recipes/iteach-over-typed-rows.md +0 -18
- package/rules/typescript/recipes/stub-with-vifn.md +0 -20
- package/src/audit.js +0 -18
- package/src/domain/runner/runner-module-types.d.ts +0 -15
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
```json
|
|
4
4
|
{
|
|
5
5
|
"misses": "hand-written doubles.",
|
|
6
|
-
"settingsTracedTo": "test
|
|
6
|
+
"settingsTracedTo": "test files are what `testFiles` declares: the adopter's convention."
|
|
7
7
|
}
|
|
8
8
|
```
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
## Flags
|
|
13
13
|
|
|
14
|
-
- Test files only:
|
|
14
|
+
- Test files only: the `.ts` and `.tsx` files `testFiles` names. Generated folders such as `node_modules`, `dist`, `build` and `coverage` are skipped.
|
|
15
15
|
- A `vi.fn(...)` call with any argument, and any call to a method named `mockImplementation` (on any receiver, with or without arguments).
|
|
16
16
|
- Allowed: `vi.fn()`, `.mockReturnValue(...)`, `.mockResolvedValue(...)`, `.mockReturnValueOnce(...)` and `.mockImplementationOnce(...)`.
|
|
17
17
|
- `.mockImplementationOnce(...)` is not flagged even though it takes an implementation; whether that implementation gives the double behaviour is left to review.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# test-file-export
|
|
2
|
+
|
|
3
|
+
```json
|
|
4
|
+
{
|
|
5
|
+
"misses": "An ordinary source file imported exclusively by tests.",
|
|
6
|
+
"settingsTracedTo": "None."
|
|
7
|
+
}
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
A test file exports a value or type that other files can import. Keep the companion test self-contained and put reusable production code in the module that owns it.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Export from a test
|
|
2
|
+
|
|
3
|
+
```json
|
|
4
|
+
{
|
|
5
|
+
"group": "Tests",
|
|
6
|
+
"seen": "An export declaration, assignment or modifier in a test file, including a type export.",
|
|
7
|
+
"mayIndicate": [
|
|
8
|
+
{
|
|
9
|
+
"case": "states-what-the-unit-gives-back-for-one-case-or-several",
|
|
10
|
+
"points": [
|
|
11
|
+
{
|
|
12
|
+
"rule": "straight-through-tests"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"case": "gives-each-unit-its-test",
|
|
18
|
+
"points": [
|
|
19
|
+
{
|
|
20
|
+
"rule": "tested-where-its-owned"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"breachUsuallySits": "in a test file that exposes code for another file to use",
|
|
26
|
+
"seenBy": [
|
|
27
|
+
"syntax"
|
|
28
|
+
],
|
|
29
|
+
"reports": "seen",
|
|
30
|
+
"recipes": [],
|
|
31
|
+
"correctUses": []
|
|
32
|
+
}
|
|
33
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# empty-catch
|
|
2
|
+
|
|
3
|
+
```json
|
|
4
|
+
{
|
|
5
|
+
"misses": "A handler that returns a success-shaped default or whose body cannot be seen at the call site.",
|
|
6
|
+
"settingsTracedTo": "None."
|
|
7
|
+
}
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
An empty catch block or promise rejection handler drops the failure so callers can continue as if the operation succeeded. Return a failure value or leave handling to the boundary that can act on it.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# version-selector
|
|
2
|
+
|
|
3
|
+
```json
|
|
4
|
+
{
|
|
5
|
+
"misses": "Versions provided through workflow matrix expressions.",
|
|
6
|
+
"settingsTracedTo": "None."
|
|
7
|
+
}
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Floating versions the repository runs, including development dependencies, private package dependencies, package managers, and workflow tools. Published dependency and peer ranges can express compatibility.
|
package/rules/typescript/symptoms/inherited-environment-in-a-subprocess/git-spawn-environment.md
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
}
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
A git spawn in a test
|
|
10
|
+
A git spawn in a test whose `env` is inherited.
|
|
11
11
|
|
|
12
12
|
## Flags
|
|
13
13
|
|
|
14
|
-
- Test files:
|
|
14
|
+
- Test files: the `.ts`, `.tsx`, `.mjs` and `.js` files `testFiles` names. Generated folders (`node_modules`, `dist`, `build`, `coverage`, `.git`, root `vendor`) are skipped; any other folder can be left out with `exclude` in disciplines.json.
|
|
15
15
|
- A line calling `spawnSync`, `spawn`, `execFileSync`, `execFile`, `execSync`, `exec`, `execa` or `execaSync` with `"git"` (or `'git'`, or a template literal) as the first argument.
|
|
16
16
|
- Allowed when, within that line and the next seven, an `env:` names `hermeticGitEnvironment`, `withoutInheritedGitBindings` or `environment`, and no nearby `env:` uses `process.env`. The environment comes from a unit of ours with its own test, not a test helper.
|
|
17
17
|
- Not detected: a command string such as `execSync("git status")`, a split call, or a non-literal command. Whether the spawn is warranted at all is left to review.
|
|
@@ -31,4 +31,4 @@ const totals = orders.map((order) => order.total);
|
|
|
31
31
|
```
|
|
32
32
|
Replace a counted loop with `Array.from({ length }, (_, position) => ...)`.
|
|
33
33
|
|
|
34
|
-
In a test file, the [computed-value-in-a-test check](../computed-value-in-a-test/test-body.md) flags `map` at either edition, and its edition 2 flags `Array.from`:
|
|
34
|
+
In a test file, the [computed-value-in-a-test check](../computed-value-in-a-test/test-body.md) flags `map` at either edition, and its edition 2 flags `Array.from`: read [Computed value in a test](../computed-value-in-a-test.md) there.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# test-call-aliases
|
|
2
|
+
|
|
3
|
+
```json
|
|
4
|
+
{
|
|
5
|
+
"misses": "Calls through a different local alias or a Vitest namespace import.",
|
|
6
|
+
"settingsTracedTo": "None."
|
|
7
|
+
}
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
In a test file, a call rooted at `test` or `suite` refers to Vitest or has no local binding. Use `it` and `describe` so tests use the same names. Local bindings with other meanings pass.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
```json
|
|
4
4
|
{
|
|
5
5
|
"group": "Names, prose and files",
|
|
6
|
-
"seen": "One
|
|
6
|
+
"seen": "One concept named two or more ways across the code or the wire.",
|
|
7
7
|
"mayIndicate": [
|
|
8
8
|
{
|
|
9
9
|
"case": "names-something",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
],
|
|
18
18
|
"breachUsuallySits": "in the vocabulary",
|
|
19
19
|
"seenBy": [
|
|
20
|
-
"person"
|
|
20
|
+
"person",
|
|
21
|
+
"syntax"
|
|
21
22
|
],
|
|
22
23
|
"reports": "seen",
|
|
23
24
|
"recipes": [
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
```json
|
|
4
4
|
{
|
|
5
|
-
"misses": "
|
|
6
|
-
"settingsTracedTo": "test
|
|
5
|
+
"misses": "Both editions miss aliased receivers and module mocks such as vi.doMock or vi[\"mock\"]. Edition 1 leaves global patches to review. Edition 2 still misses indirect writes and global vi.spyOn calls.",
|
|
6
|
+
"settingsTracedTo": "test files are what `testFiles` declares: the adopter's convention."
|
|
7
7
|
}
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
Calls to `vi.mock`.
|
|
10
|
+
Calls to `vi.mock`. Edition 2 also flags `vi.stubGlobal`, `vi.stubEnv` and direct changes to `process.env` in test files, including assignments, deletes, increments and decrements.
|
|
11
11
|
|
|
12
12
|
## Flags
|
|
13
13
|
|
|
14
|
-
- Test files only:
|
|
14
|
+
- Test files only: the `.ts` and `.tsx` files `testFiles` names. Generated folders such as `node_modules`, `dist`, `build` and `coverage` are skipped.
|
|
15
15
|
- Every call spelled `vi.mock(...)`, with or without arguments.
|
|
16
16
|
- Not detected: `vi.doMock`, `jest.mock`, `vitest.mock` and `vi["mock"]`. Those are left to review.
|
|
17
17
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# committed-lock-file
|
|
2
|
+
|
|
3
|
+
```json
|
|
4
|
+
{
|
|
5
|
+
"misses": "Package managers with an unrecognised lock file. Workspace membership is not verified.",
|
|
6
|
+
"settingsTracedTo": "None."
|
|
7
|
+
}
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Dependencies declared without an applicable tracked lock file.
|
|
11
|
+
|
|
12
|
+
A recognised tracked lock file covers manifests in its directory and below, including a root lock.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
```json
|
|
4
4
|
{
|
|
5
|
+
"findingSpecifics": ["outside-party"],
|
|
5
6
|
"misses": "`import()`, `require`, globals.",
|
|
6
7
|
"settingsTracedTo": "`confinedPackages`, empty by default on purpose: the universe of outside dependencies cannot be listed, and flagging every import would catch internal packages. Telling outside from internal needs the workspace layout, which Hone can read."
|
|
7
8
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
```json
|
|
4
4
|
{
|
|
5
5
|
"group": "The outside world reached directly",
|
|
6
|
-
"seen": "An import, `import()` or `require` of an outside dependency or runtime module (`node:*`) in a file with no
|
|
6
|
+
"seen": "An import, `import()` or `require` of an outside dependency or runtime module (`node:*`) in a file with no authorised location for that outside party.",
|
|
7
7
|
"mayIndicate": [
|
|
8
8
|
{
|
|
9
9
|
"case": "uses-a-system-or-service-outside-the-program",
|
|
@@ -32,13 +32,14 @@
|
|
|
32
32
|
"reports": "seen",
|
|
33
33
|
"recipes": [
|
|
34
34
|
"adapter-per-outside-party",
|
|
35
|
-
"port-in-
|
|
35
|
+
"port-in-a-module-of-its-own"
|
|
36
36
|
],
|
|
37
37
|
"correctUses": [
|
|
38
38
|
{
|
|
39
39
|
"situation": "correct use",
|
|
40
|
-
"kind": "
|
|
41
|
-
"at": "on the adapter for that outside party"
|
|
40
|
+
"kind": "authorised-location",
|
|
41
|
+
"at": "on the adapter for that outside party",
|
|
42
|
+
"binds": ["outside-party"]
|
|
42
43
|
}
|
|
43
44
|
]
|
|
44
45
|
}
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"correctUses": [
|
|
29
29
|
{
|
|
30
30
|
"situation": "correct use",
|
|
31
|
-
"kind": "
|
|
32
|
-
"at": "on the adapter, or beyond it with a
|
|
31
|
+
"kind": "authorised-location",
|
|
32
|
+
"at": "on the adapter, or beyond it with a why-chain naming the outside model adopted as ours"
|
|
33
33
|
}
|
|
34
34
|
],
|
|
35
35
|
"breachACheckCouldName": "the adapter that returns it, by types."
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# debugger-statement
|
|
2
|
+
|
|
3
|
+
```json
|
|
4
|
+
{
|
|
5
|
+
"misses": "Debugger activation through a runtime API.",
|
|
6
|
+
"settingsTracedTo": "None."
|
|
7
|
+
}
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
A `debugger` statement can pause execution through the runtime. Keep that effect at the process boundary and pass any needed diagnostic capability in through a port.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# direct-global-use
|
|
2
|
+
|
|
3
|
+
```json
|
|
4
|
+
{
|
|
5
|
+
"misses": "Destructured aliases, indirect calls or references, and dialog calls through other receivers or parenthesised receivers.",
|
|
6
|
+
"settingsTracedTo": "The edition preserves compatibility for existing selections."
|
|
7
|
+
}
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Direct reads of process globals and direct console use.
|
|
11
|
+
|
|
12
|
+
A locally supplied value with the same name passes. Reads of globals still report after an ambient declaration or a canonical Node import or require.
|
|
13
|
+
|
|
14
|
+
Edition 2 also covers unbound `alert`, `confirm`, and `prompt` calls, including calls on the unbound `window` global.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
```json
|
|
4
4
|
{
|
|
5
5
|
"group": "The outside world reached directly",
|
|
6
|
-
"seen": "`process.env`, `process.argv`, `process.exit`, `process.on`, `console
|
|
6
|
+
"seen": "`process.env`, `process.argv`, `process.exit`, `process.on`, `console.*`, `globalThis`, `alert`, `confirm`, `prompt` or a `debugger` statement outside an adapter.",
|
|
7
7
|
"mayIndicate": [
|
|
8
8
|
{
|
|
9
9
|
"case": "reads-data-from-outside",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"correctUses": [
|
|
44
44
|
{
|
|
45
45
|
"situation": "correct use",
|
|
46
|
-
"kind": "
|
|
46
|
+
"kind": "authorised-location",
|
|
47
47
|
"at": "on the adapter that wraps the process"
|
|
48
48
|
}
|
|
49
49
|
]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# comment-prose
|
|
2
|
+
|
|
3
|
+
```json
|
|
4
|
+
{
|
|
5
|
+
"misses": "Comments in JavaScript files.",
|
|
6
|
+
"settingsTracedTo": "`trackerPatterns` reference forms: **nothing**."
|
|
7
|
+
}
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Prose in TypeScript line or block comments, including JSDoc.
|
|
11
|
+
|
|
12
|
+
A tracked TODO may contain only its pointer. `trackerPatterns` chooses which numbered references and URLs count.
|
|
@@ -10,23 +10,6 @@
|
|
|
10
10
|
`let` declarations in a test file. These run with the other [test-body checks](../../../README.md#checks-the-test-body-checks), which share their scope, editions and settings.
|
|
11
11
|
|
|
12
12
|
## Flags
|
|
13
|
-
Edition 1:
|
|
14
|
-
- `let` declarations.
|
|
15
|
-
|
|
16
|
-
## Allowed forms in a test
|
|
17
13
|
|
|
18
14
|
### A let
|
|
19
|
-
|
|
20
|
-
declare const record: (store: { readonly save: (text: string) => void }) => void;
|
|
21
|
-
let saved = "";
|
|
22
|
-
record({ save: (text) => { saved = text; } });
|
|
23
|
-
expect(saved).toBe("a");
|
|
24
|
-
```
|
|
25
|
-
Record the calls with `vi.fn` and assert them:
|
|
26
|
-
|
|
27
|
-
```ts
|
|
28
|
-
declare const record: (store: { readonly save: (text: string) => void }) => void;
|
|
29
|
-
const save = vi.fn<(text: string) => void>();
|
|
30
|
-
record({ save });
|
|
31
|
-
expect(save).toHaveBeenCalledWith("a");
|
|
32
|
-
```
|
|
15
|
+
A `let` declaration. Edition 1.
|
|
@@ -20,6 +20,15 @@
|
|
|
20
20
|
"rule": "doer-or-orchestrator"
|
|
21
21
|
}
|
|
22
22
|
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"case": "uses-what-a-collaborator-gives-back",
|
|
26
|
+
"situation": "in a test",
|
|
27
|
+
"points": [
|
|
28
|
+
{
|
|
29
|
+
"rule": "written-out-answers"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
23
32
|
}
|
|
24
33
|
],
|
|
25
34
|
"breachUsuallySits": "in the unit: no caller sees it, so on its own it shows no hidden effect, but it is suspect for work done inline in steps",
|
|
@@ -29,7 +38,8 @@
|
|
|
29
38
|
"reports": "seen",
|
|
30
39
|
"recipes": [
|
|
31
40
|
"copy-never-write-in",
|
|
32
|
-
"functional-iteration"
|
|
41
|
+
"functional-iteration",
|
|
42
|
+
"stub-with-vi-fn"
|
|
33
43
|
],
|
|
34
44
|
"correctUses": []
|
|
35
45
|
}
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"correctUses": [
|
|
34
34
|
{
|
|
35
35
|
"situation": "an outside model adopted as ours",
|
|
36
|
-
"kind": "
|
|
37
|
-
"at": "with a
|
|
36
|
+
"kind": "authorised-location",
|
|
37
|
+
"at": "with a why-chain naming the outside model adopted as ours"
|
|
38
38
|
}
|
|
39
39
|
]
|
|
40
40
|
}
|
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
```json
|
|
4
4
|
{
|
|
5
|
-
"misses": "
|
|
6
|
-
"settingsTracedTo": "
|
|
5
|
+
"misses": "Test calls made through aliased names.",
|
|
6
|
+
"settingsTracedTo": "The edition preserves the published edition 1 behaviour for adopters."
|
|
7
7
|
}
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
`.skip
|
|
10
|
+
Edition 1 flags `.skip`, `.fixme`, `xdescribe`, `xit`, `xtest` and `xsuite`. Edition 2 also flags `.todo`, `.skipIf` and `.runIf`. A test should run wherever the suite runs.
|
|
11
11
|
|
|
12
|
-
## Flags
|
|
13
12
|
Needs ESLint adopted through the projection.
|
|
14
|
-
- Under ESLint, this check flags `.skip` and `.fixme` on those chains, and the bare names `xdescribe`, `xit`, `xtest` and `xsuite`.
|
|
15
|
-
- Not flagged: `.todo`, `.concurrent` and `.each`.
|
|
@@ -7,24 +7,9 @@
|
|
|
7
7
|
}
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
JSON text made or read in a test file. These run with the other [test-body checks](../../../README.md#checks-the-test-body-checks), which share their scope, editions and settings.
|
|
11
11
|
|
|
12
12
|
## Flags
|
|
13
|
-
Edition 2:
|
|
14
|
-
- `JSON.stringify` and `JSON.parse`. A finding names [Serialising or parsing JSON](#serialising-or-parsing-json).
|
|
15
|
-
|
|
16
|
-
## Allowed forms in a test
|
|
17
13
|
|
|
18
14
|
### Serialising or parsing JSON
|
|
19
|
-
|
|
20
|
-
declare const render: (row: { readonly id: string }) => string;
|
|
21
|
-
expect(JSON.parse(render({ id: "a" }))).toEqual({ id: "a" });
|
|
22
|
-
```
|
|
23
|
-
A finding on `JSON.stringify` or `JSON.parse` names this section. Assert the object the unit gives back, written out:
|
|
24
|
-
|
|
25
|
-
```ts
|
|
26
|
-
declare const rowOf: (row: { readonly id: string }) => { readonly id: string };
|
|
27
|
-
expect(rowOf({ id: "a" })).toEqual({ id: "a" });
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
A unit that gives back only text should hand over an object, leaving the text to the adapter at its edge.
|
|
15
|
+
`JSON.stringify` or `JSON.parse`. Edition 2 adds it.
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
A `throw` statement in a test file.
|
|
11
11
|
|
|
12
12
|
## Flags
|
|
13
|
-
- Test files only:
|
|
13
|
+
- Test files only: the `.ts` and `.tsx` files `testFiles` names. `.js` tests are not read. Generated folders such as `node_modules`, `dist`, `build` and `coverage` are skipped.
|
|
14
14
|
- Every `throw` statement, wherever it sits in the file.
|
|
15
15
|
- Allowed: assertion calls such as `expect(...)`.
|
|
16
16
|
- The source rule also confines throwing in production code to a closed list of contexts. The check does not look at production files; that part is left to review.
|
|
@@ -10,30 +10,6 @@
|
|
|
10
10
|
`try` statements in a test file. These run with the other [test-body checks](../../../README.md#checks-the-test-body-checks), which share their scope, editions and settings.
|
|
11
11
|
|
|
12
12
|
## Flags
|
|
13
|
-
Edition 1:
|
|
14
|
-
- `try` statements.
|
|
15
|
-
|
|
16
|
-
## Allowed forms in a test
|
|
17
13
|
|
|
18
14
|
### A try block
|
|
19
|
-
|
|
20
|
-
declare const load: (path: string) => string;
|
|
21
|
-
try {
|
|
22
|
-
load("missing.json");
|
|
23
|
-
} catch (error) {
|
|
24
|
-
expect(error).toBeInstanceOf(Error);
|
|
25
|
-
}
|
|
26
|
-
```
|
|
27
|
-
Assert the throw:
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
declare const load: (path: string) => string;
|
|
31
|
-
expect(() => load("missing.json")).toThrow(Error);
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
```ts
|
|
35
|
-
declare const loadLater: (path: string) => Promise<string>;
|
|
36
|
-
it("refuses a missing file", async () => {
|
|
37
|
-
await expect(loadLater("missing.json")).rejects.toThrow(Error);
|
|
38
|
-
});
|
|
39
|
-
```
|
|
15
|
+
A `try` statement. Edition 1.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# fetch-command
|
|
2
|
+
|
|
3
|
+
```json
|
|
4
|
+
{
|
|
5
|
+
"misses": "Indirect commands composed through aliases or variables and commands split across physical lines.",
|
|
6
|
+
"settingsTracedTo": "None."
|
|
7
|
+
}
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Direct fetch-and-run commands in package scripts, CI workflows, and shell scripts.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# test-type-declaration
|
|
2
|
+
|
|
3
|
+
```json
|
|
4
|
+
{
|
|
5
|
+
"misses": "Inline type literals and declarations in ordinary source files imported only by tests.",
|
|
6
|
+
"settingsTracedTo": "None."
|
|
7
|
+
}
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
A test declares a type, interface or enum of its own. Import the contract owned by the unit or its boundary so the test and the unit rely on the same type. Module and global augmentations are allowed. So is a top-level `type`, not exported, used only as the `it.each` or `describe.each` row type: one flat object or tuple, readonly or not, whose members are primitives, types imported by name, or readonly lists of imported types.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Type declared in a test
|
|
2
|
+
|
|
3
|
+
```json
|
|
4
|
+
{
|
|
5
|
+
"group": "Tests",
|
|
6
|
+
"seen": "A type alias, interface or enum declared in a test file.",
|
|
7
|
+
"mayIndicate": [
|
|
8
|
+
{
|
|
9
|
+
"case": "puts-code-in-a-file-or-folder",
|
|
10
|
+
"points": [
|
|
11
|
+
{
|
|
12
|
+
"rule": "one-reason-per-module"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"case": "gives-a-value-its-type",
|
|
18
|
+
"points": [
|
|
19
|
+
{
|
|
20
|
+
"rule": "declared-not-asserted"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"breachUsuallySits": "in the unit whose contract the test repeats or cannot import",
|
|
26
|
+
"seenBy": [
|
|
27
|
+
"syntax"
|
|
28
|
+
],
|
|
29
|
+
"reports": "seen",
|
|
30
|
+
"recipes": [],
|
|
31
|
+
"correctUses": []
|
|
32
|
+
}
|
|
33
|
+
```
|
|
@@ -11,8 +11,8 @@ A production file with a runtime export and no `.test` sibling.
|
|
|
11
11
|
|
|
12
12
|
## Flags
|
|
13
13
|
|
|
14
|
-
- Production `.ts` and `.tsx` files. Skipped:
|
|
15
|
-
- A file with a runtime export (`export const`, `function`, `class`, `enum`, `export default`, or `export { name }`) and no `<name>.
|
|
14
|
+
- Production `.ts` and `.tsx` files. Skipped: the test files `testFiles` names, `.d.ts` and anything under `__tests__`. Generated folders (`node_modules`, `dist`, `build`, `coverage`, `.git`, root `vendor`) are skipped; any other folder or file can be left out with `exclude` in disciplines.json.
|
|
15
|
+
- A file with a runtime export (`export const`, `function`, `class`, `enum`, `export default`, or `export { name }`) and no `<name>.<suffix>.ts` beside it (`.tsx` for `.tsx`), for any suffix `testFiles` lists. The sibling must be in the repository's file list.
|
|
16
16
|
- Allowed: files with only `export type`, `export interface`, `export declare`, type-only named exports or `export * from`, and files with no exports.
|
|
17
17
|
- The source rule asks for a test beside every source file; files without runtime exports are left to review.
|
|
18
18
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# unread-parameter
|
|
2
|
+
|
|
3
|
+
```json
|
|
4
|
+
{
|
|
5
|
+
"misses": "Leading unread parameters before a read parameter or a constructor parameter property. Functions that read arguments, unread parameter properties and fields of objects left whole. Setter parameters are required by the language.",
|
|
6
|
+
"settingsTracedTo": "None."
|
|
7
|
+
}
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
The signature demands a parameter or destructured field the unit never reads. Callers build and pass input that changes nothing.
|