@zgeoff/oxlint-config 0.10.7 → 0.10.9
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.
|
@@ -12,7 +12,7 @@ export default function buildTestBesideModule(rigLanes) {
|
|
|
12
12
|
type: 'problem',
|
|
13
13
|
messages: {
|
|
14
14
|
missing:
|
|
15
|
-
'Move this test beside the module it tests: no `{{name}}.<ext>` sits in this directory. A test that runs the built program belongs in `e2e/` of the package that builds it,
|
|
15
|
+
'Move this test beside the module it tests: no `{{name}}.<ext>` sits in this directory. A test that runs the built program belongs in `e2e/` of the package that builds it, an evaluation in `evals/` of the package whose code it scores, and a test of the repo config files at the repo root.',
|
|
16
16
|
rigLanes:
|
|
17
17
|
'Declare lanes in rig.config.ts only: this repo has one, and the `lanes` option here would give the lanes a second source.',
|
|
18
18
|
},
|
|
@@ -45,16 +45,19 @@ export default function buildTestBesideModule(rigLanes) {
|
|
|
45
45
|
const filename = context.physicalFilename;
|
|
46
46
|
const match = testFilePattern.exec(basename(filename));
|
|
47
47
|
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
if (match === null) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const root = resolveRepoRoot(filename) ?? context.cwd;
|
|
53
|
+
|
|
54
|
+
if (resolveSuiteDirectory(root, filename) !== null) {
|
|
52
55
|
return;
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
const name = toModuleName(match.groups.base, lanes);
|
|
56
59
|
|
|
57
|
-
if (probeModuleSibling(dirname(filename), name)) {
|
|
60
|
+
if (probeModuleSibling(dirname(filename), name) || isRepoFactTest(root, filename, name)) {
|
|
58
61
|
return;
|
|
59
62
|
}
|
|
60
63
|
|
|
@@ -94,3 +97,9 @@ function probeModuleSibling(directory, name) {
|
|
|
94
97
|
function probeFile(path) {
|
|
95
98
|
return statSync(path, { throwIfNoEntry: false })?.isFile() ?? false;
|
|
96
99
|
}
|
|
100
|
+
|
|
101
|
+
// a test at the repo root checks the repo's own config files, which no module beside it holds; a
|
|
102
|
+
// name with a dot left in it still needs its module, as chex test-layout says
|
|
103
|
+
function isRepoFactTest(root, filename, name) {
|
|
104
|
+
return dirname(filename) === root && !name.includes('.');
|
|
105
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgeoff/oxlint-config",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.9",
|
|
4
4
|
"description": "Shareable oxlint config: strict categories, house-style rules, and a custom JS plugin",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
112
|
"@types/bun": "1.4.4",
|
|
113
|
-
"@zgeoff/rig": "0.2.
|
|
113
|
+
"@zgeoff/rig": "0.2.5",
|
|
114
114
|
"@zgeoff/std": "0.4.3",
|
|
115
115
|
"@zgeoff/testing": "0.3.0",
|
|
116
116
|
"tsrs": "0.18.0-ts7.1.0-dev.20260929",
|
|
@@ -11,10 +11,7 @@ export default function resolveSuiteDirectory(root, filename) {
|
|
|
11
11
|
for (const [index, name] of directories.entries()) {
|
|
12
12
|
const parent = join(root, ...directories.slice(0, index));
|
|
13
13
|
|
|
14
|
-
if (
|
|
15
|
-
(name === 'e2e' || name === 'integration' || name === 'evals') &&
|
|
16
|
-
probeAppRoot(root, parent)
|
|
17
|
-
) {
|
|
14
|
+
if ((name === 'e2e' || name === 'evals') && probeAppRoot(root, parent)) {
|
|
18
15
|
return name;
|
|
19
16
|
}
|
|
20
17
|
|