@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
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { posix } from "node:path";
|
|
2
|
+
|
|
3
|
+
function commandPaths(directory: string, command: string): readonly string[] {
|
|
4
|
+
const paths: string[] = [];
|
|
5
|
+
const words = (command.match(/(?:[^\s"']|"[^"]*"|'[^']*')+/gu) ?? []).map((word) => word.replaceAll(/["']/gu, ""));
|
|
6
|
+
const tool = words.indexOf("vitest");
|
|
7
|
+
if (tool < 0) {
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
for (let index = tool + 1; index < words.length; index += 1) {
|
|
11
|
+
const [flag, inline] = (words[index] ?? "").split("=", 2);
|
|
12
|
+
if (flag !== "--config" && flag !== "--reporter") {
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
const value = inline ?? words[index + 1];
|
|
16
|
+
if (value !== undefined && !value.startsWith("-")) {
|
|
17
|
+
paths.push(posix.join(directory, value));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return paths;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function vitestContractPaths(directory: string, scripts: Readonly<Record<string, string>>): readonly string[] {
|
|
24
|
+
return Object.values(scripts).flatMap((script) => script.split(/[;&|]+/u).flatMap((command) => commandPaths(directory, command)));
|
|
25
|
+
}
|
package/src/baseline/compare.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { BaselineEntry } from "#baseline/format.ts";
|
|
1
2
|
import { groupBy, keyOf, levelOf, type RuleIndex, unusedEntryProblem, type Violation } from "#engine/violation.ts";
|
|
2
|
-
import type { BaselineEntry } from "./format.ts";
|
|
3
3
|
|
|
4
4
|
export interface Regression {
|
|
5
5
|
readonly count: number;
|
package/src/baseline/legacy.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
+
import { countOf } from "#baseline/compare.ts";
|
|
3
|
+
import type { BaselineEntry } from "#baseline/format.ts";
|
|
2
4
|
import { type Decoded, decodeWith } from "#decoded.ts";
|
|
3
5
|
import { groupBy, keyOf, type Violation } from "#engine/violation.ts";
|
|
4
|
-
import { countOf } from "./compare.ts";
|
|
5
|
-
import type { BaselineEntry } from "./format.ts";
|
|
6
6
|
|
|
7
7
|
export const LEGACY_BASELINE = "quality/baseline.json";
|
|
8
8
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
+
import { applyBaseline } from "#baseline/compare.ts";
|
|
3
|
+
import { type BaselineEntry, decodeBaseline } from "#baseline/format.ts";
|
|
4
|
+
import { shardOf } from "#baseline/shards.ts";
|
|
2
5
|
import { validOrFail } from "#decoded.ts";
|
|
3
6
|
import type { Session } from "#engine/session.ts";
|
|
4
7
|
import { keyOf } from "#engine/violation.ts";
|
|
5
8
|
import { applyRegistry } from "#exceptions/registry.ts";
|
|
6
9
|
import { gitOrFail, run } from "#git/command.ts";
|
|
7
10
|
import { changesSince } from "#git/history.ts";
|
|
8
|
-
import { applyBaseline } from "./compare.ts";
|
|
9
|
-
import { type BaselineEntry, decodeBaseline } from "./format.ts";
|
|
10
|
-
import { shardOf } from "./shards.ts";
|
|
11
11
|
|
|
12
12
|
export const looseStagedEntries = Effect.fn("Baseline.looseStagedEntries")(function* (session: Session) {
|
|
13
13
|
const { root, baseline } = session.config;
|
package/src/baseline/rewrite.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { type BaselineEntry, byPathAndRule, encodeEntry, linesOf } from "#baseline/format.ts";
|
|
1
2
|
import { keyOf } from "#engine/violation.ts";
|
|
2
|
-
import { type BaselineEntry, byPathAndRule, encodeEntry, linesOf } from "./format.ts";
|
|
3
3
|
|
|
4
4
|
interface Row {
|
|
5
5
|
readonly entry: BaselineEntry;
|
package/src/baseline/update.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { countOf } from "#baseline/compare.ts";
|
|
2
|
+
import type { BaselineEntry } from "#baseline/format.ts";
|
|
1
3
|
import { covers, groupBy, keyOf, levelOf, type RuleIndex, type Violation } from "#engine/violation.ts";
|
|
2
|
-
import { countOf } from "./compare.ts";
|
|
3
|
-
import type { BaselineEntry } from "./format.ts";
|
|
4
4
|
|
|
5
5
|
export type Adoption =
|
|
6
6
|
| { readonly _tag: "Refused"; readonly reasons: readonly string[] }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
-
import type { Syntax } from "
|
|
2
|
+
import type { Syntax } from "#biome/syntax.ts";
|
|
3
3
|
|
|
4
4
|
function importedFrom(node: ts.Node, module: string): boolean {
|
|
5
5
|
for (let current: ts.Node | undefined = node; current !== undefined; current = current.parent) {
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { resolve } from "node:path";
|
|
2
2
|
import ts from "typescript";
|
|
3
3
|
import { browserDiagnostic } from "#adapters/biome/browserDiagnostic.ts";
|
|
4
|
+
import { pluginContract } from "#adapters/biome/pluginContract.ts";
|
|
4
5
|
import { syntaxOf } from "#adapters/biome/syntaxOf.ts";
|
|
5
6
|
import { vitestEntry } from "#adapters/biome/vitestEntry.ts";
|
|
6
|
-
import { nativeEffectCall } from "
|
|
7
|
-
import type { Diagnostic } from "
|
|
8
|
-
import { nodeAt, offsetOf, type Syntax } from "
|
|
7
|
+
import { nativeEffectCall } from "#biome/nativeEffectCall.ts";
|
|
8
|
+
import type { Diagnostic } from "#biome/report.ts";
|
|
9
|
+
import { nodeAt, offsetOf, type Syntax } from "#biome/syntax.ts";
|
|
9
10
|
|
|
10
|
-
const RECOGNIZED: ReadonlySet<string> = new Set([
|
|
11
|
+
const RECOGNIZED: ReadonlySet<string> = new Set([
|
|
12
|
+
"lint/correctness/noComponentHookFactories",
|
|
13
|
+
"lint/style/noDoneCallback",
|
|
14
|
+
"lint/style/noDefaultExport",
|
|
15
|
+
]);
|
|
11
16
|
|
|
12
17
|
function generatorParameter(node: ts.Node, syntax: Syntax): boolean {
|
|
13
18
|
const parameter = node.parent;
|
|
@@ -38,6 +43,9 @@ function tagHandler(node: ts.Node, syntax: Syntax): boolean {
|
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
function misclassified(diagnostic: Diagnostic, syntax: Syntax): boolean {
|
|
46
|
+
if (diagnostic.category === "lint/style/noDefaultExport") {
|
|
47
|
+
return pluginContract(syntax);
|
|
48
|
+
}
|
|
41
49
|
const { start, end } = diagnostic.location;
|
|
42
50
|
const from = start === undefined ? undefined : offsetOf(syntax.source, start);
|
|
43
51
|
const to = end === undefined ? undefined : offsetOf(syntax.source, end);
|
|
@@ -55,15 +63,28 @@ function misclassified(diagnostic: Diagnostic, syntax: Syntax): boolean {
|
|
|
55
63
|
}
|
|
56
64
|
}
|
|
57
65
|
|
|
58
|
-
export function recognizeDiagnostics(
|
|
66
|
+
export function recognizeDiagnostics(
|
|
67
|
+
root: string,
|
|
68
|
+
diagnostics: readonly Diagnostic[],
|
|
69
|
+
toolDefaults: ReadonlySet<string> = new Set(),
|
|
70
|
+
): readonly Diagnostic[] {
|
|
59
71
|
const sources = new Map<string, Syntax>();
|
|
60
|
-
|
|
72
|
+
const candidates = diagnostics.filter(
|
|
73
|
+
(diagnostic) =>
|
|
74
|
+
diagnostic.category !== "lint/style/noDefaultExport"
|
|
75
|
+
|| diagnostic.location.path === undefined
|
|
76
|
+
|| !toolDefaults.has(resolve(root, diagnostic.location.path)),
|
|
77
|
+
);
|
|
78
|
+
return candidates.flatMap((diagnostic) => {
|
|
61
79
|
const path = diagnostic.location.path;
|
|
62
|
-
if (
|
|
80
|
+
if (path === undefined) {
|
|
81
|
+
return [diagnostic];
|
|
82
|
+
}
|
|
83
|
+
if (diagnostic.category === "lint/suspicious/useBaseline") {
|
|
63
84
|
const recognized = browserDiagnostic(diagnostic, resolve(root, path));
|
|
64
85
|
return recognized === undefined ? [] : [recognized];
|
|
65
86
|
}
|
|
66
|
-
if (!RECOGNIZED.has(diagnostic.category ?? "")
|
|
87
|
+
if (!RECOGNIZED.has(diagnostic.category ?? "")) {
|
|
67
88
|
return [diagnostic];
|
|
68
89
|
}
|
|
69
90
|
const file = resolve(root, path);
|
package/src/biome/report.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as NodePath from "@effect/platform-node/NodePath";
|
|
2
2
|
import { Effect, Path, Schema } from "effect";
|
|
3
3
|
import { type BiomeRun, runBiome } from "#adapters/biome/run.ts";
|
|
4
|
+
import { toolContractDefaults } from "#adapters/biome/toolContractDefaults.ts";
|
|
5
|
+
import { recognizeDiagnostics } from "#biome/recognizeDiagnostics.ts";
|
|
4
6
|
import type { ExceptionDeclaration } from "#exceptions/declaration.ts";
|
|
5
7
|
import { SetupFailure } from "#failure.ts";
|
|
6
8
|
import { ignoredTrackedPaths } from "#inventory/trackedPaths.ts";
|
|
7
|
-
import { recognizeDiagnostics } from "./recognizeDiagnostics.ts";
|
|
8
9
|
|
|
9
10
|
const Position = Schema.Struct({ column: Schema.optionalKey(Schema.Int), line: Schema.Int });
|
|
10
11
|
|
|
@@ -81,7 +82,7 @@ export const biomeReport = Effect.fn("Biome.biomeReport")(function* (
|
|
|
81
82
|
const diagnostics = [...report.diagnostics, ...(extra?.diagnostics ?? [])];
|
|
82
83
|
const unique = [...new Map(diagnostics.map((diagnostic) => [JSON.stringify(diagnostic), diagnostic])).values()];
|
|
83
84
|
return {
|
|
84
|
-
diagnostics: recognizeDiagnostics(root, unique),
|
|
85
|
+
diagnostics: recognizeDiagnostics(root, unique, yield* toolContractDefaults(root, unique)),
|
|
85
86
|
summary: { changed: report.summary.changed + (extra?.summary.changed ?? 0) },
|
|
86
87
|
};
|
|
87
88
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { posix } from "node:path";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import { readPackageManifest } from "#adapters/manifestInventory.ts";
|
|
4
|
+
import type { Diagnostic } from "#biome/report.ts";
|
|
4
5
|
import { isTooling } from "#imports/isTooling.ts";
|
|
5
6
|
import { entryPointsOf, isApplication, provider } from "#manifests/entryPoints.ts";
|
|
6
7
|
import { isTestCode } from "#naming/testName.ts";
|
|
7
8
|
import type { RuleInputs } from "#rule.ts";
|
|
8
|
-
import type { Diagnostic } from "./report.ts";
|
|
9
9
|
|
|
10
10
|
const UNDECLARED = "lint/correctness/noUndeclaredDependencies";
|
|
11
11
|
|
package/src/cli/args.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
2
|
import { Result } from "effect";
|
|
3
|
-
import { ACCEPTS, misplaced, OPTIONS, type Values } from "
|
|
4
|
-
import { SUBCOMMANDS } from "
|
|
3
|
+
import { ACCEPTS, misplaced, OPTIONS, type Values } from "#cli/misplaced.ts";
|
|
4
|
+
import { SUBCOMMANDS } from "#cli/subcommands.ts";
|
|
5
5
|
|
|
6
6
|
export type Command =
|
|
7
7
|
| { readonly _tag: "Ci"; readonly coverage: boolean }
|
package/src/cli/fix.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as NodePath from "@effect/platform-node/NodePath";
|
|
|
2
2
|
import { Console, Effect, FileSystem, Path } from "effect";
|
|
3
3
|
import { biomeReport } from "#biome/report.ts";
|
|
4
4
|
import { changedRanges } from "#cli/changedRanges.ts";
|
|
5
|
+
import { MAX_FIX_ROUNDS } from "#cli/limits.ts";
|
|
5
6
|
import { loadConfig } from "#config/load.ts";
|
|
6
7
|
import type { ExceptionDeclaration } from "#exceptions/declaration.ts";
|
|
7
8
|
import { SetupFailure } from "#failure.ts";
|
|
@@ -10,7 +11,6 @@ import { walk } from "#inventory/walk.ts";
|
|
|
10
11
|
import { sortManifests } from "#manifests/sorted.ts";
|
|
11
12
|
import { plural } from "#report/plural.ts";
|
|
12
13
|
import type { RuleServices } from "#rule.ts";
|
|
13
|
-
import { MAX_FIX_ROUNDS } from "./limits.ts";
|
|
14
14
|
|
|
15
15
|
function isBinary(bytes: Uint8Array): boolean {
|
|
16
16
|
return bytes.includes(0);
|
package/src/cli/program.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { lint } from "#cli/lint.ts";
|
|
|
11
11
|
import { migrateBaseline } from "#cli/migrateBaseline.ts";
|
|
12
12
|
import { migrateExceptions } from "#cli/migrateExceptions.ts";
|
|
13
13
|
import { pruneBaseline, tightenBaseline } from "#cli/shrink.ts";
|
|
14
|
+
import { USAGE } from "#cli/usage.ts";
|
|
14
15
|
import { SetupFailure } from "#failure.ts";
|
|
15
16
|
import type { Launch } from "#hooks/command.ts";
|
|
16
17
|
import { installHook } from "#hooks/install.ts";
|
|
@@ -18,7 +19,6 @@ import { preCommitHook } from "#hooks/preCommit.ts";
|
|
|
18
19
|
import { setupHook } from "#hooks/setup.ts";
|
|
19
20
|
import { hookStatus } from "#hooks/status.ts";
|
|
20
21
|
import { uninstallHook } from "#hooks/uninstall.ts";
|
|
21
|
-
import { USAGE } from "./usage.ts";
|
|
22
22
|
|
|
23
23
|
export interface Invocation {
|
|
24
24
|
readonly cwd: string;
|
package/src/cli/shrink.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Console, Effect, type FileSystem } from "effect";
|
|
2
2
|
import type { ChildProcessSpawner } from "effect/process";
|
|
3
3
|
import type { Scope } from "#baseline/update.ts";
|
|
4
|
+
import { shrinkBaseline } from "#cli/baseline.ts";
|
|
4
5
|
import type { SetupFailure } from "#failure.ts";
|
|
5
6
|
import { resolveBase } from "#git/base.ts";
|
|
6
7
|
import { changesSince } from "#git/history.ts";
|
|
7
|
-
import { shrinkBaseline } from "./baseline.ts";
|
|
8
8
|
|
|
9
9
|
function followedMoves(root: string, against: string | undefined): Effect.Effect<Scope, SetupFailure, ChildProcessSpawner.ChildProcessSpawner> {
|
|
10
10
|
return resolveBase(root, against).pipe(
|
package/src/config/load.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as NodePath from "@effect/platform-node/NodePath";
|
|
2
2
|
import { Effect, type FileSystem, Path, Schema } from "effect";
|
|
3
3
|
import { readConfig } from "#adapters/readConfig.ts";
|
|
4
|
+
import { type ConfigInput, decodeConfig } from "#config/decode.ts";
|
|
5
|
+
import { DEFAULT_EXTENSIONS } from "#config/defaultExtensions.ts";
|
|
6
|
+
import { type ResolvedRules, resolveRules } from "#config/resolve.ts";
|
|
4
7
|
import { validOrFail } from "#decoded.ts";
|
|
5
8
|
import type { ExceptionDeclaration } from "#exceptions/declaration.ts";
|
|
6
9
|
import type { SetupFailure } from "#failure.ts";
|
|
7
10
|
import type { InventoryScope } from "#inventory/collect.ts";
|
|
8
11
|
import { ConsumerDeclaration } from "#rules/suppressions/biome/ConsumerDeclaration.ts";
|
|
9
12
|
import type { Declaration } from "#rules/suppressions/biome/declarations.ts";
|
|
10
|
-
import { type ConfigInput, decodeConfig } from "./decode.ts";
|
|
11
|
-
import { DEFAULT_EXTENSIONS } from "./defaultExtensions.ts";
|
|
12
|
-
import { type ResolvedRules, resolveRules } from "./resolve.ts";
|
|
13
13
|
|
|
14
14
|
export interface ResolvedConfig extends ResolvedRules, InventoryScope {
|
|
15
15
|
readonly baseline: string;
|
package/src/config/resolve.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { configureRegistered } from "#adapters/rule.ts";
|
|
3
|
+
import type { ConfigInput } from "#config/decode.ts";
|
|
3
4
|
import type { Decoded } from "#decoded.ts";
|
|
4
5
|
import type { ActiveRule } from "#engine/runRules.ts";
|
|
5
6
|
import type { RuleIndex } from "#engine/violation.ts";
|
|
6
7
|
import type { RegisteredRule } from "#rule.ts";
|
|
7
8
|
import { builtInRules } from "#rules/builtIn.ts";
|
|
8
|
-
import type { ConfigInput } from "./decode.ts";
|
|
9
9
|
|
|
10
10
|
export interface ResolvedRules extends RuleIndex {
|
|
11
11
|
readonly active: readonly ActiveRule[];
|
package/src/decoded.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Result, Schema, SchemaIssue } from "effect";
|
|
2
2
|
import { describeIssue } from "#adapters/standardSchema.ts";
|
|
3
|
-
import { SetupFailure } from "
|
|
3
|
+
import { SetupFailure } from "#failure.ts";
|
|
4
4
|
|
|
5
5
|
export type Decoded<TValue> = { readonly _tag: "Valid"; readonly value: TValue } | { readonly _tag: "Invalid"; readonly issues: readonly string[] };
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
+
import { codeSpans, type MarkdownLine, markdownLines } from "#docs/markdownLines.ts";
|
|
2
3
|
import { packageNameOf } from "#imports/packageName.ts";
|
|
3
|
-
import { codeSpans, type MarkdownLine, markdownLines } from "./markdownLines.ts";
|
|
4
4
|
|
|
5
5
|
export interface DocumentedImport {
|
|
6
6
|
readonly line: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
+
import { type DocumentedImport, documentedImports } from "#docs/documentedImports.ts";
|
|
3
|
+
import { type DocumentedModule, documentedModule } from "#docs/documentedModule.ts";
|
|
4
|
+
import { exportsName } from "#docs/exportsName.ts";
|
|
2
5
|
import { packageNameOf } from "#imports/packageName.ts";
|
|
3
6
|
import type { WorkspacePackage } from "#imports/workspace.ts";
|
|
4
7
|
import type { Finding } from "#rule.ts";
|
|
5
|
-
import { type DocumentedImport, documentedImports } from "./documentedImports.ts";
|
|
6
|
-
import { type DocumentedModule, documentedModule } from "./documentedModule.ts";
|
|
7
|
-
import { exportsName } from "./exportsName.ts";
|
|
8
8
|
|
|
9
9
|
export interface ImportContext {
|
|
10
10
|
readonly exports: ReadonlyMap<string, unknown>;
|
package/src/docs/linkFindings.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { join, posix } from "node:path";
|
|
2
2
|
import { Effect, Result } from "effect";
|
|
3
3
|
import ts from "typescript";
|
|
4
|
+
import type { MarkdownLine } from "#docs/markdownLines.ts";
|
|
5
|
+
import { markdownLinks } from "#docs/markdownLinks.ts";
|
|
6
|
+
import { type Repository, repositoryLink } from "#docs/repositoryLink.ts";
|
|
4
7
|
import type { Finding } from "#rule.ts";
|
|
5
|
-
import type { MarkdownLine } from "./markdownLines.ts";
|
|
6
|
-
import { markdownLinks } from "./markdownLinks.ts";
|
|
7
|
-
import { type Repository, repositoryLink } from "./repositoryLink.ts";
|
|
8
8
|
|
|
9
9
|
export interface LinkContext {
|
|
10
10
|
readonly anchors: (path: string) => Effect.Effect<ReadonlySet<string> | undefined>;
|
package/src/engine/evaluate.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { applyBaseline, type Regression, type StaleBaselineEntry } from "#baseline/compare.ts";
|
|
2
2
|
import type { BaselineEntry } from "#baseline/format.ts";
|
|
3
|
+
import { byLocation, type RuleIndex, type Violation } from "#engine/violation.ts";
|
|
3
4
|
import { applyRegistry, type RegistryEntry, type StaleRegistryEntry } from "#exceptions/registry.ts";
|
|
4
|
-
import { byLocation, type RuleIndex, type Violation } from "./violation.ts";
|
|
5
5
|
|
|
6
6
|
export interface Outcome {
|
|
7
7
|
readonly baselined: number;
|
package/src/engine/runRules.ts
CHANGED
|
@@ -2,11 +2,11 @@ import { basename, isAbsolute, relative } from "node:path";
|
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import { ManifestFailure } from "#adapters/manifestInventory.ts";
|
|
4
4
|
import { inNonEffectFolder } from "#config/nonEffectFolders.ts";
|
|
5
|
+
import type { ActiveLevel, Violation } from "#engine/violation.ts";
|
|
5
6
|
import { SetupFailure } from "#failure.ts";
|
|
6
7
|
import { FilesystemFailure } from "#inventory/filesystem.ts";
|
|
7
8
|
import { posix } from "#inventory/ignoreScope.ts";
|
|
8
9
|
import type { Finding, RuleCheck, RuleInputs, RuleServices } from "#rule.ts";
|
|
9
|
-
import type { ActiveLevel, Violation } from "./violation.ts";
|
|
10
10
|
|
|
11
11
|
export interface ActiveRule {
|
|
12
12
|
readonly check: RuleCheck;
|
package/src/engine/session.ts
CHANGED
|
@@ -3,15 +3,15 @@ import { Effect, Path, type Scope } from "effect";
|
|
|
3
3
|
import { setManifestFiles } from "#adapters/manifestInventory.ts";
|
|
4
4
|
import { manifestReader } from "#adapters/manifestReader.ts";
|
|
5
5
|
import { loadConfig, type ResolvedConfig } from "#config/load.ts";
|
|
6
|
+
import { type BaselineFile, readBaseline, readInput } from "#engine/baselineFile.ts";
|
|
7
|
+
import { runRules } from "#engine/runRules.ts";
|
|
8
|
+
import type { Violation } from "#engine/violation.ts";
|
|
6
9
|
import { staleBiomeExceptions } from "#exceptions/biomeFindings.ts";
|
|
7
10
|
import type { RegistryEntry, StaleRegistryEntry } from "#exceptions/registry.ts";
|
|
8
11
|
import { registryEntries } from "#exceptions/registryEntries.ts";
|
|
9
12
|
import { SetupFailure } from "#failure.ts";
|
|
10
13
|
import { collectInventory, type Inventory } from "#inventory/collect.ts";
|
|
11
14
|
import type { RuleServices } from "#rule.ts";
|
|
12
|
-
import { type BaselineFile, readBaseline, readInput } from "./baselineFile.ts";
|
|
13
|
-
import { runRules } from "./runRules.ts";
|
|
14
|
-
import type { Violation } from "./violation.ts";
|
|
15
15
|
|
|
16
16
|
export interface Session {
|
|
17
17
|
readonly baseline: BaselineFile;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
-
import type { ExceptionDeclaration } from "
|
|
2
|
+
import type { ExceptionDeclaration } from "#exceptions/declaration.ts";
|
|
3
3
|
|
|
4
4
|
function objectOf(expression: ts.Expression): ts.ObjectLiteralExpression | undefined {
|
|
5
5
|
if (ts.isObjectLiteralExpression(expression)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ExceptionDeclaration } from "
|
|
2
|
-
import type { RegistryEntry } from "
|
|
1
|
+
import type { ExceptionDeclaration } from "#exceptions/declaration.ts";
|
|
2
|
+
import type { RegistryEntry } from "#exceptions/registry.ts";
|
|
3
3
|
|
|
4
4
|
export function registryEntries(declarations: readonly ExceptionDeclaration[]): readonly RegistryEntry[] {
|
|
5
5
|
return declarations.flatMap(({ files, reason, rules, subject }) =>
|
package/src/git/base.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import type { ChildProcessSpawner } from "effect/process";
|
|
3
3
|
import { SetupFailure } from "#failure.ts";
|
|
4
|
-
import { run } from "
|
|
4
|
+
import { run } from "#git/command.ts";
|
|
5
5
|
|
|
6
6
|
export interface Base {
|
|
7
7
|
readonly commit: string;
|
package/src/git/history.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import type { ChildProcessSpawner } from "effect/process";
|
|
3
3
|
import type { SetupFailure } from "#failure.ts";
|
|
4
|
-
import { gitOrFail } from "
|
|
4
|
+
import { gitOrFail } from "#git/command.ts";
|
|
5
5
|
|
|
6
6
|
export interface Changes {
|
|
7
7
|
readonly files: ReadonlySet<string>;
|
package/src/hooks/forwarding.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { dirname, join } from "node:path";
|
|
|
2
2
|
import { Effect, FileSystem } from "effect";
|
|
3
3
|
import { SetupFailure } from "#failure.ts";
|
|
4
4
|
import { run } from "#git/command.ts";
|
|
5
|
+
import { shellWords } from "#hooks/command.ts";
|
|
6
|
+
import { isHookShim, OWNER } from "#hooks/shim.ts";
|
|
5
7
|
import { readOptionalText } from "#inventory/filesystem.ts";
|
|
6
|
-
import { shellWords } from "./command.ts";
|
|
7
|
-
import { isHookShim, OWNER } from "./shim.ts";
|
|
8
8
|
|
|
9
9
|
const HOOKS = [
|
|
10
10
|
"applypatch-msg",
|
package/src/hooks/install.ts
CHANGED
|
@@ -4,12 +4,12 @@ import { CONFIG_FILE } from "#config/file.ts";
|
|
|
4
4
|
import { loadConfig } from "#config/load.ts";
|
|
5
5
|
import { SetupFailure } from "#failure.ts";
|
|
6
6
|
import { gitOrFail } from "#git/command.ts";
|
|
7
|
+
import { commandWords, hookCommand, type Launch, shellWords } from "#hooks/command.ts";
|
|
8
|
+
import { globalHooksPath, installForwarding } from "#hooks/forwarding.ts";
|
|
9
|
+
import { hookLocation } from "#hooks/location.ts";
|
|
10
|
+
import { hookShim, isHookShim } from "#hooks/shim.ts";
|
|
11
|
+
import { globalHookStatus } from "#hooks/status.ts";
|
|
7
12
|
import { readOptionalText } from "#inventory/filesystem.ts";
|
|
8
|
-
import { commandWords, hookCommand, type Launch, shellWords } from "./command.ts";
|
|
9
|
-
import { globalHooksPath, installForwarding } from "./forwarding.ts";
|
|
10
|
-
import { hookLocation } from "./location.ts";
|
|
11
|
-
import { hookShim, isHookShim } from "./shim.ts";
|
|
12
|
-
import { globalHookStatus } from "./status.ts";
|
|
13
13
|
|
|
14
14
|
export interface HookInstall {
|
|
15
15
|
readonly config: string | undefined;
|
package/src/hooks/setup.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as NodePath from "@effect/platform-node/NodePath";
|
|
2
2
|
import { Effect, FileSystem, Path } from "effect";
|
|
3
|
-
import { type HookInstall, installHook } from "
|
|
3
|
+
import { type HookInstall, installHook } from "#hooks/install.ts";
|
|
4
4
|
|
|
5
5
|
export const setupHook = Effect.fn("Hooks.setupHook")(function* (options: Omit<HookInstall, "force">) {
|
|
6
6
|
const { join } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
|
package/src/hooks/shim.ts
CHANGED
package/src/hooks/status.ts
CHANGED
|
@@ -3,10 +3,10 @@ import { Console, Effect, Path } from "effect";
|
|
|
3
3
|
import { executable } from "#adapters/executable.ts";
|
|
4
4
|
import { GateFailed, SetupFailure } from "#failure.ts";
|
|
5
5
|
import { gitOrFail } from "#git/command.ts";
|
|
6
|
+
import { forwardingPath, globalHooksPath } from "#hooks/forwarding.ts";
|
|
7
|
+
import { type HookLocation, hookLocation } from "#hooks/location.ts";
|
|
8
|
+
import { isHookShim } from "#hooks/shim.ts";
|
|
6
9
|
import { readOptionalText } from "#inventory/filesystem.ts";
|
|
7
|
-
import { forwardingPath, globalHooksPath } from "./forwarding.ts";
|
|
8
|
-
import { type HookLocation, hookLocation } from "./location.ts";
|
|
9
|
-
import { isHookShim } from "./shim.ts";
|
|
10
10
|
|
|
11
11
|
export const globalHookStatus = Effect.fn("Hooks.globalHookStatus")(function* (location: HookLocation) {
|
|
12
12
|
const { resolve } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
|
package/src/hooks/uninstall.ts
CHANGED
|
@@ -2,10 +2,10 @@ import * as NodePath from "@effect/platform-node/NodePath";
|
|
|
2
2
|
import { Console, Effect, FileSystem, Path } from "effect";
|
|
3
3
|
import { SetupFailure } from "#failure.ts";
|
|
4
4
|
import { gitOrFail, run } from "#git/command.ts";
|
|
5
|
+
import { forwardingPath, removeForwarding } from "#hooks/forwarding.ts";
|
|
6
|
+
import { hookLocation } from "#hooks/location.ts";
|
|
7
|
+
import { isHookShim } from "#hooks/shim.ts";
|
|
5
8
|
import { readOptionalText } from "#inventory/filesystem.ts";
|
|
6
|
-
import { forwardingPath, removeForwarding } from "./forwarding.ts";
|
|
7
|
-
import { hookLocation } from "./location.ts";
|
|
8
|
-
import { isHookShim } from "./shim.ts";
|
|
9
9
|
|
|
10
10
|
export const uninstallHook = Effect.fn("Hooks.uninstallHook")(function* (cwd: string) {
|
|
11
11
|
const { dirname } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
+
import { type AdminBindings, adminBindings } from "#imports/adminBindings.ts";
|
|
2
3
|
import type { SourceFile } from "#rule.ts";
|
|
3
4
|
import { parse } from "#rules/parse.ts";
|
|
4
|
-
import { type AdminBindings, adminBindings } from "./adminBindings.ts";
|
|
5
5
|
|
|
6
6
|
export function sourceRoot(path: string): string | undefined {
|
|
7
7
|
return /^(?:.*\/)?src\//u.exec(path)?.[0];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { posix } from "node:path";
|
|
2
|
+
import { adminEvidence, adminPath, composition, sourceRoot } from "#imports/adminEvidence.ts";
|
|
3
|
+
import type { ImportGraph } from "#imports/graph.ts";
|
|
2
4
|
import { isTestCode } from "#naming/testName.ts";
|
|
3
5
|
import type { Finding, SourceFile } from "#rule.ts";
|
|
4
|
-
import { adminEvidence, adminPath, composition, sourceRoot } from "./adminEvidence.ts";
|
|
5
|
-
import type { ImportGraph } from "./graph.ts";
|
|
6
6
|
|
|
7
7
|
function reachable(seeds: readonly string[], next: (file: string) => readonly string[]): Set<string> {
|
|
8
8
|
const reached = new Set<string>();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import ts from "typescript";
|
|
3
3
|
import { ImportCompiler } from "#adapters/import-compiler/service.ts";
|
|
4
|
+
import { browserNames } from "#imports/browserNames.ts";
|
|
4
5
|
import type { Finding, SourceFile } from "#rule.ts";
|
|
5
6
|
import { parse } from "#rules/parse.ts";
|
|
6
|
-
import { browserNames } from "./browserNames.ts";
|
|
7
7
|
|
|
8
8
|
function unbound(checker: ts.TypeChecker, node: ts.Identifier): boolean {
|
|
9
9
|
return (checker.getSymbolAtLocation(node)?.declarations ?? []).length === 0;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { posix } from "node:path";
|
|
2
|
+
import { isTooling } from "#imports/isTooling.ts";
|
|
3
|
+
import type { DeclaredRuntime, Runtime } from "#imports/runtime.ts";
|
|
4
|
+
import { packageOf, type WorkspacePackage } from "#imports/workspace.ts";
|
|
2
5
|
import { moduleRoot } from "#naming/moduleRoot.ts";
|
|
3
|
-
import { isTooling } from "./isTooling.ts";
|
|
4
|
-
import type { DeclaredRuntime, Runtime } from "./runtime.ts";
|
|
5
|
-
import { packageOf, type WorkspacePackage } from "./workspace.ts";
|
|
6
6
|
|
|
7
7
|
export interface RuntimePolicy {
|
|
8
8
|
readonly adopted: ReadonlySet<string>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { ImportCompiler } from "#adapters/import-compiler/service.ts";
|
|
3
|
+
import type { SpecifierSite } from "#imports/specifiers.ts";
|
|
4
|
+
import { workspacePackages } from "#imports/workspace.ts";
|
|
3
5
|
import type { RuleInputs } from "#rule.ts";
|
|
4
|
-
import type { SpecifierSite } from "./specifiers.ts";
|
|
5
|
-
import { workspacePackages } from "./workspace.ts";
|
|
6
6
|
|
|
7
7
|
export interface Departure extends SpecifierSite {
|
|
8
8
|
readonly file: string;
|
package/src/imports/extract.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
+
import { moduleResolver } from "#adapters/moduleResolver.ts";
|
|
2
3
|
|
|
3
4
|
export type ImportKind = "import" | "path-reference" | "resolve" | "type-reference";
|
|
4
5
|
|
|
@@ -16,7 +17,7 @@ interface Found {
|
|
|
16
17
|
readonly type: boolean;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
const MAY_CALL = /\b(?:import|require)\s*\(|\b(?:require|import\.meta)\.resolve\s*\(/u;
|
|
20
|
+
const MAY_CALL = /\b(?:import|require)\s*\(|\b(?:require|import\.meta)\.resolve\s*\(|\bcreateRequire\b/u;
|
|
20
21
|
|
|
21
22
|
const JSDOC_IMPORT = "@import";
|
|
22
23
|
|
|
@@ -55,21 +56,6 @@ function isRequire(call: ts.CallExpression): boolean {
|
|
|
55
56
|
return ts.isIdentifier(call.expression) && call.expression.text === "require";
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
function isImportMeta(node: ts.Expression): boolean {
|
|
59
|
-
return ts.isMetaProperty(node) && node.keywordToken === ts.SyntaxKind.ImportKeyword && node.name.text === "meta";
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function resolver(call: ts.CallExpression): "meta" | "require" | undefined {
|
|
63
|
-
const callee = call.expression;
|
|
64
|
-
if (!ts.isPropertyAccessExpression(callee) || callee.name.text !== "resolve") {
|
|
65
|
-
return undefined;
|
|
66
|
-
}
|
|
67
|
-
if (ts.isIdentifier(callee.expression) && callee.expression.text === "require") {
|
|
68
|
-
return "require";
|
|
69
|
-
}
|
|
70
|
-
return isImportMeta(callee.expression) ? "meta" : undefined;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
59
|
// Node resolves a relative import.meta.resolve() by URL arithmetic alone, so the path need not exist.
|
|
74
60
|
function isRelative(node: ts.Node | undefined): boolean {
|
|
75
61
|
return node !== undefined && ts.isStringLiteralLike(node) && (node.text.startsWith(".") || node.text.startsWith("/"));
|
|
@@ -80,7 +66,7 @@ function called(call: ts.CallExpression): Found | undefined {
|
|
|
80
66
|
if (call.expression.kind === ts.SyntaxKind.ImportKeyword || isRequire(call)) {
|
|
81
67
|
return { kind: "import", node: argument, type: false };
|
|
82
68
|
}
|
|
83
|
-
const how =
|
|
69
|
+
const how = moduleResolver(call);
|
|
84
70
|
const checked = how === "require" || (how === "meta" && !isRelative(argument));
|
|
85
71
|
return checked ? { kind: "resolve", node: argument, type: false } : undefined;
|
|
86
72
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
+
import { compilePolicy } from "#imports/fences/compilePolicy.ts";
|
|
3
|
+
import { discoverFences } from "#imports/fences/discover.ts";
|
|
4
|
+
import type { Fence } from "#imports/fences/model.ts";
|
|
2
5
|
import { importGraph } from "#imports/graph.ts";
|
|
3
6
|
import type { RuleInputs } from "#rule.ts";
|
|
4
|
-
import { compilePolicy } from "./compilePolicy.ts";
|
|
5
|
-
import { discoverFences } from "./discover.ts";
|
|
6
|
-
import type { Fence } from "./model.ts";
|
|
7
7
|
|
|
8
8
|
export const checkFences = Effect.fn("Imports.checkFences")(function* (inputs: RuleInputs, configured: readonly Fence[]) {
|
|
9
9
|
const graph = yield* importGraph(inputs);
|