@shivaedev/quality 0.66.0 → 0.67.1
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 +19 -0
- package/README.md +10 -8
- package/biome/declarations.json +7 -1
- package/biome/preset.json +7 -1
- package/dist/adapters/asymmetricMatcher.d.ts +3 -0
- package/dist/adapters/asymmetricMatcher.d.ts.map +1 -0
- package/dist/adapters/asymmetricMatcher.js +27 -0
- package/dist/adapters/asymmetricMatcher.js.map +1 -0
- package/dist/adapters/buildEntryPaths.d.ts +3 -0
- package/dist/adapters/buildEntryPaths.d.ts.map +1 -0
- package/dist/adapters/buildEntryPaths.js +48 -0
- package/dist/adapters/buildEntryPaths.js.map +1 -0
- package/dist/adapters/buildEntryValue.d.ts +4 -0
- package/dist/adapters/buildEntryValue.d.ts.map +1 -0
- package/dist/adapters/buildEntryValue.js +47 -0
- package/dist/adapters/buildEntryValue.js.map +1 -0
- package/dist/adapters/bundlerEntries.d.ts +3 -0
- package/dist/adapters/bundlerEntries.d.ts.map +1 -0
- package/dist/adapters/bundlerEntries.js +49 -0
- package/dist/adapters/bundlerEntries.js.map +1 -0
- package/dist/adapters/callbackEscapes.d.ts +3 -0
- package/dist/adapters/callbackEscapes.d.ts.map +1 -0
- package/dist/adapters/callbackEscapes.js +24 -0
- package/dist/adapters/callbackEscapes.js.map +1 -0
- package/dist/adapters/composedContext.d.ts +3 -0
- package/dist/adapters/composedContext.d.ts.map +1 -0
- package/dist/adapters/composedContext.js +42 -0
- package/dist/adapters/composedContext.js.map +1 -0
- package/dist/adapters/containerDependency.d.ts +4 -0
- package/dist/adapters/containerDependency.d.ts.map +1 -0
- package/dist/adapters/containerDependency.js +28 -0
- package/dist/adapters/containerDependency.js.map +1 -0
- package/dist/adapters/contextCaptureFindings.d.ts.map +1 -1
- package/dist/adapters/contextCaptureFindings.js +3 -1
- package/dist/adapters/contextCaptureFindings.js.map +1 -1
- package/dist/adapters/foreignResources.d.ts +3 -0
- package/dist/adapters/foreignResources.d.ts.map +1 -0
- package/dist/adapters/foreignResources.js +80 -0
- package/dist/adapters/foreignResources.js.map +1 -0
- package/dist/adapters/frameworkCallback.d.ts +4 -0
- package/dist/adapters/frameworkCallback.d.ts.map +1 -0
- package/dist/adapters/frameworkCallback.js +92 -0
- package/dist/adapters/frameworkCallback.js.map +1 -0
- package/dist/adapters/frameworkOwner.d.ts +3 -0
- package/dist/adapters/frameworkOwner.d.ts.map +1 -0
- package/dist/adapters/frameworkOwner.js +35 -0
- package/dist/adapters/frameworkOwner.js.map +1 -0
- package/dist/adapters/importedCall.d.ts +6 -0
- package/dist/adapters/importedCall.d.ts.map +1 -0
- package/dist/adapters/importedCall.js +26 -0
- package/dist/adapters/importedCall.js.map +1 -0
- package/dist/adapters/isToolConfig.d.ts +2 -0
- package/dist/adapters/isToolConfig.d.ts.map +1 -0
- package/dist/adapters/isToolConfig.js +7 -0
- package/dist/adapters/isToolConfig.js.map +1 -0
- package/dist/adapters/knip/configuration.d.ts +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/run.d.ts.map +1 -1
- package/dist/adapters/knip/run.js +3 -1
- package/dist/adapters/knip/run.js.map +1 -1
- package/dist/adapters/localFunctions.d.ts +3 -0
- package/dist/adapters/localFunctions.d.ts.map +1 -0
- package/dist/adapters/localFunctions.js +20 -0
- package/dist/adapters/localFunctions.js.map +1 -0
- package/dist/adapters/pureReader.d.ts +3 -0
- package/dist/adapters/pureReader.d.ts.map +1 -0
- package/dist/adapters/pureReader.js +52 -0
- package/dist/adapters/pureReader.js.map +1 -0
- package/dist/adapters/reachableBuildEntries.d.ts +5 -0
- package/dist/adapters/reachableBuildEntries.d.ts.map +1 -0
- package/dist/adapters/reachableBuildEntries.js +52 -0
- package/dist/adapters/reachableBuildEntries.js.map +1 -0
- package/dist/adapters/readConfig.js +1 -1
- package/dist/adapters/readConfig.js.map +1 -1
- package/dist/adapters/scriptPaths.d.ts +2 -0
- package/dist/adapters/scriptPaths.d.ts.map +1 -0
- package/dist/adapters/scriptPaths.js +5 -0
- package/dist/adapters/scriptPaths.js.map +1 -0
- package/dist/adapters/serviceStateProblems.d.ts.map +1 -1
- package/dist/adapters/serviceStateProblems.js +26 -14
- package/dist/adapters/serviceStateProblems.js.map +1 -1
- package/dist/adapters/specReaderSources.d.ts +7 -0
- package/dist/adapters/specReaderSources.d.ts.map +1 -0
- package/dist/adapters/specReaderSources.js +73 -0
- package/dist/adapters/specReaderSources.js.map +1 -0
- package/dist/cli/args.js +2 -2
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/fix.d.ts +0 -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/limits.d.ts +2 -0
- package/dist/cli/limits.d.ts.map +1 -0
- package/dist/cli/limits.js +2 -0
- package/dist/cli/limits.js.map +1 -0
- package/dist/cli/{options.d.ts → misplaced.d.ts} +1 -1
- package/dist/cli/misplaced.d.ts.map +1 -0
- package/dist/cli/{options.js → misplaced.js} +1 -1
- package/dist/cli/misplaced.js.map +1 -0
- package/dist/cli/program.js +1 -1
- package/dist/cli/program.js.map +1 -1
- package/dist/cli/subcommands.d.ts +2 -0
- package/dist/cli/subcommands.d.ts.map +1 -0
- package/dist/cli/subcommands.js +6 -0
- package/dist/cli/subcommands.js.map +1 -0
- package/dist/cli/{messages.d.ts → usage.d.ts} +1 -2
- package/dist/cli/usage.d.ts.map +1 -0
- package/{src/cli/messages.ts → dist/cli/usage.js} +1 -6
- package/dist/cli/usage.js.map +1 -0
- package/dist/config/defaultExtensions.d.ts +2 -0
- package/dist/config/defaultExtensions.d.ts.map +1 -0
- package/{src/config/constants.ts → dist/config/defaultExtensions.js} +1 -2
- package/dist/config/defaultExtensions.js.map +1 -0
- package/dist/config/file.d.ts +2 -0
- package/dist/config/file.d.ts.map +1 -0
- package/dist/config/file.js +2 -0
- package/dist/config/file.js.map +1 -0
- package/dist/config/load.js +1 -1
- package/dist/config/load.js.map +1 -1
- package/dist/hooks/install.js +1 -1
- package/dist/hooks/install.js.map +1 -1
- package/dist/imports/testComposition.d.ts +4 -0
- package/dist/imports/testComposition.d.ts.map +1 -0
- package/dist/imports/testComposition.js +38 -0
- package/dist/imports/testComposition.js.map +1 -0
- package/dist/inventory/programmaticEntries.d.ts +4 -0
- package/dist/inventory/programmaticEntries.d.ts.map +1 -0
- package/dist/inventory/programmaticEntries.js +9 -0
- package/dist/inventory/programmaticEntries.js.map +1 -0
- package/dist/naming/adapters/plainData.d.ts +5 -0
- package/dist/naming/adapters/plainData.d.ts.map +1 -0
- package/dist/naming/adapters/plainData.js +77 -0
- package/dist/naming/adapters/plainData.js.map +1 -0
- package/dist/naming/constantModule.d.ts +3 -0
- package/dist/naming/constantModule.d.ts.map +1 -0
- package/dist/naming/constantModule.js +25 -0
- package/dist/naming/constantModule.js.map +1 -0
- package/dist/naming/{migrationFile.d.ts → isMigrationFile.d.ts} +1 -1
- package/dist/naming/isMigrationFile.d.ts.map +1 -0
- package/dist/naming/{migrationFile.js → isMigrationFile.js} +1 -1
- package/dist/naming/isMigrationFile.js.map +1 -0
- package/dist/naming/ownExports.d.ts +0 -1
- package/dist/naming/ownExports.d.ts.map +1 -1
- package/dist/naming/ownExports.js +11 -25
- package/dist/naming/ownExports.js.map +1 -1
- package/dist/naming/packageTests.d.ts +7 -0
- package/dist/naming/packageTests.d.ts.map +1 -0
- package/dist/naming/packageTests.js +21 -0
- package/dist/naming/packageTests.js.map +1 -0
- package/dist/naming/testCode.d.ts +4 -0
- package/dist/naming/testCode.d.ts.map +1 -0
- package/dist/naming/testCode.js +46 -0
- package/dist/naming/testCode.js.map +1 -0
- package/dist/rules/comments/kinds.js +1 -1
- package/dist/rules/comments/kinds.js.map +1 -1
- package/dist/rules/effect/contextCapture.js +1 -1
- package/dist/rules/effect/contextCapture.js.map +1 -1
- package/dist/rules/effect/program.d.ts +1 -0
- package/dist/rules/effect/program.d.ts.map +1 -1
- package/dist/rules/effect/program.js +17 -1
- package/dist/rules/effect/program.js.map +1 -1
- package/dist/rules/effect/serviceCatalog.d.ts.map +1 -1
- package/dist/rules/effect/serviceCatalog.js +10 -2
- package/dist/rules/effect/serviceCatalog.js.map +1 -1
- package/dist/rules/effect/serviceFindings.d.ts.map +1 -1
- package/dist/rules/effect/serviceFindings.js +33 -7
- package/dist/rules/effect/serviceFindings.js.map +1 -1
- package/dist/rules/effect/serviceOrigin.d.ts.map +1 -1
- package/dist/rules/effect/serviceOrigin.js +13 -1
- package/dist/rules/effect/serviceOrigin.js.map +1 -1
- package/dist/rules/effect/serviceParameters.d.ts.map +1 -1
- package/dist/rules/effect/serviceParameters.js +12 -12
- 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 +5 -1
- package/dist/rules/effect/serviceTypes.js.map +1 -1
- package/dist/rules/files/namedAfterExport.d.ts.map +1 -1
- package/dist/rules/files/namedAfterExport.js +36 -23
- package/dist/rules/files/namedAfterExport.js.map +1 -1
- package/dist/rules/imports/manifest.d.ts.map +1 -1
- package/dist/rules/imports/manifest.js +9 -11
- 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 +13 -9
- package/dist/rules/imports/noTestCode.js.map +1 -1
- package/dist/rules/maxLines.d.ts.map +1 -1
- package/dist/rules/maxLines.js +7 -2
- package/dist/rules/maxLines.js.map +1 -1
- package/dist/rules/stories/specHelpers.d.ts.map +1 -1
- package/dist/rules/stories/specHelpers.js +8 -4
- package/dist/rules/stories/specHelpers.js.map +1 -1
- package/dist/rules/suppressions/{directives.d.ts → in.d.ts} +1 -1
- package/dist/rules/suppressions/in.d.ts.map +1 -0
- package/dist/rules/suppressions/{directives.js → in.js} +1 -1
- package/dist/rules/suppressions/in.js.map +1 -0
- package/dist/rules/suppressions/noInline.js +1 -1
- package/dist/rules/suppressions/noInline.js.map +1 -1
- package/dist/rules/test-names/colocated.d.ts.map +1 -1
- package/dist/rules/test-names/colocated.js +7 -4
- package/dist/rules/test-names/colocated.js.map +1 -1
- package/dist/rules/test-names/follow.d.ts.map +1 -1
- package/dist/rules/test-names/follow.js +13 -6
- package/dist/rules/test-names/follow.js.map +1 -1
- package/package.json +4 -3
- package/src/adapters/asymmetricMatcher.ts +33 -0
- package/src/adapters/buildEntryPaths.ts +52 -0
- package/src/adapters/buildEntryValue.ts +52 -0
- package/src/adapters/bundlerEntries.ts +53 -0
- package/src/adapters/callbackEscapes.ts +32 -0
- package/src/adapters/composedContext.ts +48 -0
- package/src/adapters/containerDependency.ts +40 -0
- package/src/adapters/contextCaptureFindings.ts +3 -1
- package/src/adapters/foreignResources.ts +83 -0
- package/src/adapters/frameworkCallback.ts +106 -0
- package/src/adapters/frameworkOwner.ts +41 -0
- package/src/adapters/importedCall.ts +27 -0
- package/src/adapters/isToolConfig.ts +10 -0
- package/src/adapters/knip/configuration.ts +5 -7
- package/src/adapters/knip/run.ts +3 -1
- package/src/adapters/localFunctions.ts +22 -0
- package/src/adapters/pureReader.ts +56 -0
- package/src/adapters/reachableBuildEntries.ts +58 -0
- package/src/adapters/readConfig.ts +1 -1
- package/src/adapters/scriptPaths.ts +5 -0
- package/src/adapters/serviceStateProblems.ts +42 -17
- package/src/adapters/specReaderSources.ts +77 -0
- package/src/cli/args.ts +2 -2
- package/src/cli/fix.ts +1 -2
- package/src/cli/limits.ts +1 -0
- package/src/cli/program.ts +1 -1
- package/src/cli/subcommands.ts +5 -0
- package/{dist/cli/messages.js → src/cli/usage.ts} +0 -6
- package/{dist/config/constants.js → src/config/defaultExtensions.ts} +0 -2
- package/src/config/file.ts +1 -0
- package/src/config/load.ts +1 -1
- package/src/hooks/install.ts +1 -1
- package/src/imports/testComposition.ts +47 -0
- package/src/inventory/programmaticEntries.ts +10 -0
- package/src/naming/adapters/plainData.ts +88 -0
- package/src/naming/constantModule.ts +28 -0
- package/src/naming/ownExports.ts +11 -28
- package/src/naming/packageTests.ts +24 -0
- package/src/naming/testCode.ts +62 -0
- package/src/rules/comments/kinds.ts +1 -1
- package/src/rules/effect/contextCapture.ts +1 -1
- package/src/rules/effect/program.ts +19 -1
- package/src/rules/effect/serviceCatalog.ts +12 -2
- package/src/rules/effect/serviceFindings.ts +38 -7
- package/src/rules/effect/serviceOrigin.ts +14 -1
- package/src/rules/effect/serviceParameters.ts +13 -14
- package/src/rules/effect/serviceTypes.ts +11 -1
- package/src/rules/files/namedAfterExport.ts +46 -23
- package/src/rules/imports/manifest.ts +18 -10
- package/src/rules/imports/noTestCode.ts +13 -12
- package/src/rules/maxLines.ts +7 -3
- package/src/rules/stories/specHelpers.ts +14 -4
- package/src/rules/suppressions/noInline.ts +1 -1
- package/src/rules/test-names/colocated.ts +7 -4
- package/src/rules/test-names/follow.ts +13 -6
- package/dist/adapters/initializerDependency.d.ts +0 -3
- package/dist/adapters/initializerDependency.d.ts.map +0 -1
- package/dist/adapters/initializerDependency.js +0 -53
- package/dist/adapters/initializerDependency.js.map +0 -1
- package/dist/cli/messages.d.ts.map +0 -1
- package/dist/cli/messages.js.map +0 -1
- package/dist/cli/options.d.ts.map +0 -1
- package/dist/cli/options.js.map +0 -1
- package/dist/config/constants.d.ts +0 -3
- package/dist/config/constants.d.ts.map +0 -1
- package/dist/config/constants.js.map +0 -1
- package/dist/naming/migrationFile.d.ts.map +0 -1
- package/dist/naming/migrationFile.js.map +0 -1
- package/dist/rules/suppressions/directives.d.ts.map +0 -1
- package/dist/rules/suppressions/directives.js.map +0 -1
- package/src/adapters/initializerDependency.ts +0 -57
- /package/src/cli/{options.ts → misplaced.ts} +0 -0
- /package/src/naming/{migrationFile.ts → isMigrationFile.ts} +0 -0
- /package/src/rules/suppressions/{directives.ts → in.ts} +0 -0
|
@@ -2,8 +2,8 @@ import { join } from "node:path";
|
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import { readPackageManifest } from "#adapters/manifestInventory.ts";
|
|
4
4
|
import { packageOf, workspacePackages } from "#imports/workspace.ts";
|
|
5
|
-
import { defineRule, type
|
|
6
|
-
import {
|
|
5
|
+
import { defineRule, type RuleInputs } from "#rule.ts";
|
|
6
|
+
import { effectPrograms } from "#rules/effect/program.ts";
|
|
7
7
|
import { serviceCatalog } from "#rules/effect/serviceCatalog.ts";
|
|
8
8
|
import { serviceFindings } from "#rules/effect/serviceFindings.ts";
|
|
9
9
|
|
|
@@ -22,20 +22,19 @@ export const serviceParameters = defineRule({
|
|
|
22
22
|
files.push(source);
|
|
23
23
|
groups.set(group, files);
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
const programFor = effectPrograms(inputs);
|
|
26
|
+
return [...groups.values()].flatMap((files) => {
|
|
27
|
+
const program = programFor(files);
|
|
28
|
+
const checker = program.getTypeChecker();
|
|
29
|
+
const sources = files.flatMap((file) => {
|
|
30
|
+
const source = program.getSourceFile(join(inputs.root, file.path));
|
|
31
|
+
return source === undefined ? [] : [source];
|
|
32
|
+
});
|
|
33
|
+
return serviceFindings(inputs.root, sources, checker, serviceCatalog(program, checker, names));
|
|
34
|
+
});
|
|
26
35
|
}),
|
|
27
36
|
description:
|
|
28
|
-
"Exported 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 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, 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.",
|
|
29
38
|
id: "effect/service-parameters",
|
|
30
39
|
registrable: false,
|
|
31
40
|
});
|
|
32
|
-
|
|
33
|
-
function checkServices(inputs: RuleInputs, packages: readonly string[]): readonly Finding[] {
|
|
34
|
-
const program = effectProgram(inputs);
|
|
35
|
-
const checker = program.getTypeChecker();
|
|
36
|
-
const sources = inputs.sources.flatMap((file) => {
|
|
37
|
-
const source = program.getSourceFile(join(inputs.root, file.path));
|
|
38
|
-
return source === undefined ? [] : [source];
|
|
39
|
-
});
|
|
40
|
-
return serviceFindings(inputs.root, sources, checker, serviceCatalog(program, checker, packages));
|
|
41
|
-
}
|
|
@@ -50,7 +50,17 @@ export function serviceTypes(checker: ts.TypeChecker, initializerState = false)
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
function computation(type: ts.Type): boolean {
|
|
53
|
-
|
|
53
|
+
const handle = ["~effect/Effect", "~effect/Stream", "~effect/Fiber", "~effect/Scope/Closeable"].some(
|
|
54
|
+
(brand) => type.getProperty(brand) !== undefined,
|
|
55
|
+
);
|
|
56
|
+
const symbol = type.getSymbol();
|
|
57
|
+
return (
|
|
58
|
+
handle
|
|
59
|
+
|| (symbol?.name === "AtomContext"
|
|
60
|
+
&& (symbol.declarations ?? []).some((declaration) =>
|
|
61
|
+
/\/effect\/(?:src|dist)\/reactivity\/Atom\.(?:d\.)?ts$/u.test(declaration.getSourceFile().fileName.replaceAll("\\", "/")),
|
|
62
|
+
))
|
|
63
|
+
);
|
|
54
64
|
}
|
|
55
65
|
function implementation(type: ts.Type): boolean {
|
|
56
66
|
if (shapes.has(type)) {
|
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
import { posix } from "node:path";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
3
|
import { ignorePatterns } from "#adapters/ignore.ts";
|
|
4
|
+
import { isToolConfig } from "#adapters/isToolConfig.ts";
|
|
4
5
|
import { serviceAssemblyImports } from "#adapters/serviceAssemblyImports.ts";
|
|
5
6
|
import { directServiceDefinitions } from "#adapters/serviceAssemblySyntax.ts";
|
|
6
7
|
import { GlobDeclarations, globPatterns, validateGlobs } from "#config/globs.ts";
|
|
8
|
+
import { programmaticEntries } from "#inventory/programmaticEntries.ts";
|
|
7
9
|
import { routeFiles } from "#inventory/routeFiles.ts";
|
|
10
|
+
import { knownDataExports } from "#naming/adapters/plainData.ts";
|
|
11
|
+
import { constantModule } from "#naming/constantModule.ts";
|
|
8
12
|
import { exportFits } from "#naming/exportFits.ts";
|
|
13
|
+
import { isMigrationFile } from "#naming/isMigrationFile.ts";
|
|
9
14
|
import { mainExport } from "#naming/mainExport.ts";
|
|
10
|
-
import { isMigrationFile } from "#naming/migrationFile.ts";
|
|
11
15
|
import { moduleRoot } from "#naming/moduleRoot.ts";
|
|
12
|
-
import {
|
|
16
|
+
import { ownExports } from "#naming/ownExports.ts";
|
|
13
17
|
import { type PackageLayout, packageLayout } from "#naming/packageLayout.ts";
|
|
14
18
|
import { CAMEL, KEBAB, sameWord, wordsOf } from "#naming/words.ts";
|
|
15
19
|
import { defineRule, type Finding, type SourceFile } from "#rule.ts";
|
|
16
20
|
import { parse } from "#rules/parse.ts";
|
|
17
21
|
|
|
18
|
-
const DEFAULT_TOOL_OWNED: readonly string[] = [
|
|
19
|
-
"*.config.*",
|
|
20
|
-
"*.d.ts",
|
|
21
|
-
"*.d.mts",
|
|
22
|
-
"*.d.cts",
|
|
23
|
-
"**/.railway/railway.ts",
|
|
24
|
-
"**/.railway/railway.py",
|
|
25
|
-
"**/.railway/railway.go",
|
|
26
|
-
];
|
|
22
|
+
const DEFAULT_TOOL_OWNED: readonly string[] = ["*.d.ts", "*.d.mts", "*.d.cts"];
|
|
27
23
|
|
|
28
24
|
const TEST = /\.(?:test|spec)\.[cm]?[jt]sx?$/u;
|
|
29
25
|
|
|
@@ -51,9 +47,24 @@ function repeated(stem: string, folders: readonly string[]): string | undefined
|
|
|
51
47
|
function nameFinding(file: SourceFile, stem: string, folders: readonly string[]): string | undefined {
|
|
52
48
|
const source = parse(file);
|
|
53
49
|
const exports = source === undefined ? [] : ownExports(source);
|
|
54
|
-
const constants =
|
|
55
|
-
if (
|
|
56
|
-
|
|
50
|
+
const constants = exports.filter((entry) => entry.kind === "value" && entry.constant);
|
|
51
|
+
if (
|
|
52
|
+
source !== undefined
|
|
53
|
+
&& constants.length > 0
|
|
54
|
+
&& exports.every((entry) => entry.constant)
|
|
55
|
+
&& knownDataExports(
|
|
56
|
+
source,
|
|
57
|
+
exports.map((entry) => entry.name),
|
|
58
|
+
)
|
|
59
|
+
) {
|
|
60
|
+
return constantModule(stem, constants);
|
|
61
|
+
}
|
|
62
|
+
const remaining = exports.filter((entry) => entry.kind === "value" && !entry.constant);
|
|
63
|
+
const main = constants.length > 0 && remaining.length === 1 ? remaining[0] : undefined;
|
|
64
|
+
if (main !== undefined) {
|
|
65
|
+
return exportFits(main.name, stem, folders)
|
|
66
|
+
? undefined
|
|
67
|
+
: `"${stem}" does not name its export ${main.name}. ${SHAPES} Rename the file or the export.`;
|
|
57
68
|
}
|
|
58
69
|
const [only] = exports;
|
|
59
70
|
if (only === undefined) {
|
|
@@ -61,16 +72,16 @@ function nameFinding(file: SourceFile, stem: string, folders: readonly string[])
|
|
|
61
72
|
? undefined
|
|
62
73
|
: `"${stem}" exports nothing, so it is named in camelCase, such as setupTests.ts. A file that a package.json script or bin runs is kebab-case.`;
|
|
63
74
|
}
|
|
64
|
-
if (exports.some((entry) => exportFits(entry.name, stem, folders))) {
|
|
75
|
+
if (exports.some((entry) => !(entry.kind === "value" && entry.constant && remaining.length > 0) && exportFits(entry.name, stem, folders))) {
|
|
65
76
|
return undefined;
|
|
66
77
|
}
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
return `"${stem}" does not name its export ${
|
|
78
|
+
const primary = mainExport(exports);
|
|
79
|
+
if (primary !== undefined) {
|
|
80
|
+
return `"${stem}" does not name its export ${primary.name}. ${SHAPES} Rename the file or the export.`;
|
|
70
81
|
}
|
|
71
82
|
return CAMEL.test(stem)
|
|
72
83
|
? undefined
|
|
73
|
-
: `"${stem}" exports several things, so it is a topic file named in camelCase, such as
|
|
84
|
+
: `"${stem}" exports several things, so it is a topic file named in camelCase, such as helpers.ts. Or split it so each file has one main export. ${SHAPES}`;
|
|
74
85
|
}
|
|
75
86
|
|
|
76
87
|
function findingsOf(file: SourceFile, layout: PackageLayout): readonly Finding[] {
|
|
@@ -101,17 +112,29 @@ function findingsOf(file: SourceFile, layout: PackageLayout): readonly Finding[]
|
|
|
101
112
|
}
|
|
102
113
|
|
|
103
114
|
export const namedAfterExport = defineRule({
|
|
104
|
-
check: (
|
|
115
|
+
check: (inputs) =>
|
|
105
116
|
Effect.gen(function* () {
|
|
106
|
-
const
|
|
117
|
+
const { options, root, sources } = inputs;
|
|
118
|
+
const layout = yield* packageLayout(inputs);
|
|
119
|
+
const entries = yield* programmaticEntries(inputs);
|
|
107
120
|
const routes = yield* routeFiles(root);
|
|
108
121
|
const toolOwned = ignorePatterns([...DEFAULT_TOOL_OWNED, ...globPatterns(options.toolOwned)]);
|
|
109
122
|
return sources
|
|
110
|
-
.filter(
|
|
123
|
+
.filter(
|
|
124
|
+
(file) =>
|
|
125
|
+
!(
|
|
126
|
+
entries.has(file.path)
|
|
127
|
+
|| isToolConfig(file.path)
|
|
128
|
+
|| TEST.test(file.path)
|
|
129
|
+
|| isMigrationFile(file.path)
|
|
130
|
+
|| routes.files.has(file.path)
|
|
131
|
+
|| toolOwned.ignores(file.path)
|
|
132
|
+
),
|
|
133
|
+
)
|
|
111
134
|
.flatMap((file) => findingsOf(file, layout));
|
|
112
135
|
}),
|
|
113
136
|
description:
|
|
114
|
-
"A file is named after its main export
|
|
137
|
+
"A file is named after its main runtime export, ignoring private constants and plain-data constants beside it, with its folders as the prefix, including in test-support; module client/admin and server/admin files may repeat names from above the admin folder. defineService declarations use service.ts; TanStack Router configuration owns route filenames; programmatic bundler entries and tool configs keep their role names. A constants module holds only plain data and derived types, in a camelCase file named for words every constant shares (timeouts.ts), limits for max/min/limit constants, or defaults for default constants. Split unrelated constants. A file of several non-constant exports is a camelCase topic file, and a script is kebab-case. Rename the file or the export; nothing renames them for you.",
|
|
115
138
|
id: "files/named-after-export",
|
|
116
139
|
options: Schema.toStandardSchemaV1(NamedAfterExportOptions, {
|
|
117
140
|
parseOptions: { errors: "all", onExcessProperty: "error" },
|
|
@@ -6,7 +6,7 @@ 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 {
|
|
9
|
+
import { testCode } from "#naming/testCode.ts";
|
|
10
10
|
import { defineRule, type RuleInputs } from "#rule.ts";
|
|
11
11
|
import { bundleInputs } from "./bundleInputs.ts";
|
|
12
12
|
|
|
@@ -38,6 +38,7 @@ const manifestDependencies = Effect.fn("Imports.manifestDependencies")(function*
|
|
|
38
38
|
owner: WorkspacePackage,
|
|
39
39
|
graph: ImportGraph,
|
|
40
40
|
workspace: ReadonlyMap<string, string>,
|
|
41
|
+
isTestCode: (path: string) => boolean,
|
|
41
42
|
): Effect.fn.Return<ManifestDependencies> {
|
|
42
43
|
const path = posix.join(owner.directory, "package.json");
|
|
43
44
|
const manifest = yield* Effect.promise(() => readPackageManifest(inputs.readText, path));
|
|
@@ -45,7 +46,7 @@ const manifestDependencies = Effect.fn("Imports.manifestDependencies")(function*
|
|
|
45
46
|
return yield* Effect.die(new Error("the manifest is missing"));
|
|
46
47
|
}
|
|
47
48
|
return {
|
|
48
|
-
...bundleInputs(graph, owner, manifest, (candidate) => developmentFile(owner, candidate)),
|
|
49
|
+
...bundleInputs(graph, owner, manifest, (candidate) => developmentFile(owner, candidate, isTestCode)),
|
|
49
50
|
application: isApplication(manifest),
|
|
50
51
|
development: new Set(dependencyNames(manifest, "devDependencies")),
|
|
51
52
|
entryPoints: yield* Effect.promise(() => entryPointsOf(inputs, owner.directory, manifest, workspace)),
|
|
@@ -54,15 +55,21 @@ const manifestDependencies = Effect.fn("Imports.manifestDependencies")(function*
|
|
|
54
55
|
};
|
|
55
56
|
});
|
|
56
57
|
|
|
57
|
-
function developmentFile(owner: WorkspacePackage, path: string): boolean {
|
|
58
|
+
function developmentFile(owner: WorkspacePackage, path: string, isTestCode: (path: string) => boolean): boolean {
|
|
58
59
|
return isTestCode(path) || isTooling(owner.directory, path);
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
function developmentImport(
|
|
62
|
+
function developmentImport(
|
|
63
|
+
policy: ManifestDependencies | undefined,
|
|
64
|
+
owner: WorkspacePackage,
|
|
65
|
+
path: string,
|
|
66
|
+
runtime: ReadonlySet<string>,
|
|
67
|
+
isTestCode: (path: string) => boolean,
|
|
68
|
+
) {
|
|
62
69
|
if (runtime.has(path)) {
|
|
63
70
|
return false;
|
|
64
71
|
}
|
|
65
|
-
return developmentFile(owner, path) || policy?.privateFiles.has(path);
|
|
72
|
+
return developmentFile(owner, path, isTestCode) || policy?.privateFiles.has(path);
|
|
66
73
|
}
|
|
67
74
|
|
|
68
75
|
function declares(policy: ManifestDependencies, target: string, development: boolean): boolean {
|
|
@@ -88,6 +95,7 @@ function undeclared(owner: WorkspacePackage, policy: ManifestDependencies | unde
|
|
|
88
95
|
export const importsManifest = defineRule({
|
|
89
96
|
check: Effect.fn("Imports.check")(function* (inputs) {
|
|
90
97
|
const graph = yield* importGraph(inputs);
|
|
98
|
+
const isTestCode = yield* testCode(inputs);
|
|
91
99
|
const root: WorkspacePackage | undefined =
|
|
92
100
|
(yield* Effect.promise(() => readPackageManifest(inputs.readText, "package.json"))) === undefined ? undefined : { directory: ".", name: "." };
|
|
93
101
|
const owners = [...graph.packages, ...(root === undefined ? [] : [root])];
|
|
@@ -96,10 +104,10 @@ export const importsManifest = defineRule({
|
|
|
96
104
|
yield* Effect.forEach(
|
|
97
105
|
owners,
|
|
98
106
|
(owner) =>
|
|
99
|
-
Effect.map(
|
|
100
|
-
owner,
|
|
101
|
-
policy,
|
|
102
|
-
|
|
107
|
+
Effect.map(
|
|
108
|
+
manifestDependencies(inputs, owner, graph, workspace, isTestCode),
|
|
109
|
+
(policy): readonly [WorkspacePackage, ManifestDependencies] => [owner, policy],
|
|
110
|
+
),
|
|
103
111
|
{ concurrency: "unbounded" },
|
|
104
112
|
),
|
|
105
113
|
);
|
|
@@ -115,7 +123,7 @@ export const importsManifest = defineRule({
|
|
|
115
123
|
return [];
|
|
116
124
|
}
|
|
117
125
|
const policy = policies.get(owner);
|
|
118
|
-
const development = developmentImport(policy, owner, request.from, runtime) === true;
|
|
126
|
+
const development = developmentImport(policy, owner, request.from, runtime, isTestCode) === true;
|
|
119
127
|
if (policy !== undefined && declares(policy, target.name, development)) {
|
|
120
128
|
return [];
|
|
121
129
|
}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { importGraph } from "#imports/graph.ts";
|
|
3
|
-
import {
|
|
3
|
+
import { testCode } from "#naming/testCode.ts";
|
|
4
4
|
import { defineRule } from "#rule.ts";
|
|
5
5
|
|
|
6
6
|
export const noTestCode = defineRule({
|
|
7
|
-
check: (inputs)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
check: Effect.fn("Imports.check")(function* (inputs) {
|
|
8
|
+
const graph = yield* importGraph(inputs);
|
|
9
|
+
const isTestCode = yield* testCode(inputs);
|
|
10
|
+
return graph.edges
|
|
11
|
+
.filter((edge) => !isTestCode(edge.from) && edge.to.kind === "file" && isTestCode(edge.to.path))
|
|
12
|
+
.map((edge) => ({
|
|
13
|
+
file: edge.from,
|
|
14
|
+
line: edge.line,
|
|
15
|
+
message: `Imports test code through "${edge.specifier}". Move the shared code into a production module and import it from both production and tests.`,
|
|
16
|
+
subject: edge.specifier,
|
|
17
|
+
}));
|
|
18
|
+
}),
|
|
18
19
|
description: "Production modules import production code. Move shared code out of test files and test-support/ into a production module.",
|
|
19
20
|
id: "imports/no-test-code",
|
|
20
21
|
registrable: false,
|
package/src/rules/maxLines.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import { testCode } from "#naming/testCode.ts";
|
|
3
3
|
import { defineRule, type Finding, type SourceFile } from "#rule.ts";
|
|
4
4
|
|
|
5
5
|
const DECLARATION = /\.d\.[cm]?ts$/u;
|
|
@@ -25,8 +25,12 @@ function oversized(file: SourceFile, limit: number): readonly Finding[] {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export const maxLines = defineRule({
|
|
28
|
-
check: (
|
|
29
|
-
|
|
28
|
+
check: Effect.fn("Structure.check")(function* (inputs) {
|
|
29
|
+
const isTestCode = yield* testCode(inputs);
|
|
30
|
+
return inputs.sources
|
|
31
|
+
.filter((file) => !DECLARATION.test(file.path))
|
|
32
|
+
.flatMap((file) => oversized(file, isTestCode(file.path) ? inputs.options.test : inputs.options.source));
|
|
33
|
+
}),
|
|
30
34
|
description: "Keep each module to one job. Split a long file along its responsibilities; never golf it under the limit.",
|
|
31
35
|
id: "structure/max-lines",
|
|
32
36
|
options: Schema.toStandardSchemaV1(MaxLinesOptions, { parseOptions: { errors: "all", onExcessProperty: "error" } }),
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
+
import { pureReader } from "#adapters/pureReader.ts";
|
|
3
|
+
import { specReaderSources } from "#adapters/specReaderSources.ts";
|
|
2
4
|
import { defineRule } from "#rule.ts";
|
|
3
5
|
import { storySources } from "./sources.ts";
|
|
4
|
-
import {
|
|
6
|
+
import { findingAt, topLevelHelpers } from "./syntax.ts";
|
|
5
7
|
|
|
6
|
-
const MESSAGE =
|
|
8
|
+
const MESSAGE =
|
|
9
|
+
"Declares a setup or action helper in a spec. Move the action into the story kit's verbs or the setup into its traits in test-support/.";
|
|
7
10
|
|
|
8
11
|
export const specHelpers = defineRule({
|
|
9
|
-
check: (inputs) =>
|
|
10
|
-
|
|
12
|
+
check: (inputs) =>
|
|
13
|
+
Effect.map(storySources(inputs), (stories) =>
|
|
14
|
+
specReaderSources(stories).flatMap(({ source, readCall }) =>
|
|
15
|
+
topLevelHelpers(source)
|
|
16
|
+
.filter((node) => !pureReader(node, readCall))
|
|
17
|
+
.map((node) => findingAt(source, node, MESSAGE)),
|
|
18
|
+
),
|
|
19
|
+
),
|
|
20
|
+
description: "Specs state expectations and may keep pure matchers and readers; story-kit traits and verbs in test-support own setup and actions.",
|
|
11
21
|
id: "tests/spec-helpers",
|
|
12
22
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineRule, type Finding, type RuleInputs } from "#rule.ts";
|
|
2
2
|
import { type SourceComment, scanComments } from "#rules/comments/scan.ts";
|
|
3
|
-
import { suppressionIn } from "./
|
|
3
|
+
import { suppressionIn } from "./in.ts";
|
|
4
4
|
import { STYLESHEET, stylesheetComments } from "./stylesheetComments.ts";
|
|
5
5
|
|
|
6
6
|
const TYPE_TEST = /(?:(?:^|\/)typecheck\.test|\.typecheck\.(?:test|spec))\.[cm]?[jt]sx?$/u;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { posix } from "node:path";
|
|
2
|
-
import { Schema } from "effect";
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
3
3
|
import { ignorePatterns } from "#adapters/ignore.ts";
|
|
4
4
|
import { GlobDeclarations, globPatterns, validateGlobs } from "#config/globs.ts";
|
|
5
|
+
import { packageTests } from "#naming/packageTests.ts";
|
|
5
6
|
import { isTestCode, testName } from "#naming/testName.ts";
|
|
6
7
|
import { defineRule, type Finding } from "#rule.ts";
|
|
7
8
|
|
|
@@ -31,11 +32,13 @@ function findingOf(path: string, sourceFolders: ReadonlySet<string>): readonly F
|
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
export const testsColocated = defineRule({
|
|
34
|
-
check: (
|
|
35
|
+
check: Effect.fn("Tests.check")(function* (inputs) {
|
|
36
|
+
const { files, options } = inputs;
|
|
37
|
+
const trees = yield* packageTests(inputs);
|
|
35
38
|
const suites = ignorePatterns([...globPatterns(options.suites)]);
|
|
36
39
|
const sourceFolders = new Set(files.filter((path) => !isTestCode(path)).map((path) => posix.dirname(path)));
|
|
37
|
-
return files.filter((path) => !suites.ignores(path)).flatMap((path) => findingOf(path, sourceFolders));
|
|
38
|
-
},
|
|
40
|
+
return files.filter((path) => !suites.ignores(path) && trees.sourcePath(path) === undefined).flatMap((path) => findingOf(path, sourceFolders));
|
|
41
|
+
}),
|
|
39
42
|
description:
|
|
40
43
|
"A test sits beside the code it covers, at its module root or directly beside its module folder. Outside declared suites, __tests__ is always a test folder; test, tests and spec are test folders only when their directly contained checked files are all tests or test support. Shared test support belongs in test-support/.",
|
|
41
44
|
id: "tests/colocated",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { posix } from "node:path";
|
|
2
|
-
import { Schema } from "effect";
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
3
3
|
import { ignorePatterns } from "#adapters/ignore.ts";
|
|
4
4
|
import { GlobDeclarations, globPatterns, validateGlobs } from "#config/globs.ts";
|
|
5
|
+
import { packageTests } from "#naming/packageTests.ts";
|
|
5
6
|
import { ENVIRONMENTS, type TestName, testName } from "#naming/testName.ts";
|
|
6
7
|
import { CAMEL } from "#naming/words.ts";
|
|
7
8
|
import { defineRule, type Finding, type SourceFile } from "#rule.ts";
|
|
@@ -67,22 +68,28 @@ function environmentMessage(file: string, name: TestName, source: SourceFile): s
|
|
|
67
68
|
return `"${file}" uses the DOM, so it is ${name.stem}.dom.${name.kind}${name.extension}${unit} and runs in the dom project.`;
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
function findingsOf(source: SourceFile, siblings: ReadonlySet<string
|
|
71
|
+
function findingsOf(source: SourceFile, siblings: ReadonlySet<string>, sourcePath: (path: string) => string | undefined): readonly Finding[] {
|
|
71
72
|
const name = testName(source.path);
|
|
72
73
|
if (name === undefined) {
|
|
73
74
|
return [];
|
|
74
75
|
}
|
|
75
76
|
const file = posix.basename(source.path);
|
|
76
|
-
const messages = [
|
|
77
|
+
const messages = [
|
|
78
|
+
suffixMessage(file, name),
|
|
79
|
+
placeMessage(file, { ...name, folder: posix.dirname(sourcePath(source.path) ?? source.path) }, siblings),
|
|
80
|
+
environmentMessage(file, name, source),
|
|
81
|
+
];
|
|
77
82
|
return messages.flatMap((message) => (message === undefined ? [] : [{ file: source.path, message }]));
|
|
78
83
|
}
|
|
79
84
|
|
|
80
85
|
export const testsFollow = defineRule({
|
|
81
|
-
check: (
|
|
86
|
+
check: Effect.fn("Tests.check")(function* (inputs) {
|
|
87
|
+
const { files, options, sources } = inputs;
|
|
88
|
+
const trees = yield* packageTests(inputs);
|
|
82
89
|
const suites = ignorePatterns([...globPatterns(options.suites)]);
|
|
83
90
|
const siblings = siblingsIn(files);
|
|
84
|
-
return sources.filter((source) => !suites.ignores(source.path)).flatMap((source) => findingsOf(source, siblings));
|
|
85
|
-
},
|
|
91
|
+
return sources.filter((source) => !suites.ignores(source.path)).flatMap((source) => findingsOf(source, siblings, trees.sourcePath));
|
|
92
|
+
}),
|
|
86
93
|
description:
|
|
87
94
|
"A .test file follows the file beside it, a .spec names a behaviour of its folder, the only suffix is one modifier of dom, heavy, slow, typecheck and unit, and a test that uses the DOM is a .dom test.",
|
|
88
95
|
id: "tests/follow",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"initializerDependency.d.ts","sourceRoot":"","sources":["../../src/adapters/initializerDependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AA8B5B,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,eAAqB,GAAG,OAAO,CA0BhH"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { effectSuccess } from "#adapters/serviceModelSyntax.ts";
|
|
3
|
-
const DATA = ts.TypeFlags.StringLike
|
|
4
|
-
| ts.TypeFlags.NumberLike
|
|
5
|
-
| ts.TypeFlags.BooleanLike
|
|
6
|
-
| ts.TypeFlags.ESSymbolLike
|
|
7
|
-
| ts.TypeFlags.BigIntLike
|
|
8
|
-
| ts.TypeFlags.Null
|
|
9
|
-
| ts.TypeFlags.Undefined
|
|
10
|
-
| ts.TypeFlags.Void
|
|
11
|
-
| ts.TypeFlags.Never
|
|
12
|
-
| ts.TypeFlags.Unknown
|
|
13
|
-
| ts.TypeFlags.Any;
|
|
14
|
-
const OWNED = /\/effect\/(?:src|dist(?:\/dts)?)\/(?:Ref|SynchronizedRef|ScopedRef|Cache|ScopedCache|Semaphore|Deferred)\.(?:d\.)?ts$/u;
|
|
15
|
-
const COLLECTIONS = new Set(["Map", "ReadonlyMap", "Set", "ReadonlySet", "Array", "ReadonlyArray"]);
|
|
16
|
-
function owned(type) {
|
|
17
|
-
const symbol = type.getSymbol();
|
|
18
|
-
return (symbol?.declarations ?? []).some((declaration) => {
|
|
19
|
-
const path = declaration.getSourceFile().fileName.replaceAll("\\", "/");
|
|
20
|
-
return OWNED.test(path) || (COLLECTIONS.has(symbol?.name ?? "") && /\/lib\.[^/]+\.d\.ts$/u.test(path));
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
function reference(type) {
|
|
24
|
-
return "objectFlags" in type && typeof type.objectFlags === "number" && (type.objectFlags & ts.ObjectFlags.Reference) !== 0;
|
|
25
|
-
}
|
|
26
|
-
export function initializerDependency(checker, type, seen = new Set()) {
|
|
27
|
-
if (seen.has(type) || type.flags & DATA) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
seen.add(type);
|
|
31
|
-
if (type.isUnionOrIntersection()) {
|
|
32
|
-
return type.types.some((part) => initializerDependency(checker, part, seen));
|
|
33
|
-
}
|
|
34
|
-
const success = effectSuccess(checker, type);
|
|
35
|
-
if (success !== undefined) {
|
|
36
|
-
return initializerDependency(checker, success, seen);
|
|
37
|
-
}
|
|
38
|
-
if (owned(type)) {
|
|
39
|
-
const arguments_ = reference(type) ? checker.getTypeArguments(type) : [];
|
|
40
|
-
return arguments_.some((argument) => initializerDependency(checker, argument, seen));
|
|
41
|
-
}
|
|
42
|
-
for (const signature of type.getCallSignatures()) {
|
|
43
|
-
const result = signature.getReturnType();
|
|
44
|
-
if (effectSuccess(checker, result) !== undefined || (result.getProperty("then") !== undefined && result.getSymbol()?.name === "Promise")) {
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
if (initializerDependency(checker, result, seen)) {
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return type.getProperties().some((property) => initializerDependency(checker, checker.getTypeOfSymbol(property), seen));
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=initializerDependency.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"initializerDependency.js","sourceRoot":"","sources":["../../src/adapters/initializerDependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,MAAM,IAAI,GACT,EAAE,CAAC,SAAS,CAAC,UAAU;MACrB,EAAE,CAAC,SAAS,CAAC,UAAU;MACvB,EAAE,CAAC,SAAS,CAAC,WAAW;MACxB,EAAE,CAAC,SAAS,CAAC,YAAY;MACzB,EAAE,CAAC,SAAS,CAAC,UAAU;MACvB,EAAE,CAAC,SAAS,CAAC,IAAI;MACjB,EAAE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;YAClD,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACzH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,84GAwCwC,CAAC;AAE3D,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIxD,CAAC"}
|
package/dist/cli/messages.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DAwCqC,CAAC;AAE3D,MAAM,CAAC,MAAM,WAAW,GAAqC;IAC5D,QAAQ,EAAE,yEAAyE;IACnF,UAAU,EAAE,2BAA2B;IACvC,KAAK,EAAE,uDAAuD;CAC9D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/cli/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,eAAO,MAAM,OAAO;aACnB,OAAO;iBAAI,IAAI,EAAE,QAAQ;;aACzB,MAAM;iBAAI,IAAI,EAAE,QAAQ;;aACxB,QAAQ;iBAAI,IAAI,EAAE,SAAS;;aAC3B,IAAI;iBAAI,QAAQ;iBAAQ,IAAI,EAAE,QAAQ;;aACtC,gBAAgB;iBAAI,IAAI,EAAE,SAAS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,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IACvH,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,MAAM,oBAAoB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;AAClG,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAE/C,eAAO,MAAM,kBAAkB,UAAiE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,mBAAmB,CAAC;AAE/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrationFile.d.ts","sourceRoot":"","sources":["../../src/naming/migrationFile.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAC5D,eAAO,MAAM,sBAAsB,QAAkD,CAAC;AAEtF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMrD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrationFile.js","sourceRoot":"","sources":["../../src/naming/migrationFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAC5D,MAAM,CAAC,MAAM,sBAAsB,GAAG,+CAA+C,CAAC;AAEtF,MAAM,UAAU,eAAe,CAAC,IAAY;IAC3C,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,YAAY,GAAG,SAAS,KAAK,oBAAoB,IAAI,SAAS,CAAC,QAAQ,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC;IAC1G,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,OAAO,GAAG,IAAI,KAAK,SAAS,IAAI,SAAS,KAAK,GAAG,IAAI,oBAAoB,CAAC;IAChF,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,IAAI,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACvF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../../../src/rules/suppressions/directives.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EASzC,CAAC;AAYF,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAExE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"directives.js","sourceRoot":"","sources":["../../../src/rules/suppressions/directives.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAsB;IAC9C,yCAAyC;IACzC,gDAAgD;IAChD,qEAAqE;IACrE,uCAAuC;IACvC,kBAAkB;IAClB,4BAA4B;IAC5B,oDAAoD;IACpD,iBAAiB;CACjB,CAAC;AAEF,MAAM,oBAAoB,GAAG,mCAAmC,CAAC;AAEjE,MAAM,MAAM,GAAG,WAAW,CAAC;AAE3B,SAAS,WAAW,CAAC,OAAsB,EAAE,IAAY;IACxD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;IACnG,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;AACzH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,OAAsB;IACnD,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;AAC5G,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { effectSuccess } from "#adapters/serviceModelSyntax.ts";
|
|
3
|
-
|
|
4
|
-
const DATA =
|
|
5
|
-
ts.TypeFlags.StringLike
|
|
6
|
-
| ts.TypeFlags.NumberLike
|
|
7
|
-
| ts.TypeFlags.BooleanLike
|
|
8
|
-
| ts.TypeFlags.ESSymbolLike
|
|
9
|
-
| ts.TypeFlags.BigIntLike
|
|
10
|
-
| ts.TypeFlags.Null
|
|
11
|
-
| ts.TypeFlags.Undefined
|
|
12
|
-
| ts.TypeFlags.Void
|
|
13
|
-
| ts.TypeFlags.Never
|
|
14
|
-
| ts.TypeFlags.Unknown
|
|
15
|
-
| ts.TypeFlags.Any;
|
|
16
|
-
const OWNED = /\/effect\/(?:src|dist(?:\/dts)?)\/(?:Ref|SynchronizedRef|ScopedRef|Cache|ScopedCache|Semaphore|Deferred)\.(?:d\.)?ts$/u;
|
|
17
|
-
const COLLECTIONS = new Set(["Map", "ReadonlyMap", "Set", "ReadonlySet", "Array", "ReadonlyArray"]);
|
|
18
|
-
|
|
19
|
-
function owned(type: ts.Type): boolean {
|
|
20
|
-
const symbol = type.getSymbol();
|
|
21
|
-
return (symbol?.declarations ?? []).some((declaration) => {
|
|
22
|
-
const path = declaration.getSourceFile().fileName.replaceAll("\\", "/");
|
|
23
|
-
return OWNED.test(path) || (COLLECTIONS.has(symbol?.name ?? "") && /\/lib\.[^/]+\.d\.ts$/u.test(path));
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function reference(type: ts.Type): type is ts.TypeReference {
|
|
28
|
-
return "objectFlags" in type && typeof type.objectFlags === "number" && (type.objectFlags & ts.ObjectFlags.Reference) !== 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function initializerDependency(checker: ts.TypeChecker, type: ts.Type, seen = new Set<ts.Type>()): boolean {
|
|
32
|
-
if (seen.has(type) || type.flags & DATA) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
seen.add(type);
|
|
36
|
-
if (type.isUnionOrIntersection()) {
|
|
37
|
-
return type.types.some((part) => initializerDependency(checker, part, seen));
|
|
38
|
-
}
|
|
39
|
-
const success = effectSuccess(checker, type);
|
|
40
|
-
if (success !== undefined) {
|
|
41
|
-
return initializerDependency(checker, success, seen);
|
|
42
|
-
}
|
|
43
|
-
if (owned(type)) {
|
|
44
|
-
const arguments_ = reference(type) ? checker.getTypeArguments(type) : [];
|
|
45
|
-
return arguments_.some((argument) => initializerDependency(checker, argument, seen));
|
|
46
|
-
}
|
|
47
|
-
for (const signature of type.getCallSignatures()) {
|
|
48
|
-
const result = signature.getReturnType();
|
|
49
|
-
if (effectSuccess(checker, result) !== undefined || (result.getProperty("then") !== undefined && result.getSymbol()?.name === "Promise")) {
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
if (initializerDependency(checker, result, seen)) {
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return type.getProperties().some((property) => initializerDependency(checker, checker.getTypeOfSymbol(property), seen));
|
|
57
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|