@shivaedev/quality 0.66.0 → 0.67.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 +12 -0
- package/README.md +6 -4
- 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/knip/configuration.d.ts.map +1 -1
- package/dist/adapters/knip/configuration.js +2 -1
- package/dist/adapters/knip/configuration.js.map +1 -1
- 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/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/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/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/files/namedAfterExport.d.ts.map +1 -1
- package/dist/rules/files/namedAfterExport.js +23 -11
- 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 +3 -3
- package/src/adapters/asymmetricMatcher.ts +33 -0
- package/src/adapters/knip/configuration.ts +2 -5
- package/src/adapters/pureReader.ts +56 -0
- package/src/adapters/readConfig.ts +1 -1
- package/src/adapters/scriptPaths.ts +5 -0
- 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/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/files/namedAfterExport.ts +28 -11
- 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/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/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
|
@@ -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":"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,E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AC;IAC1B,kBAAkB,EAAE,EAAE;IACtB,cAAc,EAAE,EAAE;IAClB,iBAAiB,EAAE,EAAE;IACrB,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,EAAE;CACT,CAAC;AAEF,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,MAAc;IACrD,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAChH,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,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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AAC,SAAS,EAAE,EAAE,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;AAC5G,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|