@shivaedev/quality 0.69.4 → 0.70.0
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/CHANGELOG.md +20 -0
- package/README.md +9 -9
- package/dist/adapters/biome/browserDiagnostic.d.ts.map +1 -1
- package/dist/adapters/biome/browserDiagnostic.js +1 -1
- package/dist/adapters/biome/browserDiagnostic.js.map +1 -1
- package/dist/adapters/biome/configs.d.ts.map +1 -1
- package/dist/adapters/biome/configs.js +1 -1
- package/dist/adapters/biome/configs.js.map +1 -1
- package/dist/adapters/biome/pluginContract.d.ts +3 -0
- package/dist/adapters/biome/pluginContract.d.ts.map +1 -0
- package/dist/adapters/biome/pluginContract.js +35 -0
- package/dist/adapters/biome/pluginContract.js.map +1 -0
- package/dist/adapters/biome/presetConfig.d.ts.map +1 -1
- package/dist/adapters/biome/presetConfig.js +2 -2
- package/dist/adapters/biome/presetConfig.js.map +1 -1
- package/dist/adapters/biome/relocateConfig.js +1 -1
- package/dist/adapters/biome/relocateConfig.js.map +1 -1
- package/dist/adapters/biome/toolContractDefaults.d.ts +18 -0
- package/dist/adapters/biome/toolContractDefaults.d.ts.map +1 -0
- package/dist/adapters/biome/toolContractDefaults.js +28 -0
- package/dist/adapters/biome/toolContractDefaults.js.map +1 -0
- package/dist/adapters/biome/withExceptionConfig.js +2 -2
- package/dist/adapters/biome/withExceptionConfig.js.map +1 -1
- package/dist/adapters/bodyReferences.d.ts +1 -1
- package/dist/adapters/bodyReferences.d.ts.map +1 -1
- package/dist/adapters/bodyReferences.js +1 -1
- package/dist/adapters/bodyReferences.js.map +1 -1
- package/dist/adapters/buildEntryPaths.d.ts +2 -1
- package/dist/adapters/buildEntryPaths.d.ts.map +1 -1
- package/dist/adapters/buildEntryPaths.js +8 -5
- package/dist/adapters/buildEntryPaths.js.map +1 -1
- package/dist/adapters/buildEntryValue.d.ts +2 -1
- package/dist/adapters/buildEntryValue.d.ts.map +1 -1
- package/dist/adapters/buildEntryValue.js +11 -5
- package/dist/adapters/buildEntryValue.js.map +1 -1
- package/dist/adapters/buildHelper.d.ts +7 -0
- package/dist/adapters/buildHelper.d.ts.map +1 -0
- package/dist/adapters/buildHelper.js +55 -0
- package/dist/adapters/buildHelper.js.map +1 -0
- package/dist/adapters/bundlerEntries.d.ts +2 -1
- package/dist/adapters/bundlerEntries.d.ts.map +1 -1
- package/dist/adapters/bundlerEntries.js +30 -16
- package/dist/adapters/bundlerEntries.js.map +1 -1
- package/dist/adapters/bundlerSources.d.ts +5 -0
- package/dist/adapters/bundlerSources.d.ts.map +1 -0
- package/dist/adapters/bundlerSources.js +55 -0
- package/dist/adapters/bundlerSources.js.map +1 -0
- package/dist/adapters/changeKeyFindings.d.ts.map +1 -1
- package/dist/adapters/changeKeyFindings.js +1 -1
- package/dist/adapters/changeKeyFindings.js.map +1 -1
- package/dist/adapters/composedContext.d.ts +1 -1
- package/dist/adapters/composedContext.d.ts.map +1 -1
- package/dist/adapters/composedContext.js +37 -16
- package/dist/adapters/composedContext.js.map +1 -1
- package/dist/adapters/databaseUrlFindings.d.ts.map +1 -1
- package/dist/adapters/databaseUrlFindings.js +2 -2
- package/dist/adapters/databaseUrlFindings.js.map +1 -1
- package/dist/adapters/engineEscapes.js +2 -2
- package/dist/adapters/engineEscapes.js.map +1 -1
- package/dist/adapters/foreignResources.d.ts.map +1 -1
- package/dist/adapters/foreignResources.js +6 -0
- package/dist/adapters/foreignResources.js.map +1 -1
- package/dist/adapters/import-compiler/service.js +3 -3
- package/dist/adapters/import-compiler/service.js.map +1 -1
- package/dist/adapters/imports/departures.d.ts.map +1 -1
- package/dist/adapters/imports/departures.js +2 -24
- package/dist/adapters/imports/departures.js.map +1 -1
- package/dist/adapters/imports/fakeTargets.d.ts.map +1 -1
- package/dist/adapters/imports/fakeTargets.js +2 -2
- package/dist/adapters/imports/fakeTargets.js.map +1 -1
- package/dist/adapters/imports/graph.d.ts.map +1 -1
- package/dist/adapters/imports/graph.js +2 -2
- package/dist/adapters/imports/graph.js.map +1 -1
- package/dist/adapters/imports/resolve.d.ts +1 -1
- package/dist/adapters/imports/resolve.d.ts.map +1 -1
- package/dist/adapters/imports/resolve.js +14 -1
- package/dist/adapters/imports/resolve.js.map +1 -1
- package/dist/adapters/knip/configuration.d.ts.map +1 -1
- package/dist/adapters/knip/configuration.js +5 -3
- package/dist/adapters/knip/configuration.js.map +1 -1
- package/dist/adapters/knip/entryPointFindings.js +1 -1
- package/dist/adapters/knip/entryPointFindings.js.map +1 -1
- package/dist/adapters/knip/report.d.ts.map +1 -1
- package/dist/adapters/knip/report.js +1 -1
- package/dist/adapters/knip/report.js.map +1 -1
- package/dist/adapters/knip/run.d.ts.map +1 -1
- package/dist/adapters/knip/run.js +5 -5
- package/dist/adapters/knip/run.js.map +1 -1
- package/dist/adapters/moduleResolver.d.ts +3 -0
- package/dist/adapters/moduleResolver.d.ts.map +1 -0
- package/dist/adapters/moduleResolver.js +22 -0
- package/dist/adapters/moduleResolver.js.map +1 -0
- package/dist/adapters/nativeTransactionFindings.d.ts.map +1 -1
- package/dist/adapters/nativeTransactionFindings.js +1 -1
- package/dist/adapters/nativeTransactionFindings.js.map +1 -1
- package/dist/adapters/positiveRefusalFindings.d.ts.map +1 -1
- package/dist/adapters/positiveRefusalFindings.js +1 -1
- package/dist/adapters/positiveRefusalFindings.js.map +1 -1
- package/dist/adapters/queueReadoutFindings.d.ts.map +1 -1
- package/dist/adapters/queueReadoutFindings.js +3 -3
- package/dist/adapters/queueReadoutFindings.js.map +1 -1
- package/dist/adapters/reachableBuildEntries.d.ts.map +1 -1
- package/dist/adapters/reachableBuildEntries.js +7 -6
- package/dist/adapters/reachableBuildEntries.js.map +1 -1
- package/dist/adapters/reactComponent.d.ts +4 -0
- package/dist/adapters/reactComponent.d.ts.map +1 -0
- package/dist/adapters/reactComponent.js +61 -0
- package/dist/adapters/reactComponent.js.map +1 -0
- package/dist/adapters/rule.d.ts +1 -1
- package/dist/adapters/rule.d.ts.map +1 -1
- package/dist/adapters/rule.js +1 -1
- package/dist/adapters/rule.js.map +1 -1
- package/dist/adapters/serviceAccess.d.ts +1 -1
- package/dist/adapters/serviceAccess.d.ts.map +1 -1
- package/dist/adapters/serviceStateProblems.d.ts.map +1 -1
- package/dist/adapters/serviceStateProblems.js +2 -1
- package/dist/adapters/serviceStateProblems.js.map +1 -1
- package/dist/adapters/spawnedEntries.d.ts.map +1 -1
- package/dist/adapters/spawnedEntries.js +3 -3
- package/dist/adapters/spawnedEntries.js.map +1 -1
- package/dist/adapters/specReaderSources.d.ts.map +1 -1
- package/dist/adapters/specReaderSources.js +1 -1
- package/dist/adapters/specReaderSources.js.map +1 -1
- package/dist/adapters/testProjects.js +1 -1
- package/dist/adapters/testProjects.js.map +1 -1
- package/dist/adapters/units/runtime.d.ts.map +1 -1
- package/dist/adapters/units/runtime.js +2 -2
- package/dist/adapters/units/runtime.js.map +1 -1
- package/dist/adapters/units/runtimeOrigins.d.ts +1 -1
- package/dist/adapters/units/runtimeOrigins.d.ts.map +1 -1
- package/dist/adapters/units/runtimeOrigins.js +1 -1
- package/dist/adapters/units/runtimeOrigins.js.map +1 -1
- package/dist/adapters/units/runtimeUse.d.ts +1 -1
- package/dist/adapters/units/runtimeUse.d.ts.map +1 -1
- package/dist/adapters/units/runtimeUse.js +1 -1
- package/dist/adapters/units/runtimeUse.js.map +1 -1
- package/dist/adapters/vitestContractPaths.d.ts +2 -0
- package/dist/adapters/vitestContractPaths.d.ts.map +1 -0
- package/dist/adapters/vitestContractPaths.js +24 -0
- package/dist/adapters/vitestContractPaths.js.map +1 -0
- package/dist/baseline/compare.d.ts +1 -1
- package/dist/baseline/compare.d.ts.map +1 -1
- package/dist/baseline/compare.js.map +1 -1
- package/dist/baseline/legacy.d.ts +1 -1
- package/dist/baseline/legacy.d.ts.map +1 -1
- package/dist/baseline/legacy.js +1 -1
- package/dist/baseline/legacy.js.map +1 -1
- package/dist/baseline/looseStagedEntries.d.ts +1 -1
- package/dist/baseline/looseStagedEntries.d.ts.map +1 -1
- package/dist/baseline/looseStagedEntries.js +3 -3
- package/dist/baseline/looseStagedEntries.js.map +1 -1
- package/dist/baseline/rewrite.d.ts +1 -1
- package/dist/baseline/rewrite.d.ts.map +1 -1
- package/dist/baseline/rewrite.js +1 -1
- package/dist/baseline/rewrite.js.map +1 -1
- package/dist/baseline/update.d.ts +1 -1
- package/dist/baseline/update.d.ts.map +1 -1
- package/dist/baseline/update.js +1 -1
- package/dist/baseline/update.js.map +1 -1
- package/dist/biome/nativeEffectCall.d.ts +1 -1
- package/dist/biome/nativeEffectCall.d.ts.map +1 -1
- package/dist/biome/recognizeDiagnostics.d.ts +2 -2
- package/dist/biome/recognizeDiagnostics.d.ts.map +1 -1
- package/dist/biome/recognizeDiagnostics.js +21 -7
- package/dist/biome/recognizeDiagnostics.js.map +1 -1
- package/dist/biome/report.d.ts.map +1 -1
- package/dist/biome/report.js +3 -2
- package/dist/biome/report.js.map +1 -1
- package/dist/biome/withoutEntryPointImports.d.ts.map +1 -1
- package/dist/biome/withoutEntryPointImports.js.map +1 -1
- package/dist/cli/args.js +2 -2
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/fix.d.ts.map +1 -1
- package/dist/cli/fix.js +1 -1
- package/dist/cli/fix.js.map +1 -1
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +1 -1
- package/dist/cli/program.js.map +1 -1
- package/dist/cli/shrink.d.ts.map +1 -1
- package/dist/cli/shrink.js +1 -1
- package/dist/cli/shrink.js.map +1 -1
- package/dist/config/load.d.ts +1 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +3 -3
- package/dist/config/load.js.map +1 -1
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js.map +1 -1
- package/dist/decoded.d.ts +1 -1
- package/dist/decoded.d.ts.map +1 -1
- package/dist/decoded.js +1 -1
- package/dist/decoded.js.map +1 -1
- package/dist/docs/documentedImports.js +1 -1
- package/dist/docs/documentedImports.js.map +1 -1
- package/dist/docs/headingAnchors.d.ts +1 -1
- package/dist/docs/headingAnchors.d.ts.map +1 -1
- package/dist/docs/importFindings.d.ts.map +1 -1
- package/dist/docs/importFindings.js +3 -3
- package/dist/docs/importFindings.js.map +1 -1
- package/dist/docs/linkFindings.d.ts +2 -2
- package/dist/docs/linkFindings.d.ts.map +1 -1
- package/dist/docs/linkFindings.js +2 -2
- package/dist/docs/linkFindings.js.map +1 -1
- package/dist/docs/markdownLinks.d.ts +1 -1
- package/dist/docs/markdownLinks.d.ts.map +1 -1
- package/dist/docs/markdownLinks.js +1 -1
- package/dist/docs/markdownLinks.js.map +1 -1
- package/dist/engine/evaluate.d.ts +1 -1
- package/dist/engine/evaluate.d.ts.map +1 -1
- package/dist/engine/evaluate.js +1 -1
- package/dist/engine/evaluate.js.map +1 -1
- package/dist/engine/runRules.d.ts +1 -1
- package/dist/engine/runRules.d.ts.map +1 -1
- package/dist/engine/runRules.js.map +1 -1
- package/dist/engine/session.d.ts +2 -2
- package/dist/engine/session.d.ts.map +1 -1
- package/dist/engine/session.js +2 -2
- package/dist/engine/session.js.map +1 -1
- package/dist/exceptions/migrateConfig.d.ts +1 -1
- package/dist/exceptions/migrateConfig.d.ts.map +1 -1
- package/dist/exceptions/registryEntries.d.ts +2 -2
- package/dist/exceptions/registryEntries.d.ts.map +1 -1
- package/dist/git/base.js +1 -1
- package/dist/git/base.js.map +1 -1
- package/dist/git/history.js +1 -1
- package/dist/git/history.js.map +1 -1
- package/dist/hooks/forwarding.js +2 -2
- package/dist/hooks/forwarding.js.map +1 -1
- package/dist/hooks/install.d.ts +1 -1
- package/dist/hooks/install.d.ts.map +1 -1
- package/dist/hooks/install.js +5 -5
- package/dist/hooks/install.js.map +1 -1
- package/dist/hooks/setup.d.ts +1 -1
- package/dist/hooks/setup.d.ts.map +1 -1
- package/dist/hooks/setup.js +1 -1
- package/dist/hooks/setup.js.map +1 -1
- package/dist/hooks/shim.d.ts +1 -1
- package/dist/hooks/shim.d.ts.map +1 -1
- package/dist/hooks/shim.js +1 -1
- package/dist/hooks/shim.js.map +1 -1
- package/dist/hooks/status.d.ts +1 -1
- package/dist/hooks/status.d.ts.map +1 -1
- package/dist/hooks/status.js +3 -3
- package/dist/hooks/status.js.map +1 -1
- package/dist/hooks/uninstall.js +3 -3
- package/dist/hooks/uninstall.js.map +1 -1
- package/dist/imports/adminEvidence.d.ts.map +1 -1
- package/dist/imports/adminEvidence.js +1 -1
- package/dist/imports/adminEvidence.js.map +1 -1
- package/dist/imports/adminFindings.d.ts +1 -1
- package/dist/imports/adminFindings.d.ts.map +1 -1
- package/dist/imports/adminFindings.js +1 -1
- package/dist/imports/adminFindings.js.map +1 -1
- package/dist/imports/browserGlobals.d.ts.map +1 -1
- package/dist/imports/browserGlobals.js +1 -1
- package/dist/imports/browserGlobals.js.map +1 -1
- package/dist/imports/classifyRuntime.d.ts +2 -2
- package/dist/imports/classifyRuntime.d.ts.map +1 -1
- package/dist/imports/classifyRuntime.js +2 -2
- package/dist/imports/classifyRuntime.js.map +1 -1
- package/dist/imports/departures.d.ts +1 -1
- package/dist/imports/departures.d.ts.map +1 -1
- package/dist/imports/departures.js +1 -1
- package/dist/imports/departures.js.map +1 -1
- package/dist/imports/extract.d.ts.map +1 -1
- package/dist/imports/extract.js +3 -15
- package/dist/imports/extract.js.map +1 -1
- package/dist/imports/fences/check.d.ts +1 -1
- package/dist/imports/fences/check.d.ts.map +1 -1
- package/dist/imports/fences/check.js +2 -2
- package/dist/imports/fences/check.js.map +1 -1
- package/dist/imports/fences/compilePolicy.d.ts +3 -3
- package/dist/imports/fences/compilePolicy.d.ts.map +1 -1
- package/dist/imports/fences/compilePolicy.js +1 -1
- package/dist/imports/fences/compilePolicy.js.map +1 -1
- package/dist/imports/fences/declarations.d.ts +1 -1
- package/dist/imports/fences/declarations.d.ts.map +1 -1
- package/dist/imports/fences/discover.d.ts +1 -1
- package/dist/imports/fences/discover.d.ts.map +1 -1
- package/dist/imports/fences/discover.js +1 -1
- package/dist/imports/fences/discover.js.map +1 -1
- package/dist/imports/fences/evaluate.d.ts +2 -2
- package/dist/imports/fences/evaluate.d.ts.map +1 -1
- package/dist/imports/fences/evaluate.js +3 -3
- package/dist/imports/fences/evaluate.js.map +1 -1
- package/dist/imports/fences/match.d.ts +1 -1
- package/dist/imports/fences/match.d.ts.map +1 -1
- package/dist/imports/fences/match.js.map +1 -1
- package/dist/imports/fences/reach.d.ts +1 -1
- package/dist/imports/fences/reach.d.ts.map +1 -1
- package/dist/imports/fences/selectors.d.ts +1 -1
- package/dist/imports/fences/selectors.d.ts.map +1 -1
- package/dist/imports/fences/vocabulary.d.ts +2 -2
- package/dist/imports/fences/vocabulary.d.ts.map +1 -1
- package/dist/imports/fences/vocabulary.js +1 -1
- package/dist/imports/fences/vocabulary.js.map +1 -1
- package/dist/imports/graph.d.ts +3 -3
- package/dist/imports/graph.d.ts.map +1 -1
- package/dist/imports/graph.js +1 -1
- package/dist/imports/graph.js.map +1 -1
- package/dist/imports/nodePlatformBarrels.d.ts.map +1 -1
- package/dist/imports/nodePlatformBarrels.js +1 -1
- package/dist/imports/nodePlatformBarrels.js.map +1 -1
- package/dist/imports/runtime.d.ts +1 -1
- package/dist/imports/runtime.d.ts.map +1 -1
- package/dist/imports/runtime.js +1 -1
- package/dist/imports/runtime.js.map +1 -1
- package/dist/imports/testComposition.d.ts +2 -2
- package/dist/imports/testComposition.d.ts.map +1 -1
- package/dist/imports/testComposition.js +1 -1
- package/dist/imports/testComposition.js.map +1 -1
- package/dist/imports/withoutGenerated.d.ts +2 -2
- package/dist/imports/withoutGenerated.d.ts.map +1 -1
- package/dist/imports/withoutGenerated.js.map +1 -1
- package/dist/imports/workspace.d.ts.map +1 -1
- package/dist/imports/workspace.js +2 -2
- package/dist/imports/workspace.js.map +1 -1
- package/dist/inventory/collect.d.ts +1 -1
- package/dist/inventory/collect.d.ts.map +1 -1
- package/dist/inventory/collect.js +6 -6
- package/dist/inventory/collect.js.map +1 -1
- package/dist/inventory/routeFiles.d.ts +1 -1
- package/dist/inventory/routeFiles.d.ts.map +1 -1
- package/dist/inventory/routeFiles.js +3 -3
- package/dist/inventory/routeFiles.js.map +1 -1
- package/dist/inventory/walk.d.ts +2 -2
- package/dist/inventory/walk.d.ts.map +1 -1
- package/dist/inventory/walk.js +3 -3
- package/dist/inventory/walk.js.map +1 -1
- package/dist/naming/developmentCode.d.ts +4 -0
- package/dist/naming/developmentCode.d.ts.map +1 -0
- package/dist/naming/developmentCode.js +16 -0
- package/dist/naming/developmentCode.js.map +1 -0
- package/dist/naming/isMigrationFile.js +1 -1
- package/dist/naming/isMigrationFile.js.map +1 -1
- package/dist/naming/nativeNames.js +1 -1
- package/dist/naming/nativeNames.js.map +1 -1
- package/dist/naming/testCode.d.ts.map +1 -1
- package/dist/naming/testCode.js +5 -3
- package/dist/naming/testCode.js.map +1 -1
- package/dist/report/render.js +2 -2
- package/dist/report/render.js.map +1 -1
- package/dist/report/staleSections.js +1 -1
- package/dist/report/staleSections.js.map +1 -1
- package/dist/rules/builtIn.js +12 -12
- package/dist/rules/builtIn.js.map +1 -1
- package/dist/rules/comments/definePattern.js +2 -2
- package/dist/rules/comments/definePattern.js.map +1 -1
- package/dist/rules/comments/kinds.d.ts +1 -1
- package/dist/rules/comments/kinds.d.ts.map +1 -1
- package/dist/rules/comments/kinds.js.map +1 -1
- package/dist/rules/comments/maxPerFile.js +2 -2
- package/dist/rules/comments/maxPerFile.js.map +1 -1
- package/dist/rules/comments/noBanner.js +1 -1
- package/dist/rules/comments/noBanner.js.map +1 -1
- package/dist/rules/comments/noEnvironmentPragma.js +1 -1
- package/dist/rules/comments/noEnvironmentPragma.js.map +1 -1
- package/dist/rules/comments/noJsdoc.js +2 -2
- package/dist/rules/comments/noJsdoc.js.map +1 -1
- package/dist/rules/comments/noLineReference.js +1 -1
- package/dist/rules/comments/noLineReference.js.map +1 -1
- package/dist/rules/comments/noPrReference.js +1 -1
- package/dist/rules/comments/noPrReference.js.map +1 -1
- package/dist/rules/comments/noTodo.js +1 -1
- package/dist/rules/comments/noTodo.js.map +1 -1
- package/dist/rules/effect/failureFindings.js +2 -2
- package/dist/rules/effect/failureFindings.js.map +1 -1
- package/dist/rules/effect/failureHonesty.js +2 -2
- package/dist/rules/effect/failureHonesty.js.map +1 -1
- package/dist/rules/effect/failureOperations.js +1 -1
- package/dist/rules/effect/failureOperations.js.map +1 -1
- package/dist/rules/effect/serviceFindings.d.ts.map +1 -1
- package/dist/rules/effect/serviceFindings.js +4 -0
- package/dist/rules/effect/serviceFindings.js.map +1 -1
- package/dist/rules/effect/serviceParameters.js +1 -1
- package/dist/rules/effect/serviceParameters.js.map +1 -1
- package/dist/rules/effect/serviceTypes.d.ts.map +1 -1
- package/dist/rules/effect/serviceTypes.js +1 -0
- package/dist/rules/effect/serviceTypes.js.map +1 -1
- package/dist/rules/effect/successRecovery.js +1 -1
- package/dist/rules/effect/successRecovery.js.map +1 -1
- package/dist/rules/files/otherNames.js +1 -1
- package/dist/rules/files/otherNames.js.map +1 -1
- package/dist/rules/files/stylesheetImporters.js +1 -1
- package/dist/rules/files/stylesheetImporters.js.map +1 -1
- package/dist/rules/imports/aliased.js +5 -5
- package/dist/rules/imports/aliased.js.map +1 -1
- package/dist/rules/imports/manifest.d.ts.map +1 -1
- package/dist/rules/imports/manifest.js +7 -2
- package/dist/rules/imports/manifest.js.map +1 -1
- package/dist/rules/imports/noTestCode.d.ts.map +1 -1
- package/dist/rules/imports/noTestCode.js +4 -2
- package/dist/rules/imports/noTestCode.js.map +1 -1
- package/dist/rules/manifestsDependencyPins.d.ts.map +1 -1
- package/dist/rules/manifestsDependencyPins.js +2 -3
- package/dist/rules/manifestsDependencyPins.js.map +1 -1
- package/dist/rules/noBarrel.js +2 -2
- package/dist/rules/noBarrel.js.map +1 -1
- package/dist/rules/react/jsxConditionals.js +1 -1
- package/dist/rules/react/jsxConditionals.js.map +1 -1
- package/dist/rules/secondNames.js +1 -1
- package/dist/rules/secondNames.js.map +1 -1
- package/dist/rules/stories/adapterOnlyFakes.js +1 -1
- package/dist/rules/stories/adapterOnlyFakes.js.map +1 -1
- package/dist/rules/stories/adapters/authTables.d.ts.map +1 -1
- package/dist/rules/stories/adapters/authTables.js +1 -1
- package/dist/rules/stories/adapters/authTables.js.map +1 -1
- package/dist/rules/stories/adapters/realTime.d.ts.map +1 -1
- package/dist/rules/stories/adapters/realTime.js +1 -1
- package/dist/rules/stories/adapters/realTime.js.map +1 -1
- package/dist/rules/stories/adapters/sqlTables.js +1 -1
- package/dist/rules/stories/adapters/sqlTables.js.map +1 -1
- package/dist/rules/stories/authSql.js +2 -2
- package/dist/rules/stories/authSql.js.map +1 -1
- package/dist/rules/stories/domainOutcomes.js +4 -4
- package/dist/rules/stories/domainOutcomes.js.map +1 -1
- package/dist/rules/stories/engine.js +4 -4
- package/dist/rules/stories/engine.js.map +1 -1
- package/dist/rules/stories/fakeImplementation.js +1 -1
- package/dist/rules/stories/fakeImplementation.js.map +1 -1
- package/dist/rules/stories/fakeReplacements.js +2 -2
- package/dist/rules/stories/fakeReplacements.js.map +1 -1
- package/dist/rules/stories/globalRetries.js +3 -3
- package/dist/rules/stories/globalRetries.js.map +1 -1
- package/dist/rules/stories/groupedOutcomes.js +3 -3
- package/dist/rules/stories/groupedOutcomes.js.map +1 -1
- package/dist/rules/stories/httpStatus.js +2 -2
- package/dist/rules/stories/httpStatus.js.map +1 -1
- package/dist/rules/stories/namedValues.js +2 -2
- package/dist/rules/stories/namedValues.js.map +1 -1
- package/dist/rules/stories/noExpect.js +2 -2
- package/dist/rules/stories/noExpect.js.map +1 -1
- package/dist/rules/stories/noLimitImports.js +2 -2
- package/dist/rules/stories/noLimitImports.js.map +1 -1
- package/dist/rules/stories/origins.d.ts +1 -1
- package/dist/rules/stories/origins.d.ts.map +1 -1
- package/dist/rules/stories/origins.js +4 -4
- package/dist/rules/stories/origins.js.map +1 -1
- package/dist/rules/stories/positiveRefusals.js +2 -2
- package/dist/rules/stories/positiveRefusals.js.map +1 -1
- package/dist/rules/stories/queueSql.js +1 -1
- package/dist/rules/stories/queueSql.js.map +1 -1
- package/dist/rules/stories/registersTests.js +1 -1
- package/dist/rules/stories/registersTests.js.map +1 -1
- package/dist/rules/stories/retryOption.js +1 -1
- package/dist/rules/stories/retryOption.js.map +1 -1
- package/dist/rules/stories/setup.js +1 -1
- package/dist/rules/stories/setup.js.map +1 -1
- package/dist/rules/stories/sources.js +2 -2
- package/dist/rules/stories/sources.js.map +1 -1
- package/dist/rules/stories/specHelpers.js +2 -2
- package/dist/rules/stories/specHelpers.js.map +1 -1
- package/dist/rules/stories/specs.js +3 -3
- package/dist/rules/stories/specs.js.map +1 -1
- package/dist/rules/stories/sqlText.js +1 -1
- package/dist/rules/stories/sqlText.js.map +1 -1
- package/dist/rules/stories/unitTests.js +3 -3
- package/dist/rules/stories/unitTests.js.map +1 -1
- package/dist/rules/stories/waitOnEvents.js +3 -3
- package/dist/rules/stories/waitOnEvents.js.map +1 -1
- package/dist/rules/suppressions/biome/ConsumerDeclaration.js +1 -1
- package/dist/rules/suppressions/biome/ConsumerDeclaration.js.map +1 -1
- package/dist/rules/suppressions/biome/weakenings.js +2 -2
- package/dist/rules/suppressions/biome/weakenings.js.map +1 -1
- package/dist/rules/suppressions/noDoubleCast.js +2 -2
- package/dist/rules/suppressions/noDoubleCast.js.map +1 -1
- package/dist/rules/suppressions/noInline.js +2 -2
- package/dist/rules/suppressions/noInline.js.map +1 -1
- package/dist/testing/adapters/hookRepository.d.ts +2 -2
- package/dist/testing/adapters/hookRepository.d.ts.map +1 -1
- package/dist/testing/adapters/hookRepository.js +5 -5
- package/dist/testing/adapters/hookRepository.js.map +1 -1
- package/dist/testing/adapters/packageExports.d.ts +1 -1
- package/dist/testing/adapters/packageExports.d.ts.map +1 -1
- package/dist/testing/adapters/qualityTree.d.ts +1 -1
- package/dist/testing/adapters/qualityTree.d.ts.map +1 -1
- package/dist/testing/adapters/qualityTree.js +1 -1
- package/dist/testing/adapters/qualityTree.js.map +1 -1
- package/dist/testing/adapters/storySpecFiles.d.ts +1 -1
- package/dist/testing/adapters/storySpecFiles.d.ts.map +1 -1
- package/dist/testing/adapters/writePackageExports.js +1 -1
- package/dist/testing/adapters/writePackageExports.js.map +1 -1
- package/package.json +1 -1
- package/src/adapters/biome/browserDiagnostic.ts +1 -1
- package/src/adapters/biome/configs.ts +1 -1
- package/src/adapters/biome/pluginContract.ts +42 -0
- package/src/adapters/biome/presetConfig.ts +2 -2
- package/src/adapters/biome/relocateConfig.ts +1 -1
- package/src/adapters/biome/toolContractDefaults.ts +31 -0
- package/src/adapters/biome/withExceptionConfig.ts +2 -2
- package/src/adapters/bodyReferences.ts +1 -1
- package/src/adapters/buildEntryPaths.ts +14 -5
- package/src/adapters/buildEntryValue.ts +13 -5
- package/src/adapters/buildHelper.ts +61 -0
- package/src/adapters/bundlerEntries.ts +40 -16
- package/src/adapters/bundlerSources.ts +60 -0
- package/src/adapters/changeKeyFindings.ts +1 -1
- package/src/adapters/composedContext.ts +42 -18
- package/src/adapters/databaseUrlFindings.ts +2 -2
- package/src/adapters/engineEscapes.ts +3 -3
- package/src/adapters/foreignResources.ts +6 -0
- package/src/adapters/import-compiler/service.ts +3 -3
- package/src/adapters/imports/departures.ts +2 -29
- package/src/adapters/imports/fakeTargets.ts +2 -2
- package/src/adapters/imports/graph.ts +2 -2
- package/src/adapters/imports/resolve.ts +14 -1
- package/src/adapters/knip/configuration.ts +5 -3
- package/src/adapters/knip/entryPointFindings.ts +1 -1
- package/src/adapters/knip/report.ts +1 -1
- package/src/adapters/knip/run.ts +5 -5
- package/src/adapters/moduleResolver.ts +23 -0
- package/src/adapters/nativeTransactionFindings.ts +1 -1
- package/src/adapters/positiveRefusalFindings.ts +1 -1
- package/src/adapters/queueReadoutFindings.ts +3 -3
- package/src/adapters/reachableBuildEntries.ts +7 -6
- package/src/adapters/reactComponent.ts +72 -0
- package/src/adapters/rule.ts +1 -1
- package/src/adapters/serviceAccess.ts +1 -1
- package/src/adapters/serviceStateProblems.ts +2 -1
- package/src/adapters/spawnedEntries.ts +3 -3
- package/src/adapters/specReaderSources.ts +1 -1
- package/src/adapters/testProjects.ts +1 -1
- package/src/adapters/units/runtime.ts +2 -2
- package/src/adapters/units/runtimeOrigins.ts +1 -1
- package/src/adapters/units/runtimeUse.ts +1 -1
- package/src/adapters/vitestContractPaths.ts +25 -0
- package/src/baseline/compare.ts +1 -1
- package/src/baseline/legacy.ts +2 -2
- package/src/baseline/looseStagedEntries.ts +3 -3
- package/src/baseline/rewrite.ts +1 -1
- package/src/baseline/update.ts +2 -2
- package/src/biome/nativeEffectCall.ts +1 -1
- package/src/biome/recognizeDiagnostics.ts +29 -8
- package/src/biome/report.ts +3 -2
- package/src/biome/withoutEntryPointImports.ts +1 -1
- package/src/cli/args.ts +2 -2
- package/src/cli/fix.ts +1 -1
- package/src/cli/program.ts +1 -1
- package/src/cli/shrink.ts +1 -1
- package/src/config/load.ts +3 -3
- package/src/config/resolve.ts +1 -1
- package/src/decoded.ts +1 -1
- package/src/docs/documentedImports.ts +1 -1
- package/src/docs/headingAnchors.ts +1 -1
- package/src/docs/importFindings.ts +3 -3
- package/src/docs/linkFindings.ts +3 -3
- package/src/docs/markdownLinks.ts +1 -1
- package/src/engine/evaluate.ts +1 -1
- package/src/engine/runRules.ts +1 -1
- package/src/engine/session.ts +3 -3
- package/src/exceptions/migrateConfig.ts +1 -1
- package/src/exceptions/registryEntries.ts +2 -2
- package/src/git/base.ts +1 -1
- package/src/git/history.ts +1 -1
- package/src/hooks/forwarding.ts +2 -2
- package/src/hooks/install.ts +5 -5
- package/src/hooks/setup.ts +1 -1
- package/src/hooks/shim.ts +1 -1
- package/src/hooks/status.ts +3 -3
- package/src/hooks/uninstall.ts +3 -3
- package/src/imports/adminEvidence.ts +1 -1
- package/src/imports/adminFindings.ts +2 -2
- package/src/imports/browserGlobals.ts +1 -1
- package/src/imports/classifyRuntime.ts +3 -3
- package/src/imports/departures.ts +2 -2
- package/src/imports/extract.ts +3 -17
- package/src/imports/fences/check.ts +3 -3
- package/src/imports/fences/compilePolicy.ts +3 -3
- package/src/imports/fences/declarations.ts +1 -1
- package/src/imports/fences/discover.ts +2 -2
- package/src/imports/fences/evaluate.ts +4 -4
- package/src/imports/fences/match.ts +1 -1
- package/src/imports/fences/reach.ts +1 -1
- package/src/imports/fences/selectors.ts +1 -1
- package/src/imports/fences/vocabulary.ts +2 -2
- package/src/imports/graph.ts +3 -3
- package/src/imports/nodePlatformBarrels.ts +1 -1
- package/src/imports/runtime.ts +2 -2
- package/src/imports/testComposition.ts +2 -2
- package/src/imports/withoutGenerated.ts +1 -1
- package/src/imports/workspace.ts +2 -2
- package/src/inventory/collect.ts +6 -6
- package/src/inventory/routeFiles.ts +3 -3
- package/src/inventory/walk.ts +3 -3
- package/src/naming/developmentCode.ts +21 -0
- package/src/naming/isMigrationFile.ts +1 -1
- package/src/naming/nativeNames.ts +1 -1
- package/src/naming/testCode.ts +5 -3
- package/src/report/render.ts +2 -2
- package/src/report/staleSections.ts +1 -1
- package/src/rules/builtIn.ts +12 -12
- package/src/rules/comments/definePattern.ts +2 -2
- package/src/rules/comments/kinds.ts +1 -1
- package/src/rules/comments/maxPerFile.ts +2 -2
- package/src/rules/comments/noBanner.ts +1 -1
- package/src/rules/comments/noEnvironmentPragma.ts +1 -1
- package/src/rules/comments/noJsdoc.ts +2 -2
- package/src/rules/comments/noLineReference.ts +1 -1
- package/src/rules/comments/noPrReference.ts +1 -1
- package/src/rules/comments/noTodo.ts +1 -1
- package/src/rules/effect/failureFindings.ts +2 -2
- package/src/rules/effect/failureHonesty.ts +2 -2
- package/src/rules/effect/failureOperations.ts +1 -1
- package/src/rules/effect/serviceFindings.ts +4 -0
- package/src/rules/effect/serviceParameters.ts +1 -1
- package/src/rules/effect/serviceTypes.ts +1 -0
- package/src/rules/effect/successRecovery.ts +1 -1
- package/src/rules/files/otherNames.ts +1 -1
- package/src/rules/files/stylesheetImporters.ts +1 -1
- package/src/rules/imports/aliased.ts +5 -5
- package/src/rules/imports/manifest.ts +7 -2
- package/src/rules/imports/noTestCode.ts +5 -2
- package/src/rules/manifestsDependencyPins.ts +2 -3
- package/src/rules/noBarrel.ts +2 -2
- package/src/rules/react/jsxConditionals.ts +1 -1
- package/src/rules/secondNames.ts +1 -1
- package/src/rules/stories/adapterOnlyFakes.ts +1 -1
- package/src/rules/stories/adapters/authTables.ts +1 -1
- package/src/rules/stories/adapters/realTime.ts +1 -1
- package/src/rules/stories/adapters/sqlTables.ts +1 -1
- package/src/rules/stories/authSql.ts +2 -2
- package/src/rules/stories/domainOutcomes.ts +4 -4
- package/src/rules/stories/engine.ts +4 -4
- package/src/rules/stories/fakeImplementation.ts +1 -1
- package/src/rules/stories/fakeReplacements.ts +2 -2
- package/src/rules/stories/globalRetries.ts +4 -4
- package/src/rules/stories/groupedOutcomes.ts +3 -3
- package/src/rules/stories/httpStatus.ts +2 -2
- package/src/rules/stories/namedValues.ts +2 -2
- package/src/rules/stories/noExpect.ts +2 -2
- package/src/rules/stories/noLimitImports.ts +2 -2
- package/src/rules/stories/origins.ts +4 -4
- package/src/rules/stories/positiveRefusals.ts +2 -2
- package/src/rules/stories/queueSql.ts +1 -1
- package/src/rules/stories/registersTests.ts +1 -1
- package/src/rules/stories/retryOption.ts +1 -1
- package/src/rules/stories/setup.ts +1 -1
- package/src/rules/stories/sources.ts +2 -2
- package/src/rules/stories/specHelpers.ts +2 -2
- package/src/rules/stories/specs.ts +3 -3
- package/src/rules/stories/sqlText.ts +1 -1
- package/src/rules/stories/unitTests.ts +3 -3
- package/src/rules/stories/waitOnEvents.ts +3 -3
- package/src/rules/suppressions/biome/ConsumerDeclaration.ts +1 -1
- package/src/rules/suppressions/biome/weakenings.ts +2 -2
- package/src/rules/suppressions/noDoubleCast.ts +2 -2
- package/src/rules/suppressions/noInline.ts +2 -2
- package/src/testing/adapters/hookRepository.ts +5 -9
- package/src/testing/adapters/packageExports.ts +1 -1
- package/src/testing/adapters/qualityTree.ts +1 -1
- package/src/testing/adapters/storySpecFiles.ts +1 -1
- package/src/testing/adapters/writePackageExports.ts +1 -1
|
@@ -2,6 +2,26 @@ import ts from "typescript";
|
|
|
2
2
|
import { effectApi, resolvedValue } from "#adapters/serviceModelSyntax.ts";
|
|
3
3
|
import { boundaryReference } from "#rules/effect/boundaryReference.ts";
|
|
4
4
|
|
|
5
|
+
const COMPOSERS = new Set(["effect.Context.merge", "effect/Context.merge", "effect.Scope.provide", "effect/Scope.provide"]);
|
|
6
|
+
|
|
7
|
+
function compositionInputs(checker: ts.TypeChecker, call: ts.CallExpression): readonly ts.Expression[] | undefined {
|
|
8
|
+
if (COMPOSERS.has(boundaryReference(checker, call.expression) ?? "")) {
|
|
9
|
+
return call.arguments;
|
|
10
|
+
}
|
|
11
|
+
if (ts.isCallExpression(call.expression) && COMPOSERS.has(boundaryReference(checker, call.expression.expression) ?? "")) {
|
|
12
|
+
return [...call.expression.arguments, ...call.arguments];
|
|
13
|
+
}
|
|
14
|
+
if (ts.isPropertyAccessExpression(call.expression) && call.expression.name.text === "pipe") {
|
|
15
|
+
const composers = call.arguments.filter(
|
|
16
|
+
(argument) => ts.isCallExpression(argument) && COMPOSERS.has(boundaryReference(checker, argument.expression) ?? ""),
|
|
17
|
+
);
|
|
18
|
+
if (composers.length > 0) {
|
|
19
|
+
return [call.expression.expression, ...composers.flatMap((composer) => (ts.isCallExpression(composer) ? [...composer.arguments] : []))];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
5
25
|
function closedEffect(checker: ts.TypeChecker, node: ts.Node): boolean {
|
|
6
26
|
const brand = checker.getTypeAtLocation(node).getProperty("~effect/Effect");
|
|
7
27
|
const requirement = brand === undefined ? undefined : checker.getTypeOfSymbol(brand).getProperty("_R");
|
|
@@ -17,24 +37,7 @@ function layerProvision(checker: ts.TypeChecker, node: ts.Node): boolean {
|
|
|
17
37
|
);
|
|
18
38
|
}
|
|
19
39
|
|
|
20
|
-
|
|
21
|
-
const value = resolvedValue(checker, environment);
|
|
22
|
-
if (!(ts.isYieldExpression(value) && value.expression !== undefined && ts.isCallExpression(value.expression))) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
const acquisition = value.expression;
|
|
26
|
-
const reference = boundaryReference(checker, acquisition.expression);
|
|
27
|
-
if (
|
|
28
|
-
reference === "effect.Layer.build"
|
|
29
|
-
|| reference === "effect/Layer.build"
|
|
30
|
-
|| reference === "effect.Layer.buildWithScope"
|
|
31
|
-
|| reference === "effect/Layer.buildWithScope"
|
|
32
|
-
) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
if (!effectApi(checker, acquisition.expression, "context")) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
40
|
+
function fullyProvided(checker: ts.TypeChecker, value: ts.Node): boolean {
|
|
38
41
|
let provided = false;
|
|
39
42
|
for (let ancestor: ts.Node | undefined = value.parent; ancestor !== undefined; ancestor = ancestor.parent) {
|
|
40
43
|
if (ts.isCallExpression(ancestor)) {
|
|
@@ -46,3 +49,24 @@ export function composedContext(checker: ts.TypeChecker, environment: ts.Express
|
|
|
46
49
|
}
|
|
47
50
|
return false;
|
|
48
51
|
}
|
|
52
|
+
|
|
53
|
+
export function composedContext(checker: ts.TypeChecker, environment: ts.Expression, seen = new Set<ts.Node>()): boolean {
|
|
54
|
+
const value = resolvedValue(checker, environment);
|
|
55
|
+
if (seen.has(value)) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
seen.add(value);
|
|
59
|
+
const acquisition = ts.isYieldExpression(value) ? value.expression : value;
|
|
60
|
+
if (acquisition === undefined || !ts.isCallExpression(acquisition)) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
const reference = boundaryReference(checker, acquisition.expression);
|
|
64
|
+
const inputs = compositionInputs(checker, acquisition);
|
|
65
|
+
if (inputs !== undefined) {
|
|
66
|
+
return inputs.some((argument) => composedContext(checker, argument, seen));
|
|
67
|
+
}
|
|
68
|
+
if (["effect.Layer.build", "effect/Layer.build", "effect.Layer.buildWithScope", "effect/Layer.buildWithScope"].includes(reference ?? "")) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
return effectApi(checker, acquisition.expression, "context") && fullyProvided(checker, value);
|
|
72
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
|
+
import { databaseUrlReads } from "#adapters/databaseUrlReads.ts";
|
|
4
|
+
import { storyProgram } from "#adapters/storyProgram.ts";
|
|
3
5
|
import { importGraph } from "#imports/graph.ts";
|
|
4
6
|
import { isTestSupport } from "#naming/testName.ts";
|
|
5
7
|
import type { RuleInputs } from "#rule.ts";
|
|
6
8
|
import { findingAt } from "#rules/stories/syntax.ts";
|
|
7
|
-
import { databaseUrlReads } from "./databaseUrlReads.ts";
|
|
8
|
-
import { storyProgram } from "./storyProgram.ts";
|
|
9
9
|
|
|
10
10
|
const MESSAGE =
|
|
11
11
|
"Reads a *DATABASE_URL variable directly in test-support. Use postgresTestUrl(name) from @shivaedev/test-sql/server/adapters/postgresTestUrl.ts so missing PostgreSQL URLs fail in CI instead of silently skipping tests.";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { posix } from "node:path";
|
|
2
2
|
import ts from "typescript";
|
|
3
|
+
import type { BodyReference } from "#adapters/bodyReference.ts";
|
|
4
|
+
import { bodyReferences, storyBody } from "#adapters/bodyReferences.ts";
|
|
5
|
+
import { serviceAccess } from "#adapters/serviceAccess.ts";
|
|
3
6
|
import { isTestSupport, testName } from "#naming/testName.ts";
|
|
4
7
|
import { engineOf } from "#rules/stories/engineOf.ts";
|
|
5
8
|
import { memberName, unwrapped } from "#rules/stories/syntax.ts";
|
|
6
|
-
import type { BodyReference } from "./bodyReference.ts";
|
|
7
|
-
import { bodyReferences, storyBody } from "./bodyReferences.ts";
|
|
8
|
-
import { serviceAccess } from "./serviceAccess.ts";
|
|
9
9
|
|
|
10
10
|
export interface EngineEscape {
|
|
11
11
|
readonly node: ts.Node;
|
|
@@ -33,6 +33,12 @@ function acquisition(checker: ts.TypeChecker, node: ts.CallExpression | ts.NewEx
|
|
|
33
33
|
if (signature?.declaration !== undefined && foreign(signature.declaration)) {
|
|
34
34
|
return true;
|
|
35
35
|
}
|
|
36
|
+
if (ts.isCallExpression(node)) {
|
|
37
|
+
const factory = resolvedValue(checker, node.expression);
|
|
38
|
+
if (ts.isFunctionLike(factory) && constructed(checker, factory, seen)) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
36
42
|
if (!(ts.isCallExpression(node) && ["promise", "tryPromise", "sync", "acquireRelease"].some((name) => effectApi(checker, node.expression, name)))) {
|
|
37
43
|
return false;
|
|
38
44
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import type ts from "typescript";
|
|
3
3
|
import { defineService } from "@shivaedev/service/defineService.ts";
|
|
4
|
-
import { browserChecker } from "
|
|
5
|
-
import { departures } from "
|
|
6
|
-
import { graph } from "
|
|
4
|
+
import { browserChecker } from "#adapters/import-compiler/browserChecker.ts";
|
|
5
|
+
import { departures } from "#adapters/import-compiler/departures.ts";
|
|
6
|
+
import { graph } from "#adapters/import-compiler/graph.ts";
|
|
7
7
|
|
|
8
8
|
export const ImportCompiler = defineService({
|
|
9
9
|
id: "@shivaedev/quality/ImportCompiler",
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { realpathSync } from "node:fs";
|
|
2
2
|
import { posix } from "node:path";
|
|
3
|
+
import { type Project, projectsFor } from "#adapters/imports/projects.ts";
|
|
4
|
+
import { resolveImport } from "#adapters/imports/resolve.ts";
|
|
3
5
|
import type { Departure } from "#imports/departures.ts";
|
|
4
6
|
import type { ImportRequest } from "#imports/extract.ts";
|
|
5
7
|
import { type SpecifierSite, specifierSites } from "#imports/specifiers.ts";
|
|
6
8
|
import { packageOf, type WorkspacePackage } from "#imports/workspace.ts";
|
|
7
|
-
import { moduleRoot } from "#naming/moduleRoot.ts";
|
|
8
9
|
import type { RuleInputs } from "#rule.ts";
|
|
9
10
|
import { parse } from "#rules/parse.ts";
|
|
10
|
-
import { type Project, projectsFor } from "./projects.ts";
|
|
11
|
-
import { resolveImport } from "./resolve.ts";
|
|
12
11
|
|
|
13
12
|
const QUERY = /\?.*$/u;
|
|
14
13
|
|
|
@@ -16,17 +15,10 @@ const RELATIVE = /^\.\.?(?:\/|$)/u;
|
|
|
16
15
|
|
|
17
16
|
const MAY_BE_RELATIVE = /["'`]\.\.?[/"'`]|\\/u;
|
|
18
17
|
|
|
19
|
-
const TRAILING_SLASHES = /\/+$/u;
|
|
20
|
-
|
|
21
18
|
function noAmbient(): boolean {
|
|
22
19
|
return false;
|
|
23
20
|
}
|
|
24
21
|
|
|
25
|
-
function leavesLexically(path: string): boolean {
|
|
26
|
-
const normal = posix.normalize(path).replace(TRAILING_SLASHES, "");
|
|
27
|
-
return normal === ".." || normal.startsWith("../") || normal.includes("/");
|
|
28
|
-
}
|
|
29
|
-
|
|
30
22
|
interface FileContext {
|
|
31
23
|
readonly from: string;
|
|
32
24
|
readonly packages: readonly WorkspacePackage[];
|
|
@@ -35,19 +27,6 @@ interface FileContext {
|
|
|
35
27
|
readonly root: string;
|
|
36
28
|
}
|
|
37
29
|
|
|
38
|
-
function registersAdmin(from: string, specifier: string, target: string | undefined): boolean {
|
|
39
|
-
const root = moduleRoot(from);
|
|
40
|
-
const folder = posix.dirname(from);
|
|
41
|
-
return (
|
|
42
|
-
root !== undefined
|
|
43
|
-
&& (folder === `${root}/client` || folder === `${root}/server`)
|
|
44
|
-
&& /^registration\.[cm]?[jt]sx?$/u.test(posix.basename(from))
|
|
45
|
-
&& specifier.startsWith("./admin/")
|
|
46
|
-
&& target?.startsWith(`${folder}/admin/`) === true
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// A relative import leaves its folder when its path climbs or descends, or when it names a folder whose index file lies below.
|
|
51
30
|
function departureAt(context: FileContext, site: SpecifierSite): Departure | undefined {
|
|
52
31
|
const path = site.specifier.replace(QUERY, "");
|
|
53
32
|
if (!RELATIVE.test(path)) {
|
|
@@ -56,12 +35,6 @@ function departureAt(context: FileContext, site: SpecifierSite): Departure | und
|
|
|
56
35
|
const request: ImportRequest = { kind: "import", line: site.line, specifier: site.specifier, type: site.type };
|
|
57
36
|
const target = resolveImport(context.root, noAmbient, request, context.from, context.project);
|
|
58
37
|
const local = target?.kind === "file" ? target.path : undefined;
|
|
59
|
-
if (registersAdmin(context.path, path, local)) {
|
|
60
|
-
return undefined;
|
|
61
|
-
}
|
|
62
|
-
if (!(leavesLexically(path) || (local !== undefined && posix.dirname(local) !== posix.dirname(context.path)))) {
|
|
63
|
-
return undefined;
|
|
64
|
-
}
|
|
65
38
|
const owner = local === undefined ? undefined : packageOf(context.packages, local);
|
|
66
39
|
const workspace = owner !== undefined && owner !== packageOf(context.packages, context.path) ? owner.name : undefined;
|
|
67
40
|
return { ...site, file: context.path, installed: target?.kind === "external" ? target.package : undefined, workspace };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { realpathSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
+
import { projectsFor } from "#adapters/imports/projects.ts";
|
|
4
|
+
import { resolveImport } from "#adapters/imports/resolve.ts";
|
|
3
5
|
import type { RuleInputs } from "#rule.ts";
|
|
4
|
-
import { projectsFor } from "./projects.ts";
|
|
5
|
-
import { resolveImport } from "./resolve.ts";
|
|
6
6
|
|
|
7
7
|
export interface FakeModule {
|
|
8
8
|
readonly file: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { join, posix } from "node:path";
|
|
2
2
|
import ts from "typescript";
|
|
3
|
+
import { type Project, projectsFor } from "#adapters/imports/projects.ts";
|
|
4
|
+
import { isDeclarationFile, presumedTarget, resolveImport } from "#adapters/imports/resolve.ts";
|
|
3
5
|
import { ambientModules } from "#imports/ambient.ts";
|
|
4
6
|
import { type ImportRequest, importsOf } from "#imports/extract.ts";
|
|
5
7
|
import type { ImportEdge, ImportGraph, UnresolvedImport } from "#imports/graph.ts";
|
|
6
8
|
import type { RuleInputs } from "#rule.ts";
|
|
7
9
|
import { parse } from "#rules/parse.ts";
|
|
8
|
-
import { type Project, projectsFor } from "./projects.ts";
|
|
9
|
-
import { isDeclarationFile, presumedTarget, resolveImport } from "./resolve.ts";
|
|
10
10
|
|
|
11
11
|
const QUERY = /\?.*$/u;
|
|
12
12
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { realpathSync } from "node:fs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
2
3
|
import { dirname, join, relative } from "node:path";
|
|
3
4
|
import ts from "typescript";
|
|
5
|
+
import type { Project } from "#adapters/imports/projects.ts";
|
|
4
6
|
import type { Ambient } from "#imports/ambient.ts";
|
|
5
7
|
import type { Endpoint } from "#imports/Endpoint.ts";
|
|
6
8
|
import type { ImportRequest } from "#imports/extract.ts";
|
|
7
9
|
import { builtinName, nameAt, packageNameOf } from "#imports/packageName.ts";
|
|
8
10
|
import { posix } from "#inventory/ignoreScope.ts";
|
|
9
|
-
import type { Project } from "./projects.ts";
|
|
10
11
|
|
|
11
12
|
const NODE_MODULES = "/node_modules/";
|
|
12
13
|
|
|
@@ -47,6 +48,17 @@ function fitting(resolved: string, type: boolean): string | undefined {
|
|
|
47
48
|
return type || !isDeclarationFile(resolved) ? resolved : undefined;
|
|
48
49
|
}
|
|
49
50
|
|
|
51
|
+
function nativeResolution(request: ImportRequest, from: string): string | undefined {
|
|
52
|
+
if (request.kind !== "resolve") {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
return createRequire(from).resolve(request.specifier.replace(QUERY, ""));
|
|
57
|
+
} catch {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
50
62
|
function located(request: ImportRequest, from: string, project: Project): string | undefined {
|
|
51
63
|
const specifier = request.specifier.replace(QUERY, "");
|
|
52
64
|
if (request.kind === "type-reference") {
|
|
@@ -60,6 +72,7 @@ function located(request: ImportRequest, from: string, project: Project): string
|
|
|
60
72
|
ts.resolveModuleName(specifier, from, project.options, ts.sys, project.cache, undefined, request.mode).resolvedModule?.resolvedFileName
|
|
61
73
|
?? ts.resolveModuleName(specifier, from, project.typesOptions, assetHost, project.typesCache, undefined, request.mode).resolvedModule
|
|
62
74
|
?.resolvedFileName
|
|
75
|
+
?? nativeResolution(request, from)
|
|
63
76
|
);
|
|
64
77
|
}
|
|
65
78
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { posix } from "node:path";
|
|
2
|
+
import { isToolConfig } from "#adapters/isToolConfig.ts";
|
|
3
|
+
import { KNIP_ISSUES } from "#adapters/knip/findings.ts";
|
|
4
|
+
import { mockEntries } from "#adapters/knip/mockEntries.ts";
|
|
2
5
|
import { readPackageManifest } from "#adapters/manifestInventory.ts";
|
|
3
6
|
import { scriptPaths } from "#adapters/scriptPaths.ts";
|
|
4
7
|
import { exportedModule, exportTargets } from "#imports/packageExports.ts";
|
|
5
8
|
import { packageOf, workspacePackages } from "#imports/workspace.ts";
|
|
6
9
|
import type { RuleInputs } from "#rule.ts";
|
|
7
|
-
import { KNIP_ISSUES } from "./findings.ts";
|
|
8
|
-
import { mockEntries } from "./mockEntries.ts";
|
|
9
10
|
|
|
10
11
|
const ENTRIES = ["**/*.{test,spec,stories,story}.{ts,tsx,mts,cts,js,jsx,mjs,cjs}", "src/test-support/**", "*.config.{ts,mts,cts,js,mjs,cjs}"];
|
|
11
12
|
|
|
@@ -47,6 +48,7 @@ export async function knipConfiguration(inputs: RuleInputs, toolOwned: readonly
|
|
|
47
48
|
(path) => bins.includes(path) || bins.includes(path.replace(/^src\//u, "dist/").replace(/\.(?<mode>[cm]?)tsx?$/u, ".$<mode>js")),
|
|
48
49
|
);
|
|
49
50
|
const publicFiles = sources.filter((path) => exportedModule(manifest.exports, path));
|
|
51
|
+
const configs = sources.filter(isToolConfig);
|
|
50
52
|
// Migration runners load these files from their directory, so no import reaches them.
|
|
51
53
|
const migrations = sources.filter((path) => /(?:^|\/)server\/migrations\//u.test(path));
|
|
52
54
|
const ui = toolOwned.filter((file) => (packageOf(packages, file)?.directory ?? ".") === directory).map((file) => posix.relative(directory, file));
|
|
@@ -56,7 +58,7 @@ export async function knipConfiguration(inputs: RuleInputs, toolOwned: readonly
|
|
|
56
58
|
return [
|
|
57
59
|
directory,
|
|
58
60
|
{
|
|
59
|
-
entry: [...ENTRIES, ...publicFiles, ...migrations, ...bins, ...binaries, ...scriptEntries, ...bundled, ...ui, ...styles],
|
|
61
|
+
entry: [...ENTRIES, ...publicFiles, ...configs, ...migrations, ...bins, ...binaries, ...scriptEntries, ...bundled, ...ui, ...styles],
|
|
60
62
|
paths: importPaths(manifest.imports ?? {}),
|
|
61
63
|
project: [...sources, ...ui, ...styles],
|
|
62
64
|
vitest: { config: ["vitest*.config.{ts,mts,cts,js,mjs,cjs}", "vitest.{workspace,projects}.{ts,mts,cts,js,mjs,cjs,json}"] },
|
|
@@ -71,7 +71,7 @@ export const entryPointFindings = Effect.fn("Knip.entryPointFindings")(function*
|
|
|
71
71
|
const consumer = owner(edge.from);
|
|
72
72
|
const supplied = provider(policies.get(consumer) ?? [], target, development(consumer, edge.from), true);
|
|
73
73
|
return consumer === directory
|
|
74
|
-
? supplied?.name === name
|
|
74
|
+
? (edge.kind === "resolve" && target === name) || supplied?.name === name
|
|
75
75
|
: supplied !== undefined && workspace.get(supplied.name) === directory && target === name;
|
|
76
76
|
});
|
|
77
77
|
});
|
package/src/adapters/knip/run.ts
CHANGED
|
@@ -4,15 +4,15 @@ import process from "node:process";
|
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import { Effect, FileSystem, Stream } from "effect";
|
|
6
6
|
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
7
|
+
import { knipConfiguration } from "#adapters/knip/configuration.ts";
|
|
8
|
+
import { entryPointFindings } from "#adapters/knip/entryPointFindings.ts";
|
|
9
|
+
import { KNIP_ISSUES } from "#adapters/knip/findings.ts";
|
|
10
|
+
import { knipReport } from "#adapters/knip/report.ts";
|
|
11
|
+
import { sourceConfig } from "#adapters/knip/sourceConfig.ts";
|
|
7
12
|
import { readPackageManifest } from "#adapters/manifestInventory.ts";
|
|
8
13
|
import { programmaticEntries } from "#inventory/programmaticEntries.ts";
|
|
9
14
|
import { toolOwnedFiles } from "#inventory/toolOwnedFiles.ts";
|
|
10
15
|
import type { RuleInputs } from "#rule.ts";
|
|
11
|
-
import { knipConfiguration } from "./configuration.ts";
|
|
12
|
-
import { entryPointFindings } from "./entryPointFindings.ts";
|
|
13
|
-
import { KNIP_ISSUES } from "./findings.ts";
|
|
14
|
-
import { knipReport } from "./report.ts";
|
|
15
|
-
import { sourceConfig } from "./sourceConfig.ts";
|
|
16
16
|
|
|
17
17
|
const API = createRequire(import.meta.url).resolve("knip");
|
|
18
18
|
const BIN = join(dirname(API), "..", "bin", "knip.js");
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { importedCall } from "#adapters/importedCall.ts";
|
|
3
|
+
|
|
4
|
+
function isImportMeta(node: ts.Expression): boolean {
|
|
5
|
+
return ts.isMetaProperty(node) && node.keywordToken === ts.SyntaxKind.ImportKeyword && node.name.text === "meta";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function moduleResolver(call: ts.CallExpression): "meta" | "require" | undefined {
|
|
9
|
+
const callee = call.expression;
|
|
10
|
+
if (!ts.isPropertyAccessExpression(callee) || callee.name.text !== "resolve") {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
if (ts.isIdentifier(callee.expression) && callee.expression.text === "require") {
|
|
14
|
+
return "require";
|
|
15
|
+
}
|
|
16
|
+
if (ts.isCallExpression(callee.expression)) {
|
|
17
|
+
const factory = importedCall(callee.expression);
|
|
18
|
+
if (factory?.name === "createRequire" && /^(?:node:)?module$/u.test(factory.module)) {
|
|
19
|
+
return "require";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return isImportMeta(callee.expression) ? "meta" : undefined;
|
|
23
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import ts from "typescript";
|
|
4
|
+
import { transactionChanges } from "#adapters/transactionChanges.ts";
|
|
4
5
|
import type { Finding, RuleInputs } from "#rule.ts";
|
|
5
6
|
import { effectProgram } from "#rules/effect/program.ts";
|
|
6
7
|
import { parse } from "#rules/parse.ts";
|
|
7
8
|
import { memberName, nodesWhere, unwrapped } from "#rules/stories/syntax.ts";
|
|
8
|
-
import { transactionChanges } from "./transactionChanges.ts";
|
|
9
9
|
|
|
10
10
|
function candidates(source: ts.SourceFile): readonly ts.Node[] {
|
|
11
11
|
const aliases = new Set(["withTransaction"]);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
+
import { type OutcomeAssertion, outcomeAssertions } from "#adapters/outcomeAssertions.ts";
|
|
2
3
|
import type { Finding, SourceFile } from "#rule.ts";
|
|
3
4
|
import type { storyOrigins } from "#rules/stories/origins.ts";
|
|
4
5
|
import { nodesWhere, unwrapped } from "#rules/stories/syntax.ts";
|
|
5
|
-
import { type OutcomeAssertion, outcomeAssertions } from "./outcomeAssertions.ts";
|
|
6
6
|
|
|
7
7
|
const MESSAGE =
|
|
8
8
|
"Only rules out an outcome. Assert the expected refusal's domain reason or public response positively on the same outcome in this story; an unrelated failure must fail the story too.";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import ts from "typescript";
|
|
4
|
+
import { readPackageManifest } from "#adapters/manifestInventory.ts";
|
|
5
|
+
import { queueTestingOrigin } from "#adapters/queueTestingOrigin.ts";
|
|
6
|
+
import { storyProgram } from "#adapters/storyProgram.ts";
|
|
4
7
|
import { importGraph } from "#imports/graph.ts";
|
|
5
8
|
import { packageOf } from "#imports/workspace.ts";
|
|
6
9
|
import { isTestCode } from "#naming/testName.ts";
|
|
7
10
|
import type { RuleInputs } from "#rule.ts";
|
|
8
11
|
import { nodesWhere } from "#rules/stories/syntax.ts";
|
|
9
|
-
import { readPackageManifest } from "./manifestInventory.ts";
|
|
10
|
-
import { queueTestingOrigin } from "./queueTestingOrigin.ts";
|
|
11
|
-
import { storyProgram } from "./storyProgram.ts";
|
|
12
12
|
|
|
13
13
|
const MESSAGE =
|
|
14
14
|
"Reads jobs-testing queue storage. An enqueued job or its state does not prove the work ran. Assert the application's visible result instead; use jobs-testing only to control and settle workers.";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { bundlerEntries } from "#adapters/bundlerEntries.ts";
|
|
2
|
+
import { bundlerSources } from "#adapters/bundlerSources.ts";
|
|
3
|
+
import { spawnedEntries } from "#adapters/spawnedEntries.ts";
|
|
1
4
|
import type { ImportGraph } from "#imports/graph.ts";
|
|
2
5
|
import type { PackageLayout } from "#naming/packageLayout.ts";
|
|
3
6
|
import type { RuleInputs } from "#rule.ts";
|
|
4
|
-
import { bundlerEntries } from "./bundlerEntries.ts";
|
|
5
|
-
import { spawnedEntries } from "./spawnedEntries.ts";
|
|
6
7
|
|
|
7
8
|
function scriptsByPackage(layout: PackageLayout): ReadonlyMap<string, readonly string[]> {
|
|
8
9
|
const scripts = new Map<string, string[]>();
|
|
@@ -41,6 +42,7 @@ function importsOf(graph: ImportGraph): ReadonlyMap<string, readonly string[]> {
|
|
|
41
42
|
export function reachableBuildEntries(inputs: RuleInputs, graph: ImportGraph, layout: PackageLayout): ReadonlySet<string> {
|
|
42
43
|
const imports = importsOf(graph);
|
|
43
44
|
const sources = new Map(inputs.sources.map((source) => [source.path, source]));
|
|
45
|
+
const syntax = bundlerSources(inputs.sources, graph);
|
|
44
46
|
const entries = new Set<string>();
|
|
45
47
|
for (const [directory, scripts] of scriptsByPackage(layout)) {
|
|
46
48
|
for (const path of reachable(scripts, imports)) {
|
|
@@ -48,10 +50,9 @@ export function reachableBuildEntries(inputs: RuleInputs, graph: ImportGraph, la
|
|
|
48
50
|
if (source === undefined) {
|
|
49
51
|
continue;
|
|
50
52
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
53
|
+
const bundled = syntax.has(path) ? bundlerEntries(source, inputs.root, directory, syntax) : [];
|
|
54
|
+
for (const entry of [...bundled, ...spawnedEntries(source, inputs.root, directory)].filter((target) => sources.has(target))) {
|
|
55
|
+
entries.add(entry);
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { browserLibraryType } from "#adapters/browserLibraryType.ts";
|
|
3
|
+
|
|
4
|
+
function reactResult(type: ts.Type): boolean {
|
|
5
|
+
const named = [type.getSymbol(), type.aliasSymbol].some(
|
|
6
|
+
(symbol) =>
|
|
7
|
+
["ReactNode", "ReactElement", "Element", "ReactPortal"].includes(symbol?.name ?? "")
|
|
8
|
+
&& (symbol?.declarations ?? []).some((declaration) =>
|
|
9
|
+
/\/node_modules\/(?:@types\/)?react\//u.test(declaration.getSourceFile().fileName.replaceAll("\\", "/")),
|
|
10
|
+
),
|
|
11
|
+
);
|
|
12
|
+
if (named || !type.isUnion()) {
|
|
13
|
+
return named;
|
|
14
|
+
}
|
|
15
|
+
const elements = type.types.filter(
|
|
16
|
+
(part) =>
|
|
17
|
+
!(part.flags & (ts.TypeFlags.Null | ts.TypeFlags.Undefined | ts.TypeFlags.StringLike | ts.TypeFlags.NumberLike | ts.TypeFlags.BooleanLike)),
|
|
18
|
+
);
|
|
19
|
+
return elements.length > 0 && elements.every(reactResult);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function reactComponent(checker: ts.TypeChecker, node: ts.Node): boolean {
|
|
23
|
+
if (!(ts.isFunctionDeclaration(node) || ts.isArrowFunction(node) || ts.isFunctionExpression(node)) || node.parameters.length !== 1) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const declaration = ts.isVariableDeclaration(node.parent) ? node.parent : node;
|
|
27
|
+
const name = declaration.name;
|
|
28
|
+
const statement = ts.isVariableDeclaration(declaration) ? declaration.parent.parent : declaration;
|
|
29
|
+
if (name === undefined || !ts.isIdentifier(name) || !/^[A-Z]/u.test(name.text) || !ts.isSourceFile(statement.parent)) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
const signature = checker.getSignatureFromDeclaration(node);
|
|
33
|
+
return signature !== undefined && reactResult(signature.getReturnType());
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function propSignature(signature: ts.Signature): readonly ts.ParameterDeclaration[] {
|
|
37
|
+
const declaration = signature.declaration;
|
|
38
|
+
return declaration !== undefined
|
|
39
|
+
&& (ts.isFunctionTypeNode(declaration) || ts.isMethodSignature(declaration) || ts.isCallSignatureDeclaration(declaration))
|
|
40
|
+
? declaration.parameters
|
|
41
|
+
: [];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function reactPropParameters(checker: ts.TypeChecker, sources: readonly ts.SourceFile[]): ReadonlySet<ts.ParameterDeclaration> {
|
|
45
|
+
const parameters = new Set<ts.ParameterDeclaration>();
|
|
46
|
+
const seen = new Set<ts.Type>();
|
|
47
|
+
function props(type: ts.Type): void {
|
|
48
|
+
if (seen.has(type) || browserLibraryType(type)) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
seen.add(type);
|
|
52
|
+
for (const signature of type.getCallSignatures()) {
|
|
53
|
+
for (const parameter of propSignature(signature)) {
|
|
54
|
+
parameters.add(parameter);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (type.isUnionOrIntersection()) {
|
|
58
|
+
type.types.forEach(props);
|
|
59
|
+
}
|
|
60
|
+
for (const property of type.getProperties()) {
|
|
61
|
+
props(checker.getTypeOfSymbol(property));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function visit(node: ts.Node): void {
|
|
65
|
+
if (reactComponent(checker, node) && ts.isFunctionLike(node) && node.parameters[0] !== undefined) {
|
|
66
|
+
props(checker.getTypeAtLocation(node.parameters[0]));
|
|
67
|
+
}
|
|
68
|
+
ts.forEachChild(node, visit);
|
|
69
|
+
}
|
|
70
|
+
sources.forEach(visit);
|
|
71
|
+
return parameters;
|
|
72
|
+
}
|
package/src/adapters/rule.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
+
import { describeIssue, type StandardSchemaV1 } from "#adapters/standardSchema.ts";
|
|
2
3
|
import { validOrFail } from "#decoded.ts";
|
|
3
4
|
import type { Configured, Findings, RegisteredRule, RuleContext } from "#rule.ts";
|
|
4
|
-
import { describeIssue, type StandardSchemaV1 } from "./standardSchema.ts";
|
|
5
5
|
|
|
6
6
|
export type RuleCheckResult<TServices> = Findings | PromiseLike<Findings> | Effect.Effect<Findings, unknown, TServices>;
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { basename } from "node:path";
|
|
2
2
|
import ts from "typescript";
|
|
3
|
-
import type { BodyReference } from "
|
|
3
|
+
import type { BodyReference } from "#adapters/bodyReference.ts";
|
|
4
4
|
|
|
5
5
|
function nativeService({ module, path }: BodyReference): boolean {
|
|
6
6
|
const name = path[0];
|
|
@@ -2,6 +2,7 @@ import ts from "typescript";
|
|
|
2
2
|
import { containerDependency } from "#adapters/containerDependency.ts";
|
|
3
3
|
import { serviceProperty } from "#adapters/serviceAssemblySyntax.ts";
|
|
4
4
|
import { effectApi, effectSuccess, resolvedValue } from "#adapters/serviceModelSyntax.ts";
|
|
5
|
+
import { boundaryReference } from "#rules/effect/boundaryReference.ts";
|
|
5
6
|
import type { serviceTypes } from "#rules/effect/serviceTypes.ts";
|
|
6
7
|
import { returnValues } from "#rules/stories/returnValues.ts";
|
|
7
8
|
|
|
@@ -17,7 +18,7 @@ function capturesDependency(
|
|
|
17
18
|
}
|
|
18
19
|
seen.add(value);
|
|
19
20
|
if (ts.isYieldExpression(value) && value.expression !== undefined && services.carries(checker.getTypeAtLocation(value.expression))) {
|
|
20
|
-
return
|
|
21
|
+
return !["effect.Scope.Scope", "effect/Scope.Scope"].includes(boundaryReference(checker, value.expression) ?? "");
|
|
21
22
|
}
|
|
22
23
|
if (
|
|
23
24
|
!closing
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { posix } from "node:path";
|
|
2
2
|
import ts from "typescript";
|
|
3
|
+
import { buildEntryPaths } from "#adapters/buildEntryPaths.ts";
|
|
4
|
+
import { buildEntryValue, buildOption } from "#adapters/buildEntryValue.ts";
|
|
5
|
+
import { importedCall } from "#adapters/importedCall.ts";
|
|
3
6
|
import type { SourceFile } from "#rule.ts";
|
|
4
7
|
import { parse } from "#rules/parse.ts";
|
|
5
|
-
import { buildEntryPaths } from "./buildEntryPaths.ts";
|
|
6
|
-
import { buildEntryValue, buildOption } from "./buildEntryValue.ts";
|
|
7
|
-
import { importedCall } from "./importedCall.ts";
|
|
8
8
|
|
|
9
9
|
const COMMANDS = new Set(["spawn", "spawnSync", "execFile", "execFileSync", "fork"]);
|
|
10
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
+
import { asymmetricMatcher } from "#adapters/asymmetricMatcher.ts";
|
|
2
3
|
import type { SourceFile } from "#rule.ts";
|
|
3
4
|
import { parse } from "#rules/parse.ts";
|
|
4
5
|
import { topLevelHelpers, unwrapped } from "#rules/stories/syntax.ts";
|
|
5
|
-
import { asymmetricMatcher } from "./asymmetricMatcher.ts";
|
|
6
6
|
|
|
7
7
|
const READ_METHODS = new Set([
|
|
8
8
|
"at",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import { coverageConfigDefaults, defaultExclude, type TestUserConfig } from "vitest/config";
|
|
4
|
+
import { TestOutput } from "#adapters/TestOutput.ts";
|
|
4
5
|
import type { Environment } from "#naming/testName.ts";
|
|
5
|
-
import { TestOutput } from "./TestOutput.ts";
|
|
6
6
|
|
|
7
7
|
const EXTENSION = "?(c|m)[jt]s?(x)";
|
|
8
8
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type ts from "typescript";
|
|
2
|
+
import { runtimeOrigins } from "#adapters/units/runtimeOrigins.ts";
|
|
3
|
+
import { firstRuntimeUse, type RuntimeUse } from "#adapters/units/runtimeUse.ts";
|
|
2
4
|
import { type Trail, walkFrom } from "#imports/fences/reach.ts";
|
|
3
5
|
import type { ImportEdge } from "#imports/graph.ts";
|
|
4
6
|
import type { Finding } from "#rule.ts";
|
|
5
|
-
import { runtimeOrigins } from "./runtimeOrigins.ts";
|
|
6
|
-
import { firstRuntimeUse, type RuntimeUse } from "./runtimeUse.ts";
|
|
7
7
|
|
|
8
8
|
export const PURE_REPAIR = "Exercise the Effect behaviour through the package story kit, or test an existing pure API without the runner.";
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
+
import { exportedRuntime, importedRuntime, type RuntimeName, runtimeImport } from "#adapters/units/runtimeImports.ts";
|
|
2
3
|
import { memberName } from "#rules/stories/syntax.ts";
|
|
3
|
-
import { exportedRuntime, importedRuntime, type RuntimeName, runtimeImport } from "./runtimeImports.ts";
|
|
4
4
|
|
|
5
5
|
function member(receiver: RuntimeName | undefined, name: string): RuntimeName | undefined {
|
|
6
6
|
return receiver === undefined ? undefined : { ...receiver, path: [...receiver.path, name] };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
-
import { type RuntimeName, runtimeImport, runtimeOf } from "
|
|
2
|
+
import { type RuntimeName, runtimeImport, runtimeOf } from "#adapters/units/runtimeImports.ts";
|
|
3
3
|
|
|
4
4
|
function moduleRuntime(node: ts.Node): string | undefined {
|
|
5
5
|
if (ts.isImportDeclaration(node) && node.importClause === undefined && ts.isStringLiteral(node.moduleSpecifier)) {
|