@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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Endpoint } from "#imports/Endpoint.ts";
|
|
2
|
+
import { type CompiledFence, compileFence, type FenceGraph } from "#imports/fences/evaluate.ts";
|
|
3
|
+
import type { PolicyScope } from "#imports/fences/match.ts";
|
|
4
|
+
import type { Chain, ExampleStep, Fence } from "#imports/fences/model.ts";
|
|
2
5
|
import type { ImportEdge } from "#imports/graph.ts";
|
|
3
6
|
import { packageNameOf } from "#imports/packageName.ts";
|
|
4
|
-
import { type CompiledFence, compileFence, type FenceGraph } from "./evaluate.ts";
|
|
5
|
-
import type { PolicyScope } from "./match.ts";
|
|
6
|
-
import type { Chain, ExampleStep, Fence } from "./model.ts";
|
|
7
7
|
|
|
8
8
|
function endpointOf(step: ExampleStep): Endpoint {
|
|
9
9
|
return typeof step === "string"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { decodeWith } from "#decoded.ts";
|
|
3
|
-
import type { Fence, Selector } from "
|
|
3
|
+
import type { Fence, Selector } from "#imports/fences/model.ts";
|
|
4
4
|
|
|
5
5
|
const SelectorInput: Schema.Codec<Selector> = Schema.suspend(() =>
|
|
6
6
|
Schema.Union([
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { posix, resolve } from "node:path";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
|
+
import { decodeDeclarations } from "#imports/fences/declarations.ts";
|
|
5
|
+
import type { Fence } from "#imports/fences/model.ts";
|
|
4
6
|
import type { WorkspacePackage } from "#imports/workspace.ts";
|
|
5
7
|
import type { RuleInputs } from "#rule.ts";
|
|
6
|
-
import { decodeDeclarations } from "./declarations.ts";
|
|
7
|
-
import type { Fence } from "./model.ts";
|
|
8
8
|
|
|
9
9
|
const BOUNDARY_FILE = "quality.fences.config.ts";
|
|
10
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { type Compiler, compile, type Matcher } from "#imports/fences/match.ts";
|
|
2
|
+
import type { Fence } from "#imports/fences/model.ts";
|
|
3
|
+
import { labelOf, outgoing, reachedFrom } from "#imports/fences/reach.ts";
|
|
4
|
+
import { compileVocabulary, type Vocabulary } from "#imports/fences/vocabulary.ts";
|
|
1
5
|
import type { ImportEdge, ImportGraph } from "#imports/graph.ts";
|
|
2
6
|
import { isTestCode } from "#naming/testName.ts";
|
|
3
7
|
import type { Finding } from "#rule.ts";
|
|
4
|
-
import { type Compiler, compile, type Matcher } from "./match.ts";
|
|
5
|
-
import type { Fence } from "./model.ts";
|
|
6
|
-
import { labelOf, outgoing, reachedFrom } from "./reach.ts";
|
|
7
|
-
import { compileVocabulary, type Vocabulary } from "./vocabulary.ts";
|
|
8
8
|
|
|
9
9
|
export type FenceGraph = Pick<ImportGraph, "edges" | "modules">;
|
|
10
10
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Endpoint } from "#imports/Endpoint.ts";
|
|
2
|
+
import type { Selector } from "#imports/fences/model.ts";
|
|
2
3
|
import { builtinName, packageNameOf } from "#imports/packageName.ts";
|
|
3
4
|
import { packageOf, type WorkspacePackage } from "#imports/workspace.ts";
|
|
4
|
-
import type { Selector } from "./model.ts";
|
|
5
5
|
|
|
6
6
|
export interface PolicyScope {
|
|
7
7
|
readonly files: readonly string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Endpoint } from "#imports/Endpoint.ts";
|
|
2
|
+
import type { Matcher } from "#imports/fences/match.ts";
|
|
2
3
|
import type { ImportEdge } from "#imports/graph.ts";
|
|
3
|
-
import type { Matcher } from "./match.ts";
|
|
4
4
|
|
|
5
5
|
export interface Reached<TMatch = unknown> {
|
|
6
6
|
readonly line: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { External, Selector, Target } from "
|
|
1
|
+
import type { External, Selector, Target } from "#imports/fences/model.ts";
|
|
2
2
|
|
|
3
3
|
function target(selector: Selector): Target {
|
|
4
4
|
return { except: (...excluded) => target({ base: selector, excluded: excluded.map((member) => member.selector), kind: "except" }), selector };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Endpoint } from "#imports/Endpoint.ts";
|
|
2
|
-
import { type Compiler, holdsFiles, packageNamed, trimmed } from "
|
|
3
|
-
import type { Selector } from "
|
|
2
|
+
import { type Compiler, holdsFiles, packageNamed, trimmed } from "#imports/fences/match.ts";
|
|
3
|
+
import type { Selector } from "#imports/fences/model.ts";
|
|
4
4
|
|
|
5
5
|
export interface Vocabulary {
|
|
6
6
|
readonly folder: string;
|
package/src/imports/graph.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { ImportCompiler } from "#adapters/import-compiler/service.ts";
|
|
3
|
+
import type { Endpoint } from "#imports/Endpoint.ts";
|
|
4
|
+
import type { ImportKind } from "#imports/extract.ts";
|
|
5
|
+
import { type WorkspacePackage, workspacePackages } from "#imports/workspace.ts";
|
|
3
6
|
import type { Findings, RuleInputs, SourceFile } from "#rule.ts";
|
|
4
|
-
import type { Endpoint } from "./Endpoint.ts";
|
|
5
|
-
import type { ImportKind } from "./extract.ts";
|
|
6
|
-
import { type WorkspacePackage, workspacePackages } from "./workspace.ts";
|
|
7
7
|
|
|
8
8
|
export interface ImportEdge {
|
|
9
9
|
readonly from: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
+
import { specifierSites } from "#imports/specifiers.ts";
|
|
2
3
|
import { isTestCode } from "#naming/testName.ts";
|
|
3
4
|
import type { Finding, SourceFile } from "#rule.ts";
|
|
4
5
|
import { parse } from "#rules/parse.ts";
|
|
5
|
-
import { specifierSites } from "./specifiers.ts";
|
|
6
6
|
|
|
7
7
|
const BARREL = "@effect/platform-node";
|
|
8
8
|
|
package/src/imports/runtime.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { join, posix } from "node:path";
|
|
2
2
|
import { Effect, FileSystem } from "effect";
|
|
3
3
|
import { readPackageManifest } from "#adapters/manifestInventory.ts";
|
|
4
|
+
import { classifyRuntime } from "#imports/classifyRuntime.ts";
|
|
5
|
+
import type { WorkspacePackage } from "#imports/workspace.ts";
|
|
4
6
|
import { orWhenAbsent } from "#inventory/filesystem.ts";
|
|
5
7
|
import type { RuleInputs } from "#rule.ts";
|
|
6
|
-
import { classifyRuntime } from "./classifyRuntime.ts";
|
|
7
|
-
import type { WorkspacePackage } from "./workspace.ts";
|
|
8
8
|
|
|
9
9
|
export type Runtime = "client" | "server" | "shared";
|
|
10
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ImportGraph } from "
|
|
2
|
-
import { packageOf, type WorkspacePackage } from "
|
|
1
|
+
import type { ImportGraph } from "#imports/graph.ts";
|
|
2
|
+
import { packageOf, type WorkspacePackage } from "#imports/workspace.ts";
|
|
3
3
|
|
|
4
4
|
export function testComposition(graph: ImportGraph, privatePackages: readonly WorkspacePackage[], testFile: (path: string) => boolean) {
|
|
5
5
|
const candidates = new Set(privatePackages);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { basename, posix, relative } from "node:path";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import { SetupFailure } from "#failure.ts";
|
|
4
|
+
import type { ImportGraph } from "#imports/graph.ts";
|
|
4
5
|
import { emptyScope, type IgnoreScope, verdictFor, withIgnoreFile } from "#inventory/ignoreScope.ts";
|
|
5
6
|
import { trackedPaths } from "#inventory/trackedPaths.ts";
|
|
6
7
|
import type { RuleInputs } from "#rule.ts";
|
|
7
|
-
import type { ImportGraph } from "./graph.ts";
|
|
8
8
|
|
|
9
9
|
type Reader = Pick<RuleInputs, "readText" | "root">;
|
|
10
10
|
|
package/src/imports/workspace.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { posix } from "node:path";
|
|
2
2
|
import { manifestFiles, readPackageManifest } from "#adapters/manifestInventory.ts";
|
|
3
|
+
import { globMatcher } from "#imports/globMatcher.ts";
|
|
4
|
+
import { pnpmWorkspacePatterns } from "#imports/pnpmWorkspacePatterns.ts";
|
|
3
5
|
import type { RuleInputs } from "#rule.ts";
|
|
4
|
-
import { globMatcher } from "./globMatcher.ts";
|
|
5
|
-
import { pnpmWorkspacePatterns } from "./pnpmWorkspacePatterns.ts";
|
|
6
6
|
|
|
7
7
|
export interface WorkspacePackage {
|
|
8
8
|
readonly directory: string;
|
package/src/inventory/collect.ts
CHANGED
|
@@ -2,14 +2,14 @@ import { join, relative } from "node:path";
|
|
|
2
2
|
import { Effect, FileSystem } from "effect";
|
|
3
3
|
import { ignorePatterns } from "#adapters/ignore.ts";
|
|
4
4
|
import type { SetupFailure } from "#failure.ts";
|
|
5
|
+
import { FilesystemFailure, orWhenAbsent, readRequiredText } from "#inventory/filesystem.ts";
|
|
6
|
+
import { posix } from "#inventory/ignoreScope.ts";
|
|
7
|
+
import { linesOf } from "#inventory/linesOf.ts";
|
|
8
|
+
import { skillCopies } from "#inventory/skillCopies.ts";
|
|
9
|
+
import { toolOwnedFiles } from "#inventory/toolOwnedFiles.ts";
|
|
10
|
+
import { scopeAbove, walk } from "#inventory/walk.ts";
|
|
5
11
|
import { manifestsIn } from "#manifests/sorted.ts";
|
|
6
12
|
import type { RuleServices, SourceFile } from "#rule.ts";
|
|
7
|
-
import { FilesystemFailure, orWhenAbsent, readRequiredText } from "./filesystem.ts";
|
|
8
|
-
import { posix } from "./ignoreScope.ts";
|
|
9
|
-
import { linesOf } from "./linesOf.ts";
|
|
10
|
-
import { skillCopies } from "./skillCopies.ts";
|
|
11
|
-
import { toolOwnedFiles } from "./toolOwnedFiles.ts";
|
|
12
|
-
import { scopeAbove, walk } from "./walk.ts";
|
|
13
13
|
|
|
14
14
|
export interface InventoryScope {
|
|
15
15
|
readonly exclude: readonly string[];
|
|
@@ -2,9 +2,9 @@ import * as NodePath from "@effect/platform-node/NodePath";
|
|
|
2
2
|
import { Effect, Path } from "effect";
|
|
3
3
|
import { type RouterOptions, tanstackRoutes } from "#adapters/tanstackRoutes.ts";
|
|
4
4
|
import { SetupFailure } from "#failure.ts";
|
|
5
|
-
import { readRequiredText } from "
|
|
6
|
-
import { posix as portable } from "
|
|
7
|
-
import { walk } from "
|
|
5
|
+
import { readRequiredText } from "#inventory/filesystem.ts";
|
|
6
|
+
import { posix as portable } from "#inventory/ignoreScope.ts";
|
|
7
|
+
import { walk } from "#inventory/walk.ts";
|
|
8
8
|
|
|
9
9
|
const CONFIG = /^(?:tsr\.config\.json|vite\.config\.[cm]?[jt]s)$/u;
|
|
10
10
|
const CODE = /\.[jt]sx?$/u;
|
package/src/inventory/walk.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { dirname, join, relative, sep } from "node:path";
|
|
2
2
|
import { Effect, FileSystem } from "effect";
|
|
3
3
|
import type { SetupFailure } from "#failure.ts";
|
|
4
|
+
import { type FilesystemFailure, orWhenAbsent, readOptionalText } from "#inventory/filesystem.ts";
|
|
5
|
+
import { emptyScope, type IgnoreScope, insideKept, verdictFor, withIgnoreFile } from "#inventory/ignoreScope.ts";
|
|
6
|
+
import { ignoredPaths, trackedPaths } from "#inventory/trackedPaths.ts";
|
|
4
7
|
import type { RuleServices } from "#rule.ts";
|
|
5
|
-
import { type FilesystemFailure, orWhenAbsent, readOptionalText } from "./filesystem.ts";
|
|
6
|
-
import { emptyScope, type IgnoreScope, insideKept, verdictFor, withIgnoreFile } from "./ignoreScope.ts";
|
|
7
|
-
import { ignoredPaths, trackedPaths } from "./trackedPaths.ts";
|
|
8
8
|
|
|
9
9
|
const SKIPPED = new Set([".git", ".worktrees", "node_modules"]);
|
|
10
10
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Effect, Path } from "effect";
|
|
2
|
+
import { readPackageManifest } from "#adapters/manifestInventory.ts";
|
|
3
|
+
import { scriptPaths } from "#adapters/scriptPaths.ts";
|
|
4
|
+
import { isTooling } from "#imports/isTooling.ts";
|
|
5
|
+
import { packageOf, workspacePackages } from "#imports/workspace.ts";
|
|
6
|
+
import type { RuleInputs } from "#rule.ts";
|
|
7
|
+
|
|
8
|
+
export const developmentCode = Effect.fn("Naming.developmentCode")(function* (inputs: RuleInputs) {
|
|
9
|
+
const posix = yield* Path.Path.pipe(Effect.provide(Path.layer));
|
|
10
|
+
const packages = yield* Effect.promise(() => workspacePackages(inputs));
|
|
11
|
+
const scripts = yield* Effect.forEach([".", ...packages.map((owner) => owner.directory)], (directory) =>
|
|
12
|
+
Effect.promise(() => readPackageManifest(inputs.readText, posix.join(directory, "package.json"))).pipe(
|
|
13
|
+
Effect.map((manifest) => scriptPaths(directory, manifest?.scripts ?? {})),
|
|
14
|
+
),
|
|
15
|
+
);
|
|
16
|
+
const scripted = new Set(scripts.flat());
|
|
17
|
+
return (path: string) => {
|
|
18
|
+
const directory = packageOf(packages, path)?.directory ?? ".";
|
|
19
|
+
return isTooling(directory, path) || (!posix.relative(directory, path).includes("/") && scripted.has(path));
|
|
20
|
+
};
|
|
21
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { posix } from "node:path";
|
|
2
|
-
import { moduleRoot } from "
|
|
2
|
+
import { moduleRoot } from "#naming/moduleRoot.ts";
|
|
3
3
|
|
|
4
4
|
export const MIGRATIONS_DIRECTORY = "src/server/migrations";
|
|
5
5
|
export const MIGRATION_FILE_PATTERN = /^[0-9]{4}_[a-z][a-z0-9]*(?:_[a-z0-9]+)*\.ts$/u;
|
package/src/naming/testCode.ts
CHANGED
|
@@ -5,9 +5,10 @@ import { importGraph } from "#imports/graph.ts";
|
|
|
5
5
|
import { isTooling } from "#imports/isTooling.ts";
|
|
6
6
|
import { testComposition } from "#imports/testComposition.ts";
|
|
7
7
|
import { packageOf } from "#imports/workspace.ts";
|
|
8
|
+
import { developmentCode } from "#naming/developmentCode.ts";
|
|
9
|
+
import { packageTests } from "#naming/packageTests.ts";
|
|
10
|
+
import { isTestCode } from "#naming/testName.ts";
|
|
8
11
|
import type { RuleInputs } from "#rule.ts";
|
|
9
|
-
import { packageTests } from "./packageTests.ts";
|
|
10
|
-
import { isTestCode } from "./testName.ts";
|
|
11
12
|
|
|
12
13
|
export const testCode = Effect.fn("Tests.testCode")(function* (inputs: RuleInputs) {
|
|
13
14
|
const posix = yield* Path.Path.pipe(Effect.provide(Path.layer));
|
|
@@ -34,6 +35,7 @@ export const testCode = Effect.fn("Tests.testCode")(function* (inputs: RuleInput
|
|
|
34
35
|
const graph = yield* importGraph(inputs);
|
|
35
36
|
const directories = new Set(policies.filter((policy) => policy.private).map((policy) => policy.owner.directory));
|
|
36
37
|
const scripted = new Set(policies.flatMap((policy) => policy.scripts));
|
|
38
|
+
const tooling = yield* developmentCode(inputs);
|
|
37
39
|
for (const path of graph.modules) {
|
|
38
40
|
const owner = packageOf(graph.packages, path);
|
|
39
41
|
if (owner === undefined) {
|
|
@@ -53,7 +55,7 @@ export const testCode = Effect.fn("Tests.testCode")(function* (inputs: RuleInput
|
|
|
53
55
|
const composition = testComposition(
|
|
54
56
|
graph,
|
|
55
57
|
graph.packages.filter((owner) => directories.has(owner.directory)),
|
|
56
|
-
testFile,
|
|
58
|
+
(path) => testFile(path) || tooling(path),
|
|
57
59
|
);
|
|
58
60
|
return (path: string) => {
|
|
59
61
|
const owner = packageOf(graph.packages, path);
|
package/src/report/render.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Regression } from "#baseline/compare.ts";
|
|
2
2
|
import { type Outcome, passes } from "#engine/evaluate.ts";
|
|
3
3
|
import { groupBy, keyOf, type Violation } from "#engine/violation.ts";
|
|
4
|
-
import { plural } from "
|
|
5
|
-
import { staleSections } from "
|
|
4
|
+
import { plural } from "#report/plural.ts";
|
|
5
|
+
import { staleSections } from "#report/staleSections.ts";
|
|
6
6
|
|
|
7
7
|
export interface ReportContext {
|
|
8
8
|
readonly baseline: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { StaleBaselineEntry } from "#baseline/compare.ts";
|
|
2
2
|
import type { Outcome } from "#engine/evaluate.ts";
|
|
3
3
|
import type { StaleRegistryEntry } from "#exceptions/registry.ts";
|
|
4
|
-
import { plural } from "
|
|
4
|
+
import { plural } from "#report/plural.ts";
|
|
5
5
|
|
|
6
6
|
interface StaleFiles {
|
|
7
7
|
readonly baseline: string;
|
package/src/rules/builtIn.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { biome } from "#rules/biome.ts";
|
|
1
2
|
import { maxPerFile } from "#rules/comments/maxPerFile.ts";
|
|
2
3
|
import { noBanner } from "#rules/comments/noBanner.ts";
|
|
3
4
|
import { noEnvironmentPragma } from "#rules/comments/noEnvironmentPragma.ts";
|
|
@@ -23,6 +24,16 @@ import { importsManifest } from "#rules/imports/manifest.ts";
|
|
|
23
24
|
import { noTestCode } from "#rules/imports/noTestCode.ts";
|
|
24
25
|
import { importsResolvable } from "#rules/imports/resolvable.ts";
|
|
25
26
|
import { importsRuntime } from "#rules/imports/runtime.ts";
|
|
27
|
+
import { manifestsApplication } from "#rules/manifestsApplication.ts";
|
|
28
|
+
import { manifestsDependencyPins } from "#rules/manifestsDependencyPins.ts";
|
|
29
|
+
import { manifestsExportsShape } from "#rules/manifestsExportsShape.ts";
|
|
30
|
+
import { manifestsNoTestKits } from "#rules/manifestsNoTestKits.ts";
|
|
31
|
+
import { manifestsSorted } from "#rules/manifestsSorted.ts";
|
|
32
|
+
import { manifestsSourceFirst } from "#rules/manifestsSourceFirst.ts";
|
|
33
|
+
import { manifestsValid } from "#rules/manifestsValid.ts";
|
|
34
|
+
import { maxDepth } from "#rules/maxDepth.ts";
|
|
35
|
+
import { maxLines } from "#rules/maxLines.ts";
|
|
36
|
+
import { noBarrel } from "#rules/noBarrel.ts";
|
|
26
37
|
import { jsxConditionals } from "#rules/react/jsxConditionals.ts";
|
|
27
38
|
import { adapterOnlyFakes } from "#rules/stories/adapterOnlyFakes.ts";
|
|
28
39
|
import { authSql } from "#rules/stories/authSql.ts";
|
|
@@ -50,18 +61,7 @@ import { noIgnoreDeprecations } from "#rules/suppressions/noIgnoreDeprecations.t
|
|
|
50
61
|
import { noInline } from "#rules/suppressions/noInline.ts";
|
|
51
62
|
import { testsColocated } from "#rules/test-names/colocated.ts";
|
|
52
63
|
import { testsFollow } from "#rules/test-names/follow.ts";
|
|
53
|
-
import {
|
|
54
|
-
import { manifestsApplication } from "./manifestsApplication.ts";
|
|
55
|
-
import { manifestsDependencyPins } from "./manifestsDependencyPins.ts";
|
|
56
|
-
import { manifestsExportsShape } from "./manifestsExportsShape.ts";
|
|
57
|
-
import { manifestsNoTestKits } from "./manifestsNoTestKits.ts";
|
|
58
|
-
import { manifestsSorted } from "./manifestsSorted.ts";
|
|
59
|
-
import { manifestsSourceFirst } from "./manifestsSourceFirst.ts";
|
|
60
|
-
import { manifestsValid } from "./manifestsValid.ts";
|
|
61
|
-
import { maxDepth } from "./maxDepth.ts";
|
|
62
|
-
import { maxLines } from "./maxLines.ts";
|
|
63
|
-
import { noBarrel } from "./noBarrel.ts";
|
|
64
|
-
import { unusedCode } from "./unusedCode.ts";
|
|
64
|
+
import { unusedCode } from "#rules/unusedCode.ts";
|
|
65
65
|
|
|
66
66
|
export const builtInRules = [
|
|
67
67
|
...effectPolicy,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineRule, type Finding, type Rule } from "#rule.ts";
|
|
2
|
-
import { isDirective, textOf } from "
|
|
3
|
-
import { commentsOf, type SourceComment } from "
|
|
2
|
+
import { isDirective, textOf } from "#rules/comments/kinds.ts";
|
|
3
|
+
import { commentsOf, type SourceComment } from "#rules/comments/scan.ts";
|
|
4
4
|
|
|
5
5
|
interface PatternRule<TId extends string> {
|
|
6
6
|
readonly description: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
+
import type { SourceComment } from "#rules/comments/scan.ts";
|
|
2
3
|
import { SUPPRESSIONS } from "#rules/suppressions/in.ts";
|
|
3
|
-
import type { SourceComment } from "./scan.ts";
|
|
4
4
|
|
|
5
5
|
export const Pragmas = Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed<readonly string[]>([])));
|
|
6
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import { plural } from "#report/plural.ts";
|
|
3
3
|
import { defineRule, type Finding, type SourceFile } from "#rule.ts";
|
|
4
|
-
import { isDirective, isPragma, Pragmas } from "
|
|
5
|
-
import { commentsOf, type SourceComment } from "
|
|
4
|
+
import { isDirective, isPragma, Pragmas } from "#rules/comments/kinds.ts";
|
|
5
|
+
import { commentsOf, type SourceComment } from "#rules/comments/scan.ts";
|
|
6
6
|
|
|
7
7
|
const MaxPerFileOptions = Schema.Struct({
|
|
8
8
|
allow: Pragmas,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { defineRule } from "#rule.ts";
|
|
3
|
-
import { isDirective, isJsdoc, isPragma, Pragmas } from "
|
|
4
|
-
import { commentsOf } from "
|
|
3
|
+
import { isDirective, isJsdoc, isPragma, Pragmas } from "#rules/comments/kinds.ts";
|
|
4
|
+
import { commentsOf } from "#rules/comments/scan.ts";
|
|
5
5
|
|
|
6
6
|
const NoJsdocOptions = Schema.Struct({ allow: Pragmas });
|
|
7
7
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { definePatternRule } from "
|
|
1
|
+
import { definePatternRule } from "#rules/comments/definePattern.ts";
|
|
2
2
|
|
|
3
3
|
const SOURCE_EXTENSION =
|
|
4
4
|
"(?:[cm]?[jt]sx?|json5?|mdx?|css|scss|less|html?|vue|svelte|astro|ya?ml|toml|sql|prisma|graphql|gql|go|rs|py|rb|java|kt|swift|sh)";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { definePatternRule } from "
|
|
1
|
+
import { definePatternRule } from "#rules/comments/definePattern.ts";
|
|
2
2
|
|
|
3
3
|
export const noPrReference = definePatternRule({
|
|
4
4
|
description: "History belongs in version control, not in the code. State the reason itself, so the comment holds without the link.",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { definePatternRule } from "
|
|
1
|
+
import { definePatternRule } from "#rules/comments/definePattern.ts";
|
|
2
2
|
|
|
3
3
|
export const noTodo = definePatternRule({
|
|
4
4
|
description: "A TODO in the code is never done. Do the work now, or track it where the repository tracks work.",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
-
import { effectName, type FailureOperation, failureOperations, fileSystemCall } from "
|
|
3
|
-
import { successRecovery } from "
|
|
2
|
+
import { effectName, type FailureOperation, failureOperations, fileSystemCall } from "#rules/effect/failureOperations.ts";
|
|
3
|
+
import { successRecovery } from "#rules/effect/successRecovery.ts";
|
|
4
4
|
|
|
5
5
|
interface FailureFinding {
|
|
6
6
|
readonly message: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import ts from "typescript";
|
|
3
3
|
import { defineRule, type Finding, type RuleInputs } from "#rule.ts";
|
|
4
|
-
import { failureFindings } from "
|
|
5
|
-
import { effectProgram } from "
|
|
4
|
+
import { failureFindings } from "#rules/effect/failureFindings.ts";
|
|
5
|
+
import { effectProgram } from "#rules/effect/program.ts";
|
|
6
6
|
|
|
7
7
|
function checkFailures(inputs: RuleInputs): readonly Finding[] {
|
|
8
8
|
const program = effectProgram(inputs, false);
|
|
@@ -3,6 +3,7 @@ import ts from "typescript";
|
|
|
3
3
|
import { foreignResources } from "#adapters/foreignResources.ts";
|
|
4
4
|
import { frameworkCallback, parameterSite } from "#adapters/frameworkCallback.ts";
|
|
5
5
|
import { localFunctions } from "#adapters/localFunctions.ts";
|
|
6
|
+
import { reactComponent, reactPropParameters } from "#adapters/reactComponent.ts";
|
|
6
7
|
import type { Finding } from "#rule.ts";
|
|
7
8
|
import { layerConstructor } from "#rules/effect/layerConstructor.ts";
|
|
8
9
|
import { publicFunctions } from "#rules/effect/publicFunctions.ts";
|
|
@@ -29,6 +30,7 @@ export function serviceFindings(
|
|
|
29
30
|
services: ReturnType<typeof serviceTypes>,
|
|
30
31
|
): readonly Finding[] {
|
|
31
32
|
const resource = foreignResources(checker, sources);
|
|
33
|
+
const props = reactPropParameters(checker, sources);
|
|
32
34
|
const findings = new Map<ts.ParameterDeclaration, Finding>();
|
|
33
35
|
const visited = new Set<ts.Type>();
|
|
34
36
|
const activeSignatures = new Set<NonNullable<ts.Signature["declaration"]>>();
|
|
@@ -43,6 +45,8 @@ export function serviceFindings(
|
|
|
43
45
|
|| implementationParameter(checker, parameter, services)
|
|
44
46
|
|| resource(parameter)
|
|
45
47
|
|| frameworkCallback(checker, parameter.parent, local)
|
|
48
|
+
|| reactComponent(checker, parameter.parent)
|
|
49
|
+
|| props.has(parameter)
|
|
46
50
|
|| (signature !== undefined
|
|
47
51
|
&& (checker.getTypePredicateOfSignature(signature) !== undefined
|
|
48
52
|
|| (signature.declaration !== undefined && layerConstructor(checker, signature.declaration))
|
|
@@ -34,7 +34,7 @@ export const serviceParameters = defineRule({
|
|
|
34
34
|
});
|
|
35
35
|
}),
|
|
36
36
|
description:
|
|
37
|
-
"Exported and local functions and public methods take services from Effect's environment, including aliases, constraints, inferred/destructured parameters and factory returns. Service keys/classes, non-empty Contexts and implementation shapes are services; Effect/Stream requirements are computations. Service implementation methods, framework callbacks, owned foreign adapter resources and Layer constructors are accepted. Within Effect code, test-support/ folders are exempt. The fixed adapters/ convention bridges outside libraries to Effect values; adapters still follow this rule and ambient runtime bans. No config exceptions or inline suppressions; baseline existing debt.",
|
|
37
|
+
"Exported and local functions and public methods take services from Effect's environment, including aliases, constraints, inferred/destructured parameters and factory returns. Service keys/classes, non-empty Contexts and implementation shapes are services; Effect/Stream requirements are computations. Service implementation methods, framework callbacks, module-level React components and their props, owned foreign adapter resources and Layer constructors are accepted. Within Effect code, test-support/ folders are exempt. The fixed adapters/ convention bridges outside libraries to Effect values; adapters still follow this rule and ambient runtime bans. No config exceptions or inline suppressions; baseline existing debt.",
|
|
38
38
|
id: "effect/service-parameters",
|
|
39
39
|
registrable: false,
|
|
40
40
|
});
|
|
@@ -57,6 +57,7 @@ export function serviceTypes(checker: ts.TypeChecker, initializerState = false)
|
|
|
57
57
|
const symbol = type.getSymbol();
|
|
58
58
|
return (
|
|
59
59
|
handle
|
|
60
|
+
|| (initializerState && type.getProperty("~effect/Scope") !== undefined)
|
|
60
61
|
|| (symbol?.name === "AtomContext"
|
|
61
62
|
&& (symbol.declarations ?? []).some((declaration) =>
|
|
62
63
|
/\/effect\/(?:src|dist)\/reactivity\/Atom\.(?:d\.)?ts$/u.test(declaration.getSourceFile().fileName.replaceAll("\\", "/")),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
+
import { effectName } from "#rules/effect/failureOperations.ts";
|
|
2
3
|
import { returnValues } from "#rules/stories/returnValues.ts";
|
|
3
|
-
import { effectName } from "./failureOperations.ts";
|
|
4
4
|
|
|
5
5
|
function success(checker: ts.TypeChecker, node: ts.Node, seen: Set<ts.Symbol>): boolean {
|
|
6
6
|
if (ts.isParenthesizedExpression(node)) {
|
|
@@ -5,7 +5,7 @@ import { GlobDeclarations, globPatterns, validateGlobs } from "#config/globs.ts"
|
|
|
5
5
|
import { nativeNames } from "#naming/nativeNames.ts";
|
|
6
6
|
import { CAMEL, KEBAB } from "#naming/words.ts";
|
|
7
7
|
import { defineRule, type Finding } from "#rule.ts";
|
|
8
|
-
import { stylesheetImporters } from "
|
|
8
|
+
import { stylesheetImporters } from "#rules/files/stylesheetImporters.ts";
|
|
9
9
|
|
|
10
10
|
const DEFAULT_TOOL_OWNED: readonly string[] = [".*", "package.json", "tsconfig*.json", "biome.json", "biome.jsonc", "*.config.*"];
|
|
11
11
|
|
|
@@ -2,8 +2,8 @@ import { posix } from "node:path";
|
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import ts from "typescript";
|
|
4
4
|
import type { RuleInputs, SourceFile } from "#rule.ts";
|
|
5
|
+
import { type PackageImports, packageImports } from "#rules/files/packageImports.ts";
|
|
5
6
|
import { parse } from "#rules/parse.ts";
|
|
6
|
-
import { type PackageImports, packageImports } from "./packageImports.ts";
|
|
7
7
|
|
|
8
8
|
const STYLESHEET = /\.s?css$/u;
|
|
9
9
|
|
|
@@ -3,14 +3,14 @@ import { type Departure, departures } from "#imports/departures.ts";
|
|
|
3
3
|
import { defineRule } from "#rule.ts";
|
|
4
4
|
|
|
5
5
|
function messageOf({ installed, specifier, workspace }: Departure): string {
|
|
6
|
-
const
|
|
6
|
+
const relative = `"${specifier}" is a relative import.`;
|
|
7
7
|
if (installed !== undefined) {
|
|
8
|
-
return `${
|
|
8
|
+
return `${relative} It reaches into the installed package ${installed}; import that package by its name.`;
|
|
9
9
|
}
|
|
10
10
|
if (workspace !== undefined) {
|
|
11
|
-
return `${
|
|
11
|
+
return `${relative} It reaches into the workspace package ${workspace}; import it by that name, through a path its package.json "exports" lists.`;
|
|
12
12
|
}
|
|
13
|
-
return `${
|
|
13
|
+
return `${relative} Import it through a "#…" alias from the "imports" of its package.json, and declare one there if none fits.`;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export const importsAliased = defineRule({
|
|
@@ -24,6 +24,6 @@ export const importsAliased = defineRule({
|
|
|
24
24
|
})),
|
|
25
25
|
),
|
|
26
26
|
description:
|
|
27
|
-
"
|
|
27
|
+
"Import own modules through the package.json `imports` aliases, including same-folder modules. Import other packages by their names and exported paths.",
|
|
28
28
|
id: "imports/aliased",
|
|
29
29
|
});
|
|
@@ -6,9 +6,10 @@ import { isTooling } from "#imports/isTooling.ts";
|
|
|
6
6
|
import { builtinName } from "#imports/packageName.ts";
|
|
7
7
|
import { packageOf, type WorkspacePackage } from "#imports/workspace.ts";
|
|
8
8
|
import { dependencyNames, type EntryPoint, entryPointsOf, isApplication, provider, SHIPPED_FIELDS } from "#manifests/entryPoints.ts";
|
|
9
|
+
import { developmentCode } from "#naming/developmentCode.ts";
|
|
9
10
|
import { testCode } from "#naming/testCode.ts";
|
|
10
11
|
import { defineRule, type RuleInputs } from "#rule.ts";
|
|
11
|
-
import { bundleInputs } from "
|
|
12
|
+
import { bundleInputs } from "#rules/imports/bundleInputs.ts";
|
|
12
13
|
|
|
13
14
|
const QUERY = /\?.*$/u;
|
|
14
15
|
|
|
@@ -95,7 +96,11 @@ function undeclared(owner: WorkspacePackage, policy: ManifestDependencies | unde
|
|
|
95
96
|
export const importsManifest = defineRule({
|
|
96
97
|
check: Effect.fn("Imports.check")(function* (inputs) {
|
|
97
98
|
const graph = yield* importGraph(inputs);
|
|
98
|
-
const
|
|
99
|
+
const testFile = yield* testCode(inputs);
|
|
100
|
+
const tooling = yield* developmentCode(inputs);
|
|
101
|
+
function isTestCode(path: string) {
|
|
102
|
+
return testFile(path) || tooling(path);
|
|
103
|
+
}
|
|
99
104
|
const root: WorkspacePackage | undefined =
|
|
100
105
|
(yield* Effect.promise(() => readPackageManifest(inputs.readText, "package.json"))) === undefined ? undefined : { directory: ".", name: "." };
|
|
101
106
|
const owners = [...graph.packages, ...(root === undefined ? [] : [root])];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { importGraph } from "#imports/graph.ts";
|
|
3
|
+
import { developmentCode } from "#naming/developmentCode.ts";
|
|
3
4
|
import { testCode } from "#naming/testCode.ts";
|
|
4
5
|
import { defineRule } from "#rule.ts";
|
|
5
6
|
|
|
@@ -7,8 +8,9 @@ export const noTestCode = defineRule({
|
|
|
7
8
|
check: Effect.fn("Imports.check")(function* (inputs) {
|
|
8
9
|
const graph = yield* importGraph(inputs);
|
|
9
10
|
const isTestCode = yield* testCode(inputs);
|
|
11
|
+
const tooling = yield* developmentCode(inputs);
|
|
10
12
|
return graph.edges
|
|
11
|
-
.filter((edge) => !isTestCode(edge.from) && edge.to.kind === "file" && isTestCode(edge.to.path))
|
|
13
|
+
.filter((edge) => !(isTestCode(edge.from) || tooling(edge.from)) && edge.to.kind === "file" && isTestCode(edge.to.path))
|
|
12
14
|
.map((edge) => ({
|
|
13
15
|
file: edge.from,
|
|
14
16
|
line: edge.line,
|
|
@@ -16,7 +18,8 @@ export const noTestCode = defineRule({
|
|
|
16
18
|
subject: edge.specifier,
|
|
17
19
|
}));
|
|
18
20
|
}),
|
|
19
|
-
description:
|
|
21
|
+
description:
|
|
22
|
+
"Production modules import production code. Private test-composition packages may be consumed by tests, test support and package development scripts. Move shared production code out of test files and test-support/ into a production module.",
|
|
20
23
|
id: "imports/no-test-code",
|
|
21
24
|
registrable: false,
|
|
22
25
|
});
|