@nadicodeai/ui 1.0.2 → 1.1.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.
Files changed (133) hide show
  1. package/AGENTS.md +13 -13
  2. package/README.md +1 -1
  3. package/dist/agents.d.ts +8 -8
  4. package/dist/components/accordion.js +1 -1
  5. package/dist/components/action-band.js +1 -1
  6. package/dist/components/agent-card.d.ts +1 -1
  7. package/dist/components/agent-visual.d.ts +1 -1
  8. package/dist/components/alert-dialog.d.ts +1 -1
  9. package/dist/components/automation-section.d.ts +2 -2
  10. package/dist/components/avatar.d.ts.map +1 -1
  11. package/dist/components/avatar.js +3 -1
  12. package/dist/components/badge.js +1 -1
  13. package/dist/components/brand-icons/apple.d.ts +1 -1
  14. package/dist/components/brand-icons/linux.d.ts +1 -1
  15. package/dist/components/brand-icons/windows.d.ts +1 -1
  16. package/dist/components/brand-icons.d.ts +4 -4
  17. package/dist/components/button-group.d.ts +1 -1
  18. package/dist/components/button.js +1 -1
  19. package/dist/components/calendar.d.ts +1 -1
  20. package/dist/components/calendar.js +1 -1
  21. package/dist/components/card.d.ts.map +1 -1
  22. package/dist/components/card.js +2 -4
  23. package/dist/components/carousel.d.ts +1 -1
  24. package/dist/components/carousel.d.ts.map +1 -1
  25. package/dist/components/chart-breakdown-table.d.ts +2 -2
  26. package/dist/components/chart-bullet-bar.js +5 -5
  27. package/dist/components/chart-date-range-control.d.ts +1 -1
  28. package/dist/components/chart-kpi-stat.d.ts +1 -1
  29. package/dist/components/chart-time-series.d.ts +1 -1
  30. package/dist/components/chart-time-series.d.ts.map +1 -1
  31. package/dist/components/chart-time-series.js +10 -9
  32. package/dist/components/chart.d.ts.map +1 -1
  33. package/dist/components/chart.js +13 -3
  34. package/dist/components/checkbox.js +1 -1
  35. package/dist/components/combobox.js +2 -2
  36. package/dist/components/command.d.ts +1 -1
  37. package/dist/components/command.d.ts.map +1 -1
  38. package/dist/components/command.js +2 -2
  39. package/dist/components/context-menu.js +1 -1
  40. package/dist/components/dashboard-shell.d.ts +1 -1
  41. package/dist/components/disclosure-row.d.ts.map +1 -1
  42. package/dist/components/disclosure-row.js +1 -3
  43. package/dist/components/dropdown-menu.js +1 -1
  44. package/dist/components/faq-item.d.ts +1 -1
  45. package/dist/components/faq-item.d.ts.map +1 -1
  46. package/dist/components/faq-item.js +2 -2
  47. package/dist/components/feedback-state.d.ts +1 -1
  48. package/dist/components/field.d.ts +1 -1
  49. package/dist/components/footer.d.ts.map +1 -1
  50. package/dist/components/footer.js +1 -1
  51. package/dist/components/form.d.ts +1 -1
  52. package/dist/components/glass-control.js +1 -1
  53. package/dist/components/hero.js +1 -1
  54. package/dist/components/input-group.d.ts +1 -1
  55. package/dist/components/input-group.js +3 -3
  56. package/dist/components/input-otp.d.ts.map +1 -1
  57. package/dist/components/input-otp.js +6 -3
  58. package/dist/components/input.js +1 -1
  59. package/dist/components/integration-flow.d.ts.map +1 -1
  60. package/dist/components/integration-flow.js +5 -5
  61. package/dist/components/item.d.ts +1 -1
  62. package/dist/components/item.js +1 -1
  63. package/dist/components/label-system.js +1 -1
  64. package/dist/components/live-demo.js +2 -2
  65. package/dist/components/menubar.d.ts +1 -1
  66. package/dist/components/menubar.js +1 -1
  67. package/dist/components/native-select.js +1 -1
  68. package/dist/components/nav-bar.d.ts.map +1 -1
  69. package/dist/components/nav-bar.js +1 -1
  70. package/dist/components/navigation-menu.d.ts.map +1 -1
  71. package/dist/components/navigation-menu.js +5 -5
  72. package/dist/components/pagination.d.ts +1 -1
  73. package/dist/components/plugin-slot-boundary.d.ts.map +1 -1
  74. package/dist/components/plugin-slot-boundary.js +1 -1
  75. package/dist/components/popover.js +1 -1
  76. package/dist/components/radio-group.js +1 -1
  77. package/dist/components/resizable.d.ts.map +1 -1
  78. package/dist/components/resizable.js +4 -2
  79. package/dist/components/scroll-area.js +1 -1
  80. package/dist/components/seam-grid.d.ts +1 -1
  81. package/dist/components/select.js +4 -4
  82. package/dist/components/settings-section.d.ts +1 -1
  83. package/dist/components/sidebar.d.ts +4 -4
  84. package/dist/components/sidebar.d.ts.map +1 -1
  85. package/dist/components/sidebar.js +6 -7
  86. package/dist/components/slider.js +1 -1
  87. package/dist/components/status-dot.js +2 -2
  88. package/dist/components/switch.js +1 -1
  89. package/dist/components/tabs.js +1 -1
  90. package/dist/components/textarea.js +1 -1
  91. package/dist/components/texture-strip.d.ts.map +1 -1
  92. package/dist/components/texture-strip.js +3 -0
  93. package/dist/components/theme-mode-switcher.d.ts +2 -2
  94. package/dist/components/toggle-group.d.ts +1 -1
  95. package/dist/components/toggle.js +1 -1
  96. package/dist/eslint/index.js +23 -17
  97. package/dist/eslint/rules/confirm-destructive-action.js +177 -0
  98. package/dist/eslint/rules/jsx-class-utility.js +162 -176
  99. package/dist/eslint/rules/no-app-feature-component.js +100 -0
  100. package/dist/eslint/rules/no-deprecated-zod-api.js +63 -15
  101. package/dist/eslint/rules/no-elevated-edge.js +144 -0
  102. package/dist/eslint/rules/no-mono-title-register.js +73 -0
  103. package/dist/eslint/rules/no-native-visible-control.js +6 -3
  104. package/dist/eslint/rules/no-package-component-redefinition.js +175 -0
  105. package/dist/eslint/rules/no-paired-size-utility.js +66 -0
  106. package/dist/eslint/rules/no-repainted-focus.js +80 -0
  107. package/dist/eslint/rules/no-resting-settings-control.js +87 -0
  108. package/dist/eslint/rules/no-shadcn-appearance-override.js +30 -56
  109. package/dist/eslint/rules/no-unpinned-vercel-functions-import.js +25 -23
  110. package/dist/eslint/rules/server-action-discipline.js +182 -0
  111. package/dist/eslint/rules/shadcn-composition.js +131 -0
  112. package/dist/hooks/index.d.ts +3 -3
  113. package/dist/index.d.ts +132 -132
  114. package/dist/internal/agent-visual/poster.d.ts +1 -1
  115. package/dist/internal/agent-visual/renderer.d.ts +1 -1
  116. package/dist/internal/assistant-ui/attachment.js +1 -1
  117. package/dist/internal/assistant-ui/follow-up-suggestions.d.ts.map +1 -1
  118. package/dist/internal/assistant-ui/follow-up-suggestions.js +5 -1
  119. package/dist/internal/assistant-ui/reasoning.d.ts +1 -1
  120. package/dist/internal/assistant-ui/tool-fallback.d.ts +1 -1
  121. package/dist/internal/assistant-ui/tool-group.d.ts +1 -1
  122. package/dist/internal/assistant-ui/tooltip-icon-button.d.ts +1 -1
  123. package/dist/styles/globals.css +37 -12
  124. package/docs/consuming-cross-repo.md +2 -2
  125. package/docs/contract.md +30 -20
  126. package/docs/migration/base-ui-migration.md +2 -2
  127. package/package.json +7 -6
  128. package/dist/eslint/rules/no-design-system-src-import.js +0 -11
  129. package/dist/eslint/rules/no-raw-color-utility.js +0 -109
  130. package/dist/eslint/rules/no-raw-focus-ring-width.js +0 -30
  131. package/dist/eslint/rules/no-raw-logo-import.js +0 -41
  132. package/dist/eslint/rules/no-ui-src-import.js +0 -10
  133. package/dist/eslint/rules/src-import-boundary.js +0 -207
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nadicodeai/ui",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -63,7 +63,7 @@
63
63
  "@assistant-ui/react": "0.15.1",
64
64
  "@assistant-ui/react-markdown": "0.14.8",
65
65
  "@base-ui/react": "^1.6.0",
66
- "@nadicodeai/design-system": "1.0.2",
66
+ "@nadicodeai/design-system": "1.1.0",
67
67
  "@paper-design/shaders": "0.0.78",
68
68
  "class-variance-authority": "^0.7.1",
69
69
  "clsx": "^2.1.1",
@@ -94,18 +94,19 @@
94
94
  "devDependencies": {
95
95
  "@iconify-json/logos": "^1.2.11",
96
96
  "@iconify/utils": "^3.1.4",
97
+ "@nadicodeai/eslint-plugin": "*",
97
98
  "@stryker-mutator/core": "9.6.1",
98
99
  "@stryker-mutator/vitest-runner": "9.6.1",
99
100
  "@tailwindcss/postcss": "^4.3.1",
100
101
  "@testing-library/react": "^16.3.2",
101
- "@types/react": "^19",
102
- "@types/react-dom": "^19",
102
+ "@types/react": "19.2.18",
103
+ "@types/react-dom": "19.2.4",
103
104
  "axe-core": "^4.12.0",
104
105
  "eslint": "^9.39.4",
105
106
  "jsdom": "^26.1.0",
106
107
  "postcss": "^8.5.15",
107
- "react": "19.2.7",
108
- "react-dom": "19.2.7",
108
+ "react": "19.2.8",
109
+ "react-dom": "19.2.8",
109
110
  "shadcn": "4.13.0",
110
111
  "tailwindcss": "^4.3.1",
111
112
  "typescript": "^5",
@@ -1,11 +0,0 @@
1
- import { bannedSourceRootMatcher, createSrcImportRule } from "./src-import-boundary.js";
2
-
3
- /** @type {import('eslint').Rule.RuleModule} */
4
- export const noDesignSystemSrcImport = createSrcImportRule({
5
- description:
6
- "Disallow deep imports from @nadicodeai/design-system source paths in apps and UI consumers",
7
- bannedMessage: "Import @nadicodeai/design-system through published exports only, not {{value}}.",
8
- // The package dir is `design-system/`, so relative paths carry the shorter
9
- // `design-system/src` marker rather than the scoped specifier.
10
- isBanned: bannedSourceRootMatcher("design-system/src"),
11
- });
@@ -1,109 +0,0 @@
1
- import {
2
- classUtilities,
3
- isPackageOwnedPrimitive,
4
- staticStringFragments,
5
- } from "./jsx-class-utility.js";
6
-
7
- const COLOR_NAMES = new Set([
8
- "black",
9
- "white",
10
- "slate",
11
- "gray",
12
- "zinc",
13
- "neutral",
14
- "stone",
15
- "red",
16
- "orange",
17
- "amber",
18
- "yellow",
19
- "lime",
20
- "green",
21
- "emerald",
22
- "teal",
23
- "cyan",
24
- "sky",
25
- "blue",
26
- "indigo",
27
- "violet",
28
- "purple",
29
- "fuchsia",
30
- "pink",
31
- "rose",
32
- "nc",
33
- ]);
34
- const COLOR_UTILITY =
35
- /^(?:bg|text|border|outline|ring|fill|stroke|decoration|accent|caret|divide|from|via|to|shadow)-(\[.+\]|[^/]+)(?:\/.*)?$/;
36
- const COLOR_VALUE_PROPERTIES = new Set([
37
- "accentColor",
38
- "background",
39
- "backgroundColor",
40
- "borderColor",
41
- "caretColor",
42
- "color",
43
- "fill",
44
- "outlineColor",
45
- "stopColor",
46
- "stroke",
47
- "textDecorationColor",
48
- ]);
49
-
50
- function withoutVariants(utility) {
51
- return utility.slice(utility.lastIndexOf(":") + 1);
52
- }
53
-
54
- function isRawColorUtility(utility) {
55
- const match = COLOR_UTILITY.exec(withoutVariants(utility));
56
- if (!match) {
57
- return false;
58
- }
59
- const color = match[1];
60
- if (color.startsWith("[")) {
61
- return (
62
- /var\(--nc-/i.test(color) ||
63
- /^\[(?:#|(?:rgba?|hsla?|oklch|oklab|hwb|color-mix)\(|(?:red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose|black|white)\])/i.test(
64
- color,
65
- )
66
- );
67
- }
68
- return COLOR_NAMES.has(color.split("-")[0]);
69
- }
70
-
71
- function propertyName(node) {
72
- if (!node || node.computed) return undefined;
73
- if (node.key.type === "Identifier") return node.key.name;
74
- if (node.key.type === "Literal" && typeof node.key.value === "string") return node.key.value;
75
- return undefined;
76
- }
77
-
78
- export const noRawColorUtility = {
79
- meta: {
80
- type: "problem",
81
- docs: {
82
- description:
83
- "Disallow raw Tailwind colors and canonical color values in app source; use semantic design tokens",
84
- },
85
- schema: [],
86
- messages: {
87
- rawColorUtility: "Use a semantic color role instead of raw color value {{utility}}.",
88
- },
89
- },
90
- create(context) {
91
- if (isPackageOwnedPrimitive(context.filename)) return {};
92
-
93
- return {
94
- JSXAttribute(node) {
95
- for (const utility of classUtilities(node, context)) {
96
- if (!isRawColorUtility(utility)) continue;
97
- context.report({ node, messageId: "rawColorUtility", data: { utility } });
98
- }
99
- },
100
- Property(node) {
101
- if (!COLOR_VALUE_PROPERTIES.has(propertyName(node))) return;
102
- for (const value of staticStringFragments(node.value, context)) {
103
- if (!/var\(--nc-/i.test(value)) continue;
104
- context.report({ node, messageId: "rawColorUtility", data: { utility: value } });
105
- }
106
- },
107
- };
108
- },
109
- };
@@ -1,30 +0,0 @@
1
- import { classUtilities } from "./jsx-class-utility.js";
2
-
3
- function isRawFocusRingWidth(utility) {
4
- const base = utility.slice(utility.lastIndexOf(":") + 1);
5
- return utility.includes("focus") && /^ring-(?:[1-9]\d*|px)$/.test(base);
6
- }
7
-
8
- export const noRawFocusRingWidth = {
9
- meta: {
10
- type: "problem",
11
- docs: {
12
- description: "Require the design-system focus-ring width on every focus surface",
13
- },
14
- schema: [],
15
- messages: {
16
- rawFocusRingWidth:
17
- "Use ring-[length:var(--ring-width-focus)] instead of raw focus-ring width {{utility}}.",
18
- },
19
- },
20
- create(context) {
21
- return {
22
- JSXAttribute(node) {
23
- for (const utility of classUtilities(node, context)) {
24
- if (!isRawFocusRingWidth(utility)) continue;
25
- context.report({ node, messageId: "rawFocusRingWidth", data: { utility } });
26
- }
27
- },
28
- };
29
- },
30
- };
@@ -1,41 +0,0 @@
1
- import { createSrcImportRule } from "./src-import-boundary.js";
2
-
3
- const BANNED_PATTERNS = [
4
- "@nadicodeai/design-system/assets/logo-mark",
5
- "@nadicodeai/design-system/assets/logo-wordmark",
6
- "@nadicodeai/design-system/assets/logo-geometry",
7
- "logo-mark.svg",
8
- "logo-wordmark.svg",
9
- ];
10
-
11
- // Only the single brand adapter in @nadicodeai/ui may import the raw logo
12
- // assets. A bare "/components/brand.tsx" suffix would also whitelist a future
13
- // website/portal `components/brand.tsx`, letting an app bypass BrandMark —
14
- // pin the full package-relative path instead.
15
- const ALLOWED_SUFFIXES = ["@nadicodeai/ui/src/components/brand.tsx"];
16
-
17
- function isAllowedFile(filename) {
18
- const normalized = filename.replaceAll("\\", "/");
19
- return ALLOWED_SUFFIXES.some((suffix) => normalized.endsWith(suffix));
20
- }
21
-
22
- function matchesBanned(value) {
23
- return typeof value === "string" && BANNED_PATTERNS.some((pattern) => value.includes(pattern));
24
- }
25
-
26
- const rawLogoImportRule = createSrcImportRule({
27
- description: "Disallow direct logo asset imports outside the BrandMark/BrandWordmark adapter",
28
- bannedMessage:
29
- "Import logo assets only through BrandMark/BrandWordmark from @nadicodeai/ui/components/brand (found {{value}}).",
30
- isBanned: matchesBanned,
31
- });
32
-
33
- export const noRawLogoImport = {
34
- ...rawLogoImportRule,
35
- create(context) {
36
- if (isAllowedFile(context.filename)) {
37
- return {};
38
- }
39
- return rawLogoImportRule.create(context);
40
- },
41
- };
@@ -1,10 +0,0 @@
1
- import { bannedSourceRootMatcher, createSrcImportRule } from "./src-import-boundary.js";
2
-
3
- /** @type {import('eslint').Rule.RuleModule} */
4
- export const noUiSrcImport = createSrcImportRule({
5
- description: "Disallow deep imports from @nadicodeai/ui/src/* in consumer apps",
6
- bannedMessage: "Import @nadicodeai/ui through package exports only, not {{value}}.",
7
- // The package sits at a repo-root dir literally named `@nadicodeai/ui/`, so
8
- // relative paths carry the full `@nadicodeai/ui/src` marker too.
9
- isBanned: bannedSourceRootMatcher("@nadicodeai/ui/src"),
10
- });
@@ -1,207 +0,0 @@
1
- /**
2
- * Shared machinery for the source-import boundary rules
3
- * (`no-ui-src-import`, `no-design-system-src-import`). Both resolve a module
4
- * specifier — static string, template/concatenation, const-propagated
5
- * identifier, TS type assertion — and report when a banned package source
6
- * path appears in it, across static imports, dynamic `import()`,
7
- * `require()`/`module.require()`, and TypeScript `import type`/`import =`.
8
- * Factoring it here keeps the two rules from drifting apart.
9
- */
10
-
11
- /**
12
- * Match a banned source root anywhere in the specifier, at a path boundary:
13
- * the root followed by `/` (a deep import) or at the end of the string (the
14
- * root itself). Substring-anywhere so relative paths (`../../@scope/pkg/src/x`),
15
- * node_modules paths, and loader-prefixed specifiers (`!!raw-loader!…/src/x`)
16
- * are all caught.
17
- * @param {string} root
18
- * @returns {(value: string) => boolean}
19
- */
20
- export function bannedSourceRootMatcher(root) {
21
- return (value) => {
22
- const index = value.indexOf(root);
23
- if (index === -1) {
24
- return false;
25
- }
26
- const nextChar = value[index + root.length];
27
- return nextChar === undefined || nextChar === "/";
28
- };
29
- }
30
-
31
- /**
32
- * @param {object} options
33
- * @param {string} options.description
34
- * @param {string} options.bannedMessage
35
- * @param {(value: string) => boolean} options.isBanned
36
- * @returns {import('eslint').Rule.RuleModule}
37
- */
38
- export function createSrcImportRule({ description, bannedMessage, isBanned }) {
39
- return {
40
- meta: {
41
- type: "problem",
42
- docs: { description },
43
- messages: { banned: bannedMessage },
44
- schema: [],
45
- },
46
- create(context) {
47
- const sourceCode = context.sourceCode;
48
-
49
- function findVariable(node, name) {
50
- for (let scope = sourceCode.getScope(node); scope; scope = scope.upper) {
51
- const variable = scope.set.get(name);
52
- if (variable) {
53
- return variable;
54
- }
55
- }
56
- return undefined;
57
- }
58
-
59
- function isUnshadowed(node, name) {
60
- const variable = findVariable(node, name);
61
- return !variable || variable.defs.length === 0;
62
- }
63
-
64
- // `const require = createRequire(import.meta.url)` is the only real
65
- // require in this all-ESM repo, so it must not be treated as a shadow.
66
- function isCreateRequireInit(init) {
67
- if (init?.type !== "CallExpression") {
68
- return false;
69
- }
70
- const callee = init.callee;
71
- if (callee.type === "Identifier") {
72
- return callee.name === "createRequire";
73
- }
74
- return (
75
- callee.type === "MemberExpression" &&
76
- !callee.computed &&
77
- callee.property.type === "Identifier" &&
78
- callee.property.name === "createRequire"
79
- );
80
- }
81
-
82
- function isRequire(node, name) {
83
- const variable = findVariable(node, name);
84
- if (!variable || variable.defs.length === 0) {
85
- return true;
86
- }
87
- if (variable.defs.length === 1) {
88
- const definition = variable.defs[0];
89
- if (
90
- definition.type === "Variable" &&
91
- definition.parent?.kind === "const" &&
92
- definition.node.id?.type === "Identifier" &&
93
- isCreateRequireInit(definition.node.init)
94
- ) {
95
- return true;
96
- }
97
- }
98
- return false;
99
- }
100
-
101
- function staticSpecifier(node, seenVariables = new Set()) {
102
- if (node?.type === "Literal" && typeof node.value === "string") {
103
- return node.value;
104
- }
105
- if (node?.type === "TemplateLiteral") {
106
- let value = node.quasis[0]?.value.cooked ?? "";
107
- for (let index = 0; index < node.expressions.length; index += 1) {
108
- const expressionValue = staticSpecifier(node.expressions[index], seenVariables);
109
- const followingText = node.quasis[index + 1]?.value.cooked;
110
- if (expressionValue === undefined || followingText === undefined) {
111
- return undefined;
112
- }
113
- value += expressionValue + followingText;
114
- }
115
- return value;
116
- }
117
- if (node?.type === "BinaryExpression" && node.operator === "+") {
118
- const left = staticSpecifier(node.left, seenVariables);
119
- const right = staticSpecifier(node.right, seenVariables);
120
- return left === undefined || right === undefined ? undefined : left + right;
121
- }
122
- if (node?.type === "Identifier") {
123
- const variable = findVariable(node, node.name);
124
- const definition = variable?.defs.length === 1 ? variable.defs[0] : undefined;
125
- if (
126
- !variable ||
127
- seenVariables.has(variable) ||
128
- definition?.type !== "Variable" ||
129
- definition.parent?.kind !== "const" ||
130
- definition.node.id?.type !== "Identifier" ||
131
- !definition.node.init
132
- ) {
133
- return undefined;
134
- }
135
-
136
- const nextSeenVariables = new Set(seenVariables);
137
- nextSeenVariables.add(variable);
138
- return staticSpecifier(definition.node.init, nextSeenVariables);
139
- }
140
- if (
141
- node?.type === "TSAsExpression" ||
142
- node?.type === "TSSatisfiesExpression" ||
143
- node?.type === "TSNonNullExpression"
144
- ) {
145
- return staticSpecifier(node.expression, seenVariables);
146
- }
147
- return undefined;
148
- }
149
-
150
- function checkValue(node, value) {
151
- if (typeof value === "string" && isBanned(value)) {
152
- context.report({
153
- node,
154
- messageId: "banned",
155
- data: { value },
156
- });
157
- }
158
- }
159
-
160
- function check(node) {
161
- checkValue(node, staticSpecifier(node.source));
162
- }
163
-
164
- function memberPropertyName(node) {
165
- if (!node.computed && node.property.type === "Identifier") {
166
- return node.property.name;
167
- }
168
- return staticSpecifier(node.property);
169
- }
170
-
171
- function checkRequire(node) {
172
- const isBareRequire =
173
- node.callee.type === "Identifier" &&
174
- node.callee.name === "require" &&
175
- isRequire(node.callee, "require");
176
- const isModuleRequire =
177
- node.callee.type === "MemberExpression" &&
178
- node.callee.object.type === "Identifier" &&
179
- node.callee.object.name === "module" &&
180
- isUnshadowed(node.callee.object, "module") &&
181
- memberPropertyName(node.callee) === "require";
182
-
183
- if (isBareRequire || isModuleRequire) {
184
- checkValue(node, staticSpecifier(node.arguments[0]));
185
- }
186
- }
187
-
188
- function checkTypeScriptImportEquals(node) {
189
- if (node.moduleReference.type === "TSExternalModuleReference") {
190
- checkValue(node, staticSpecifier(node.moduleReference.expression));
191
- }
192
- }
193
-
194
- return {
195
- ImportDeclaration: check,
196
- ImportExpression: check,
197
- CallExpression: checkRequire,
198
- // `export { X } from "…/src/…"` and `export * from …` are consumer deep
199
- // imports too; a source-less `export {}` has no node.source.
200
- ExportNamedDeclaration: check,
201
- ExportAllDeclaration: check,
202
- TSImportType: check,
203
- TSImportEqualsDeclaration: checkTypeScriptImportEquals,
204
- };
205
- },
206
- };
207
- }