@nadicodeai/ui 12.1.126 → 12.1.127
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/dist/eslint/index.js
CHANGED
|
@@ -57,6 +57,7 @@ import { skeletonInRegion } from "./rules/skeleton-in-region.js";
|
|
|
57
57
|
import { sortableHeadingUsesSort } from "./rules/sortable-heading-uses-sort.js";
|
|
58
58
|
import { tableCellInsetOwner } from "./rules/table-cell-inset-owner.js";
|
|
59
59
|
import { tabsSelectionIsControlled } from "./rules/tabs-selection-is-controlled.js";
|
|
60
|
+
import { testFilesFromOneDefinition } from "./rules/test-files-from-one-definition.js";
|
|
60
61
|
import { tooltipOnlyArrow } from "./rules/tooltip-only-arrow.js";
|
|
61
62
|
import { tooltipTriggerAccessibleName } from "./rules/tooltip-trigger-accessible-name.js";
|
|
62
63
|
import { workspaceDeclaresImports } from "./rules/workspace-declares-imports.js";
|
|
@@ -203,6 +204,7 @@ const plugin = {
|
|
|
203
204
|
"sortable-heading-uses-sort": sortableHeadingUsesSort,
|
|
204
205
|
"table-cell-inset-owner": tableCellInsetOwner,
|
|
205
206
|
"tabs-selection-is-controlled": tabsSelectionIsControlled,
|
|
207
|
+
"test-files-from-one-definition": testFilesFromOneDefinition,
|
|
206
208
|
"tooltip-only-arrow": tooltipOnlyArrow,
|
|
207
209
|
"tooltip-trigger-accessible-name": tooltipTriggerAccessibleName,
|
|
208
210
|
"workspace-declares-imports": workspaceDeclaresImports,
|
|
@@ -15,7 +15,7 @@ const PHRASES = [
|
|
|
15
15
|
];
|
|
16
16
|
|
|
17
17
|
const CATALOGUE_FILE = /(?:^|\/)(?:copy|i18n)\/|(?:^|\/)(?:words|messages)\.[jt]s$/;
|
|
18
|
-
const TEST_FILE = /\.test
|
|
18
|
+
const TEST_FILE = /\.test(?:-[^./]+)?\.[jt]sx?$/;
|
|
19
19
|
|
|
20
20
|
export const noStockErrorWords = {
|
|
21
21
|
meta: {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const EVERY_TEST =
|
|
2
|
+
/(?:^|\/)\*\.test(?:-\*)?\.|(?:^|\/)tests\/\*\*(?:\/\*[^/]*)?$|(?:^|\/)\*\.e2e\.ts$/;
|
|
3
|
+
|
|
4
|
+
const textOf = (node) => {
|
|
5
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- ESTree types Literal.value as string | number | boolean | RegExp | bigint | null; only typeof picks the string.
|
|
6
|
+
if (node.type === "Literal" && typeof node.value === "string") return node.value;
|
|
7
|
+
if (node.type === "TemplateLiteral")
|
|
8
|
+
return node.quasis.map((quasi) => quasi.value.cooked).join("*");
|
|
9
|
+
return null;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const variableNamed = (scope, name) => {
|
|
13
|
+
for (let current = scope; current; current = current.upper) {
|
|
14
|
+
const variable = current.set.get(name);
|
|
15
|
+
if (variable) return variable;
|
|
16
|
+
}
|
|
17
|
+
return undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const keyName = (property) =>
|
|
21
|
+
property.key.type === "Identifier" ? property.key.name : textOf(property.key);
|
|
22
|
+
|
|
23
|
+
export const testFilesFromOneDefinition = {
|
|
24
|
+
meta: {
|
|
25
|
+
type: "problem",
|
|
26
|
+
docs: {
|
|
27
|
+
description:
|
|
28
|
+
"A config block skips tests with TEST_FILES from @nadicodeai/test-support/test-files, never a glob of its own.",
|
|
29
|
+
},
|
|
30
|
+
schema: [],
|
|
31
|
+
messages: {
|
|
32
|
+
handWritten:
|
|
33
|
+
"Skip tests with TEST_FILES from @nadicodeai/test-support/test-files: a test glob written here misses the next kind of test.",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
create(context) {
|
|
37
|
+
const constantOf = (node) => {
|
|
38
|
+
if (node.type !== "Identifier") return null;
|
|
39
|
+
const definition = variableNamed(context.sourceCode.getScope(node), node.name)?.defs[0];
|
|
40
|
+
return definition?.type === "Variable" ? definition.node.init : null;
|
|
41
|
+
};
|
|
42
|
+
const checkGlobs = (node) => {
|
|
43
|
+
if (node.type === "Identifier") {
|
|
44
|
+
const init = constantOf(node);
|
|
45
|
+
if (init?.type === "ArrayExpression") checkGlobs(init);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (node.type !== "ArrayExpression") return;
|
|
49
|
+
for (const element of node.elements) {
|
|
50
|
+
if (!element) continue;
|
|
51
|
+
if (element.type === "SpreadElement") {
|
|
52
|
+
checkGlobs(element.argument);
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const glob = textOf(constantOf(element) ?? element);
|
|
56
|
+
if (glob !== null && EVERY_TEST.test(glob)) {
|
|
57
|
+
context.report({ node: element, messageId: "handWritten" });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
return {
|
|
62
|
+
Property(node) {
|
|
63
|
+
if (keyName(node) === "ignores") checkGlobs(node.value);
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadicodeai/ui",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.127",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@base-ui/react": "^1.9.0",
|
|
84
84
|
"@iconify-icons/logos": "^2.0.3",
|
|
85
85
|
"@iconify/react": "^6.0.2",
|
|
86
|
-
"@nadicodeai/design-system": "12.1.
|
|
86
|
+
"@nadicodeai/design-system": "12.1.127",
|
|
87
87
|
"@tanstack/react-table": "^9.3.1",
|
|
88
88
|
"@vgpu/wgsl": "0.6.0",
|
|
89
89
|
"class-variance-authority": "^0.7.1",
|