@geonosis/oxlint-plugin-biological-architecture 3.0.0 → 3.2.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 +50 -0
- package/README.md +48 -5
- package/RULES.md +201 -98
- package/corpus/.oxlintrc.json +6 -0
- package/corpus/data/bad-dynamic-orm.ts +5 -0
- package/corpus/data/bad-type-only-orm.ts +3 -0
- package/corpus/e2e/bad-list-response.spec.ts +5 -0
- package/corpus/e2e/bad-timeout.spec.ts +5 -0
- package/corpus/e2e/good-detail-response.spec.ts +5 -0
- package/corpus/e2e/good-state.spec.ts +5 -0
- package/corpus/icon-controls/bad-unnamed-icon-button.tsx +8 -0
- package/corpus/icon-controls/good-named-icon-button.tsx +19 -0
- package/corpus/manifest.json +3 -0
- package/corpus/tissues/bad-awaits-data.tsx +8 -0
- package/corpus/tissues/bad-fetches-data.tsx +7 -0
- package/corpus/tissues/good-takes-products.tsx +5 -0
- package/dist/discover-atoms.d.ts +2 -37
- package/dist/discover-atoms.js +1 -104
- package/dist/index.d.ts +3 -12
- package/dist/index.js +19 -174
- package/dist/presets.d.ts +11 -19
- package/dist/presets.js +89 -3
- package/dist/registry.d.ts +2 -0
- package/dist/registry.js +172 -0
- package/dist/rules/atom-no-deps.d.ts +1 -0
- package/dist/rules/atom-no-deps.js +10 -11
- package/dist/rules/boundary-time-is-primitive.d.ts +0 -7
- package/dist/rules/cell-must-be-stateful.d.ts +2 -2
- package/dist/rules/cell-must-be-stateful.js +24 -23
- package/dist/rules/cell-must-not-compose-cell.d.ts +1 -0
- package/dist/rules/cell-must-not-compose-cell.js +10 -3
- package/dist/rules/cell-no-cross-feature-organelles.d.ts +1 -0
- package/dist/rules/cell-no-cross-feature-organelles.js +7 -0
- package/dist/rules/cell-no-tissues.d.ts +1 -0
- package/dist/rules/cell-no-tissues.js +11 -7
- package/dist/rules/cells-folder-index-is-barrel.d.ts +12 -10
- package/dist/rules/cells-folder-index-is-barrel.js +66 -34
- package/dist/rules/compound-must-be-stateless.d.ts +2 -0
- package/dist/rules/compound-must-be-stateless.js +24 -26
- package/dist/rules/compound-no-stores.d.ts +1 -0
- package/dist/rules/compound-no-stores.js +12 -10
- package/dist/rules/constants-in-constants-file.d.ts +2 -8
- package/dist/rules/constants-in-constants-file.js +5 -6
- package/dist/rules/dialect-through-the-seam.d.ts +0 -13
- package/dist/rules/durable-body-reads-through-steps.d.ts +0 -14
- package/dist/rules/durable-body-reads-through-steps.js +8 -3
- package/dist/rules/effect-hook-naming.d.ts +9 -11
- package/dist/rules/effect-hook-naming.js +33 -31
- package/dist/rules/emit-declares-attempts.d.ts +0 -17
- package/dist/rules/emit-declares-attempts.js +5 -10
- package/dist/rules/font-roles-only.d.ts +0 -18
- package/dist/rules/font-roles-only.js +19 -22
- package/dist/rules/hermetic-e2e-no-wall-clock-waits.d.ts +53 -0
- package/dist/rules/hermetic-e2e-no-wall-clock-waits.js +100 -0
- package/dist/rules/icon-control-has-name.d.ts +53 -0
- package/dist/rules/icon-control-has-name.js +71 -0
- package/dist/rules/layer-walls.d.ts +0 -25
- package/dist/rules/layer-walls.js +7 -13
- package/dist/rules/lib/atom-map.d.ts +24 -0
- package/dist/rules/lib/atom-map.js +16 -0
- package/dist/rules/lib/cells-barrel.d.ts +0 -1
- package/dist/rules/lib/colors.d.ts +0 -19
- package/dist/rules/lib/colors.js +10 -243
- package/dist/rules/lib/comments.d.ts +19 -0
- package/dist/rules/lib/comments.js +5 -0
- package/dist/rules/lib/context.d.ts +0 -10
- package/dist/rules/lib/direction-rule.d.ts +3 -21
- package/dist/rules/lib/direction-rule.js +12 -3
- package/dist/rules/lib/doors.d.ts +2 -18
- package/dist/rules/lib/doors.js +79 -41
- package/dist/rules/lib/hooks.d.ts +2 -17
- package/dist/rules/lib/hooks.js +14 -9
- package/dist/rules/lib/imports.d.ts +2 -23
- package/dist/rules/lib/imports.js +7 -2
- package/dist/rules/lib/jsx.d.ts +31 -0
- package/dist/rules/lib/jsx.js +11 -0
- package/dist/rules/lib/landing.d.ts +0 -40
- package/dist/rules/lib/literal-call.d.ts +1 -0
- package/dist/rules/lib/literal-call.js +2 -0
- package/dist/rules/lib/module-text.d.ts +3 -27
- package/dist/rules/lib/module-text.js +19 -4
- package/dist/rules/lib/mutations.d.ts +0 -14
- package/dist/rules/lib/nodes.d.ts +1 -18
- package/dist/rules/lib/nodes.js +1 -0
- package/dist/rules/lib/objects.d.ts +2 -11
- package/dist/rules/lib/objects.js +21 -0
- package/dist/rules/lib/options.d.ts +2 -52
- package/dist/rules/lib/options.js +44 -18
- package/dist/rules/lib/package-imports.d.ts +0 -5
- package/dist/rules/lib/package-imports.js +4 -10
- package/dist/rules/lib/paths.d.ts +15 -41
- package/dist/rules/lib/paths.js +34 -1
- package/dist/rules/lib/pattern-match.d.ts +2 -12
- package/dist/rules/lib/pattern-match.js +5 -1
- package/dist/rules/lib/probe.d.ts +0 -43
- package/dist/rules/lib/reexports.d.ts +0 -18
- package/dist/rules/lib/render-tracking.d.ts +0 -8
- package/dist/rules/lib/shared-features.d.ts +0 -8
- package/dist/rules/lib/shared-features.js +2 -9
- package/dist/rules/lib/state-sources.d.ts +8 -0
- package/dist/rules/lib/state-sources.js +55 -0
- package/dist/rules/lib/steps.d.ts +3 -5
- package/dist/rules/lib/steps.js +6 -1
- package/dist/rules/lib/styling.d.ts +9 -42
- package/dist/rules/lib/styling.js +36 -10
- package/dist/rules/lib/tiers.d.ts +11 -24
- package/dist/rules/lib/tiers.js +41 -1
- package/dist/rules/lib/tissue-entrypoint.d.ts +0 -1
- package/dist/rules/lib/tissue-entrypoint.js +4 -5
- package/dist/rules/lib/tsconfig-paths.d.ts +0 -4
- package/dist/rules/lib/tsconfig-paths.js +47 -15
- package/dist/rules/lib/type-members.d.ts +6 -0
- package/dist/rules/lib/type-members.js +165 -0
- package/dist/rules/lib/visitors.d.ts +0 -22
- package/dist/rules/lib/workspace-members.d.ts +2 -0
- package/dist/rules/lib/workspace-members.js +115 -0
- package/dist/rules/list-take-without-order.js +2 -8
- package/dist/rules/max-comment-density.d.ts +3 -18
- package/dist/rules/max-comment-density.js +3 -3
- package/dist/rules/molecule-atoms-only.d.ts +1 -0
- package/dist/rules/molecule-atoms-only.js +11 -7
- package/dist/rules/molecule-must-compose.d.ts +3 -1
- package/dist/rules/molecule-must-compose.js +17 -21
- package/dist/rules/mutating-step-declares-retry.d.ts +2 -7
- package/dist/rules/mutating-step-declares-retry.js +29 -11
- package/dist/rules/named-when-block.d.ts +0 -2
- package/dist/rules/named-when-block.js +2 -8
- package/dist/rules/next-route-segment-is-thin-delegate.d.ts +4 -19
- package/dist/rules/next-route-segment-is-thin-delegate.js +47 -71
- package/dist/rules/no-brand-names.d.ts +0 -9
- package/dist/rules/no-brand-names.js +1 -1
- package/dist/rules/no-card-shaped-div.d.ts +4 -42
- package/dist/rules/no-card-shaped-div.js +12 -4
- package/dist/rules/no-cross-feature-stores.d.ts +1 -0
- package/dist/rules/no-cross-feature-stores.js +9 -5
- package/dist/rules/no-d1-transaction.d.ts +2 -5
- package/dist/rules/no-d1-transaction.js +7 -0
- package/dist/rules/no-date-string-compare.d.ts +2 -0
- package/dist/rules/no-date-string-compare.js +14 -8
- package/dist/rules/no-duplicate-jsx-patterns.d.ts +2 -0
- package/dist/rules/no-duplicate-jsx-patterns.js +16 -1
- package/dist/rules/no-generic-utility-package.d.ts +48 -2
- package/dist/rules/no-generic-utility-package.js +48 -9
- package/dist/rules/no-hook-in-component-disguise.d.ts +27 -13
- package/dist/rules/no-hook-in-component-disguise.js +38 -30
- package/dist/rules/no-index-count-as-exact.d.ts +0 -3
- package/dist/rules/no-inert-hidden-jsx.d.ts +4 -21
- package/dist/rules/no-inert-hidden-jsx.js +13 -12
- package/dist/rules/no-inline-data-in-jsx.d.ts +2 -0
- package/dist/rules/no-inline-data-in-jsx.js +17 -2
- package/dist/rules/no-invalid-feature-folders.d.ts +2 -0
- package/dist/rules/no-invalid-feature-folders.js +12 -4
- package/dist/rules/no-loader-side-effect-in-index-file.d.ts +0 -7
- package/dist/rules/no-logic-in-component-files.d.ts +6 -5
- package/dist/rules/no-logic-in-component-files.js +52 -31
- package/dist/rules/no-mock-db-in-integration.d.ts +0 -15
- package/dist/rules/no-mock-db-in-integration.js +3 -4
- package/dist/rules/no-orm-outside-db.d.ts +1 -0
- package/dist/rules/no-orm-outside-db.js +9 -7
- package/dist/rules/no-raw-html-atoms.d.ts +3 -22
- package/dist/rules/no-raw-html-atoms.js +5 -17
- package/dist/rules/no-raw-sql-outside-allowed.d.ts +2 -0
- package/dist/rules/no-raw-sql-outside-allowed.js +10 -15
- package/dist/rules/no-react-namespace.d.ts +2 -0
- package/dist/rules/no-react-namespace.js +13 -0
- package/dist/rules/no-renamed-html-props.d.ts +2 -0
- package/dist/rules/no-renamed-html-props.js +11 -2
- package/dist/rules/no-render-prop-reader.d.ts +4 -20
- package/dist/rules/no-render-prop-reader.js +13 -5
- package/dist/rules/no-runtime-dead-affordance.d.ts +3 -26
- package/dist/rules/no-runtime-dead-affordance.js +7 -20
- package/dist/rules/no-swallowed-catch.js +2 -8
- package/dist/rules/no-trivial-wrapper-component.d.ts +4 -19
- package/dist/rules/no-trivial-wrapper-component.js +24 -33
- package/dist/rules/no-ts-in-bio-folders.d.ts +2 -13
- package/dist/rules/no-ts-in-bio-folders.js +9 -7
- package/dist/rules/no-type-definitions-in-components.d.ts +2 -0
- package/dist/rules/no-type-definitions-in-components.js +12 -1
- package/dist/rules/no-unregistered-plugin-dir.d.ts +0 -41
- package/dist/rules/no-unregistered-plugin-dir.js +1 -9
- package/dist/rules/no-void-port.d.ts +2 -4
- package/dist/rules/no-void-port.js +7 -0
- package/dist/rules/organelle-dependency.d.ts +1 -0
- package/dist/rules/organelle-dependency.js +10 -8
- package/dist/rules/organelle-single-source.d.ts +2 -0
- package/dist/rules/organelle-single-source.js +58 -9
- package/dist/rules/plugin-route-namespaced.d.ts +0 -11
- package/dist/rules/plugin-route-namespaced.js +2 -2
- package/dist/rules/queries-require-org-scope.d.ts +0 -3
- package/dist/rules/queries-require-org-scope.js +3 -10
- package/dist/rules/queue-loop-is-the-library.js +3 -2
- package/dist/rules/route-no-inline-mutation.d.ts +1 -25
- package/dist/rules/route-no-inline-mutation.js +2 -7
- package/dist/rules/router-schema-parity.d.ts +0 -9
- package/dist/rules/router-schema-parity.js +5 -9
- package/dist/rules/service-name-not-reserved.d.ts +0 -3
- package/dist/rules/service-name-not-reserved.js +1 -34
- package/dist/rules/ssot-no-inline-facts.js +2 -5
- package/dist/rules/ssot-no-process-env.js +4 -12
- package/dist/rules/step-declares-compensation-or-none.d.ts +2 -1
- package/dist/rules/step-declares-compensation-or-none.js +17 -1
- package/dist/rules/step-opens-its-own-cell.d.ts +2 -25
- package/dist/rules/step-opens-its-own-cell.js +8 -13
- package/dist/rules/store-route-scopes-tenant-data.js +8 -26
- package/dist/rules/subpath-over-barrel.d.ts +2 -10
- package/dist/rules/subpath-over-barrel.js +48 -9
- package/dist/rules/subscriber-declares-id.d.ts +0 -2
- package/dist/rules/subscriber-declares-id.js +2 -8
- package/dist/rules/tables-declare-their-plane.d.ts +0 -2
- package/dist/rules/tables-declare-their-plane.js +4 -10
- package/dist/rules/tenant-tables-carry-org-id.d.ts +1 -4
- package/dist/rules/tenant-tables-carry-org-id.js +5 -12
- package/dist/rules/test-no-clock-polling-for-promise-flips.d.ts +2 -0
- package/dist/rules/test-no-clock-polling-for-promise-flips.js +18 -1
- package/dist/rules/time-through-the-door.d.ts +0 -24
- package/dist/rules/time-through-the-door.js +5 -5
- package/dist/rules/tissue-must-compose.d.ts +4 -2
- package/dist/rules/tissue-must-compose.js +25 -20
- package/dist/rules/tissue-no-data-props.d.ts +56 -0
- package/dist/rules/tissue-no-data-props.js +114 -32
- package/dist/rules/tissue-no-fetch.d.ts +26 -0
- package/dist/rules/tissue-no-fetch.js +57 -0
- package/dist/rules/tissue-no-hooks.d.ts +20 -22
- package/dist/rules/tissue-no-hooks.js +22 -4
- package/dist/rules/tissue-no-organelles.d.ts +1 -0
- package/dist/rules/tissue-no-organelles.js +9 -1
- package/dist/rules/tissue-no-stores.d.ts +1 -0
- package/dist/rules/tissue-no-stores.js +9 -1
- package/dist/rules/todo-names-its-plan.d.ts +1 -28
- package/dist/rules/todo-names-its-plan.js +2 -2
- package/dist/rules/tokens-only-colors.d.ts +2 -37
- package/dist/rules/tokens-only-colors.js +33 -18
- package/dist/rules/unique-query-step-name.d.ts +0 -7
- package/dist/rules/unique-query-step-name.js +6 -10
- package/dist/rules/worker-handles-are-scoped.d.ts +11 -8
- package/dist/rules/worker-handles-are-scoped.js +12 -5
- package/dist/rules/zustand-v5-best-practices.d.ts +8 -18
- package/dist/rules/zustand-v5-best-practices.js +32 -56
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/rules/no-mock-db-in-integration.ts
|
|
2
2
|
import { requireOption } from "./lib/options.js";
|
|
3
|
-
import { normalise } from "./lib/paths.js";
|
|
3
|
+
import { normalise, trimSlashes } from "./lib/paths.js";
|
|
4
4
|
import { bagOf } from "./lib/probe.js";
|
|
5
5
|
import { optionsBag, STRINGS } from "./lib/schema.js";
|
|
6
6
|
var RULE = "no-mock-db-in-integration";
|
|
@@ -16,8 +16,7 @@ var calleeOf = (node) => {
|
|
|
16
16
|
};
|
|
17
17
|
var namesModule = (specifier, module) => specifier === module || specifier.startsWith(`${module}/`) || specifier.endsWith(`/${module.replace(/^\.{1,2}\//, "")}`);
|
|
18
18
|
var inDirectory = (filename, directory) => {
|
|
19
|
-
|
|
20
|
-
return filename.includes(`/${trimmed}/`);
|
|
19
|
+
return filename.includes(`/${trimSlashes(directory)}/`);
|
|
21
20
|
};
|
|
22
21
|
var noMockDbInIntegration = {
|
|
23
22
|
create(context) {
|
|
@@ -89,7 +88,7 @@ mock call can be seen in: a handle built in a setup file and threaded through a
|
|
|
89
88
|
},
|
|
90
89
|
probe(options) {
|
|
91
90
|
const { dbModules = [], integrationDirs = [] } = bagOf(options);
|
|
92
|
-
const directory = (integrationDirs[0] ?? "")
|
|
91
|
+
const directory = trimSlashes(integrationDirs[0] ?? "");
|
|
93
92
|
return {
|
|
94
93
|
path: `${directory}/geonosis-probe/tests.ts`,
|
|
95
94
|
source: `import { mock } from 'bun:test'
|
|
@@ -9,6 +9,7 @@ declare const noOrmOutsideDb: {
|
|
|
9
9
|
}) => void;
|
|
10
10
|
}): import('./lib/visitors.js').Visitor;
|
|
11
11
|
fixShape: string;
|
|
12
|
+
probe?: ((options: readonly unknown[]) => import('./lib/probe.js').Probe | import('./lib/probe.js').ProbeTree) | undefined;
|
|
12
13
|
meta: {
|
|
13
14
|
docs: {
|
|
14
15
|
description: string;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { directionRule } from "./lib/direction-rule.js";
|
|
3
3
|
import { PATTERNS, patternsOf } from "./lib/options.js";
|
|
4
4
|
import { anyOf } from "./lib/paths.js";
|
|
5
|
+
import { optionsBag } from "./lib/schema.js";
|
|
5
6
|
var ormPackage = "drizzle-orm";
|
|
6
7
|
var DEFAULT_DATA_LAYER = ["/packages/db/"];
|
|
7
8
|
var isOrmModule = (source) => source === ormPackage || source.startsWith(`${ormPackage}/`);
|
|
@@ -21,13 +22,14 @@ below the seam, and a caller that names it has crossed it. Which paths are the d
|
|
|
21
22
|
const named = patternsOf(raw?.dataLayer);
|
|
22
23
|
return { dataLayer: named.length === 0 ? DEFAULT_DATA_LAYER : named };
|
|
23
24
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
probe: () => ({
|
|
26
|
+
path: "geonosis-probe-orm.ts",
|
|
27
|
+
source: `import { sql } from 'drizzle-orm'
|
|
28
|
+
|
|
29
|
+
export const geonosisProbe = sql
|
|
30
|
+
`
|
|
31
|
+
}),
|
|
32
|
+
schema: optionsBag({ dataLayer: PATTERNS }),
|
|
31
33
|
scope: () => true,
|
|
32
34
|
typeOnly: "visit"
|
|
33
35
|
});
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
+
import { type Restriction } from './lib/atom-map.js';
|
|
2
|
+
import { type JsxOpeningElement } from './lib/jsx.js';
|
|
1
3
|
import { type Probe } from './lib/probe.js';
|
|
2
|
-
interface JSXOpeningElement {
|
|
3
|
-
name: {
|
|
4
|
-
name?: string;
|
|
5
|
-
type: string;
|
|
6
|
-
};
|
|
7
|
-
type: 'JSXOpeningElement';
|
|
8
|
-
}
|
|
9
|
-
interface Restriction {
|
|
10
|
-
atom: string;
|
|
11
|
-
element: string;
|
|
12
|
-
importPath: string;
|
|
13
|
-
}
|
|
14
4
|
interface Scope {
|
|
15
|
-
/** Tier names. Unset means everywhere except the atom that wraps the element. */
|
|
16
5
|
scope?: string[];
|
|
17
6
|
}
|
|
18
7
|
declare const noRawHtmlAtoms: {
|
|
@@ -27,7 +16,7 @@ declare const noRawHtmlAtoms: {
|
|
|
27
16
|
}): {
|
|
28
17
|
JSXOpeningElement?: undefined;
|
|
29
18
|
} | {
|
|
30
|
-
JSXOpeningElement(node:
|
|
19
|
+
JSXOpeningElement(node: JsxOpeningElement): void;
|
|
31
20
|
};
|
|
32
21
|
fixShape: string;
|
|
33
22
|
meta: {
|
|
@@ -54,10 +43,7 @@ declare const noRawHtmlAtoms: {
|
|
|
54
43
|
type: 'object';
|
|
55
44
|
};
|
|
56
45
|
type: 'array';
|
|
57
|
-
additionalProperties?: undefined;
|
|
58
|
-
properties?: undefined;
|
|
59
46
|
} | {
|
|
60
|
-
items?: undefined;
|
|
61
47
|
additionalProperties: boolean;
|
|
62
48
|
properties: {
|
|
63
49
|
scope: {
|
|
@@ -72,11 +58,6 @@ declare const noRawHtmlAtoms: {
|
|
|
72
58
|
})[];
|
|
73
59
|
type: 'problem';
|
|
74
60
|
};
|
|
75
|
-
/**
|
|
76
|
-
* The element→atom map is POSITIONAL, so the probe reads `options[0]` rather than a bag. The path
|
|
77
|
-
* goes into the first tier the run is scoped to, which is never `atoms` — inside the atom the raw
|
|
78
|
-
* element is the point of the file and the rule is deliberately silent there.
|
|
79
|
-
*/
|
|
80
61
|
probe(options: readonly unknown[]): Probe;
|
|
81
62
|
};
|
|
82
63
|
export default noRawHtmlAtoms;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/rules/no-raw-html-atoms.ts
|
|
2
|
+
import { ATOM_MAP_SCHEMA, atomMapOf } from "./lib/atom-map.js";
|
|
3
|
+
import { tagNameOf } from "./lib/jsx.js";
|
|
2
4
|
import { requireOption } from "./lib/options.js";
|
|
3
|
-
import { STRING } from "./lib/schema.js";
|
|
4
5
|
import { inTier, requireTiers, TIERS } from "./lib/tiers.js";
|
|
5
6
|
var RULE = "no-raw-html-atoms";
|
|
6
7
|
var WHERE_RAW_HTML_IS_THE_POINT = "atoms";
|
|
@@ -18,9 +19,7 @@ var noRawHtmlAtoms = {
|
|
|
18
19
|
}
|
|
19
20
|
return {
|
|
20
21
|
JSXOpeningElement(node) {
|
|
21
|
-
|
|
22
|
-
return;
|
|
23
|
-
const elementName = node.name.name;
|
|
22
|
+
const elementName = tagNameOf(node);
|
|
24
23
|
if (!elementName)
|
|
25
24
|
return;
|
|
26
25
|
const restriction = elementMap.get(elementName);
|
|
@@ -52,18 +51,7 @@ with no map to check reads exactly like a tree with no raw elements in it.`,
|
|
|
52
51
|
forbidden: 'Use <{{atom}}> from "{{importPath}}" instead of raw <{{element}}>. Native HTML elements that have an atom wrapper must not be used directly above the atom tier - use the atom to preserve consistent styling and behavior.'
|
|
53
52
|
},
|
|
54
53
|
schema: [
|
|
55
|
-
|
|
56
|
-
items: {
|
|
57
|
-
properties: {
|
|
58
|
-
atom: STRING,
|
|
59
|
-
element: STRING,
|
|
60
|
-
importPath: STRING
|
|
61
|
-
},
|
|
62
|
-
required: ["element", "atom", "importPath"],
|
|
63
|
-
type: "object"
|
|
64
|
-
},
|
|
65
|
-
type: "array"
|
|
66
|
-
},
|
|
54
|
+
ATOM_MAP_SCHEMA,
|
|
67
55
|
{
|
|
68
56
|
additionalProperties: false,
|
|
69
57
|
properties: {
|
|
@@ -75,7 +63,7 @@ with no map to check reads exactly like a tree with no raw elements in it.`,
|
|
|
75
63
|
type: "problem"
|
|
76
64
|
},
|
|
77
65
|
probe(options) {
|
|
78
|
-
const map =
|
|
66
|
+
const map = atomMapOf(options);
|
|
79
67
|
const scope = options[1]?.scope;
|
|
80
68
|
const tier = scope?.[0] ?? "molecules";
|
|
81
69
|
return {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type RuleContextWithOptions } from './lib/context.js';
|
|
2
|
+
import type { Probe } from './lib/probe.js';
|
|
2
3
|
type Node = {
|
|
3
4
|
type: string;
|
|
4
5
|
name?: string;
|
|
@@ -57,5 +58,6 @@ declare const noRawSqlOutsideAllowed: {
|
|
|
57
58
|
}[];
|
|
58
59
|
type: 'problem';
|
|
59
60
|
};
|
|
61
|
+
probe(): Probe;
|
|
60
62
|
};
|
|
61
63
|
export default noRawSqlOutsideAllowed;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
// src/rules/no-raw-sql-outside-allowed.ts
|
|
2
2
|
import { PATTERNS, patternsOf } from "./lib/options.js";
|
|
3
|
-
import { anyOf, normalise } from "./lib/paths.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
String.raw`/scripts/`,
|
|
7
|
-
String.raw`/testing/`,
|
|
8
|
-
String.raw`/seeds/`,
|
|
9
|
-
String.raw`/migrations/`
|
|
10
|
-
];
|
|
3
|
+
import { anyOf, HARNESS_PATHS, normalise } from "./lib/paths.js";
|
|
4
|
+
import { optionsBag } from "./lib/schema.js";
|
|
5
|
+
var ALWAYS_ALLOWED = [...HARNESS_PATHS, String.raw`/migrations/`];
|
|
11
6
|
var statement = /^\s*(select|insert|update|delete|create|drop|alter|pragma)\b/i;
|
|
12
7
|
var isClientPrepare = (callee) => callee.type === "MemberExpression" && callee.property?.type === "Identifier" && callee.property.name === "prepare" && callee.object?.type === "MemberExpression" && callee.object.property?.type === "Identifier" && callee.object.property.name === "$client";
|
|
13
8
|
var noRawSqlOutsideAllowed = {
|
|
@@ -41,14 +36,14 @@ module. Migrations, seeds, scripts and tests are always allowed.`,
|
|
|
41
36
|
messages: {
|
|
42
37
|
rawSql: "Raw SQL statement outside the allowed files. Use the drizzle builders on the schema tables; keep sql`` for fragments (count(*), coalesce)."
|
|
43
38
|
},
|
|
44
|
-
schema:
|
|
45
|
-
{
|
|
46
|
-
additionalProperties: false,
|
|
47
|
-
properties: { allow: PATTERNS },
|
|
48
|
-
type: "object"
|
|
49
|
-
}
|
|
50
|
-
],
|
|
39
|
+
schema: optionsBag({ allow: PATTERNS }),
|
|
51
40
|
type: "problem"
|
|
41
|
+
},
|
|
42
|
+
probe() {
|
|
43
|
+
return {
|
|
44
|
+
path: "geonosis-probe-sql.ts",
|
|
45
|
+
source: "export const geonosisProbe = (db) => db.execute(sql`select 1`)\n"
|
|
46
|
+
};
|
|
52
47
|
}
|
|
53
48
|
};
|
|
54
49
|
var no_raw_sql_outside_allowed_default = noRawSqlOutsideAllowed;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type RuleContext } from './lib/context.js';
|
|
2
|
+
import { type Probe } from './lib/probe.js';
|
|
2
3
|
declare const noReactNamespace: {
|
|
3
4
|
create(context: RuleContext): {
|
|
4
5
|
MemberExpression(node: {
|
|
@@ -35,5 +36,6 @@ declare const noReactNamespace: {
|
|
|
35
36
|
schema: never[];
|
|
36
37
|
type: 'problem';
|
|
37
38
|
};
|
|
39
|
+
probe(): Probe;
|
|
38
40
|
};
|
|
39
41
|
export default noReactNamespace;
|
|
@@ -38,6 +38,19 @@ depends on.`,
|
|
|
38
38
|
},
|
|
39
39
|
schema: [],
|
|
40
40
|
type: "problem"
|
|
41
|
+
},
|
|
42
|
+
probe() {
|
|
43
|
+
return {
|
|
44
|
+
path: "src/cells/geonosis-probe.tsx",
|
|
45
|
+
source: `import * as React from 'react'
|
|
46
|
+
|
|
47
|
+
export function GeonosisProbe() {
|
|
48
|
+
const [open] = React.useState(false)
|
|
49
|
+
|
|
50
|
+
return open ? 'open' : 'closed'
|
|
51
|
+
}
|
|
52
|
+
`
|
|
53
|
+
};
|
|
41
54
|
}
|
|
42
55
|
};
|
|
43
56
|
var no_react_namespace_default = noReactNamespace;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type RuleContext } from './lib/context.js';
|
|
2
|
+
import { type Probe } from './lib/probe.js';
|
|
2
3
|
interface InterfaceBody {
|
|
3
4
|
body: PropertyNode[];
|
|
4
5
|
}
|
|
@@ -34,5 +35,6 @@ declare const noRenamedHtmlProps: {
|
|
|
34
35
|
schema: never[];
|
|
35
36
|
type: 'problem';
|
|
36
37
|
};
|
|
38
|
+
probe(): Probe;
|
|
37
39
|
};
|
|
38
40
|
export default noRenamedHtmlProps;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// src/rules/no-renamed-html-props.ts
|
|
2
2
|
import { normalise } from "./lib/paths.js";
|
|
3
|
+
import { ABOVE_ATOMS_FOLDER } from "./lib/tiers.js";
|
|
3
4
|
var forbiddenPropMap = {
|
|
4
5
|
ariaAtomic: "aria-atomic",
|
|
5
6
|
ariaBusy: "aria-busy",
|
|
@@ -23,11 +24,10 @@ var forbiddenPropMap = {
|
|
|
23
24
|
dataTestId: "data-testid",
|
|
24
25
|
testId: "data-testid"
|
|
25
26
|
};
|
|
26
|
-
var biologicalHierarchyPattern = /\/(molecules|compounds|organelles|cells|layouts)\//;
|
|
27
27
|
var noRenamedHtmlProps = {
|
|
28
28
|
create(context) {
|
|
29
29
|
const filename = normalise(context.filename);
|
|
30
|
-
if (!
|
|
30
|
+
if (!ABOVE_ATOMS_FOLDER.test(filename))
|
|
31
31
|
return {};
|
|
32
32
|
const checkProperty = (member) => {
|
|
33
33
|
if (member.type !== "TSPropertySignature" && member.type !== "PropertyDefinition")
|
|
@@ -72,6 +72,15 @@ the Radix primitive's props) and inherit them instead of re-declaring.`,
|
|
|
72
72
|
},
|
|
73
73
|
schema: [],
|
|
74
74
|
type: "problem"
|
|
75
|
+
},
|
|
76
|
+
probe() {
|
|
77
|
+
return {
|
|
78
|
+
path: "src/cells/geonosis-probe.tsx",
|
|
79
|
+
source: `export interface GeonosisProbeProps {
|
|
80
|
+
ariaLabel: string
|
|
81
|
+
}
|
|
82
|
+
`
|
|
83
|
+
};
|
|
75
84
|
}
|
|
76
85
|
};
|
|
77
86
|
var no_renamed_html_props_default = noRenamedHtmlProps;
|
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
import { type RuleContext } from './lib/context.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
name?: string;
|
|
5
|
-
type: string;
|
|
6
|
-
};
|
|
7
|
-
type: string;
|
|
8
|
-
value?: {
|
|
9
|
-
type: string;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
interface JSXOpeningElement {
|
|
13
|
-
attributes: JSXAttribute[];
|
|
14
|
-
loc?: unknown;
|
|
15
|
-
name: {
|
|
16
|
-
name?: string;
|
|
17
|
-
type: string;
|
|
18
|
-
};
|
|
19
|
-
type: 'JSXOpeningElement';
|
|
20
|
-
}
|
|
2
|
+
import { type JsxOpeningElement } from './lib/jsx.js';
|
|
3
|
+
import { type Probe } from './lib/probe.js';
|
|
21
4
|
declare const noRenderPropReader: {
|
|
22
5
|
create(context: RuleContext): {
|
|
23
|
-
JSXOpeningElement(node:
|
|
6
|
+
JSXOpeningElement(node: JsxOpeningElement): void;
|
|
24
7
|
TSPropertySignature(node: {
|
|
25
8
|
key?: {
|
|
26
9
|
name?: string;
|
|
@@ -63,5 +46,6 @@ declare const noRenderPropReader: {
|
|
|
63
46
|
schema: never[];
|
|
64
47
|
type: 'problem';
|
|
65
48
|
};
|
|
49
|
+
probe(): Probe;
|
|
66
50
|
};
|
|
67
51
|
export default noRenderPropReader;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
// src/rules/no-render-prop-reader.ts
|
|
2
|
+
import { attributeNamed, tagNameOf } from "./lib/jsx.js";
|
|
2
3
|
import { normalise } from "./lib/paths.js";
|
|
3
4
|
var noRenderPropReader = {
|
|
4
5
|
create(context) {
|
|
5
6
|
return {
|
|
6
7
|
JSXOpeningElement(node) {
|
|
7
|
-
|
|
8
|
-
return;
|
|
9
|
-
const componentName = node.name.name;
|
|
8
|
+
const componentName = tagNameOf(node);
|
|
10
9
|
if (!componentName)
|
|
11
10
|
return;
|
|
12
|
-
|
|
13
|
-
if (viewProp) {
|
|
11
|
+
if (attributeNamed(node, "View")?.value?.type === "JSXExpressionContainer") {
|
|
14
12
|
context.report({
|
|
15
13
|
data: { component: componentName },
|
|
16
14
|
messageId: "renderPropReader",
|
|
@@ -51,6 +49,16 @@ The state goes in an organelle that renders its own JSX; the arrangement goes in
|
|
|
51
49
|
},
|
|
52
50
|
schema: [],
|
|
53
51
|
type: "problem"
|
|
52
|
+
},
|
|
53
|
+
probe() {
|
|
54
|
+
return {
|
|
55
|
+
path: "src/organelles/geonosis-probe.tsx",
|
|
56
|
+
source: `declare const Reader: (props: { View: () => null }) => null
|
|
57
|
+
const View = () => null
|
|
58
|
+
|
|
59
|
+
export const GeonosisProbe = () => <Reader View={View} />
|
|
60
|
+
`
|
|
61
|
+
};
|
|
54
62
|
}
|
|
55
63
|
};
|
|
56
64
|
var no_render_prop_reader_default = noRenderPropReader;
|
|
@@ -1,28 +1,6 @@
|
|
|
1
|
+
import { type Restriction } from './lib/atom-map.js';
|
|
2
|
+
import { type JsxOpeningElement } from './lib/jsx.js';
|
|
1
3
|
import { type Probe } from './lib/probe.js';
|
|
2
|
-
interface Restriction {
|
|
3
|
-
atom: string;
|
|
4
|
-
element: string;
|
|
5
|
-
importPath: string;
|
|
6
|
-
}
|
|
7
|
-
interface JSXAttribute {
|
|
8
|
-
name?: {
|
|
9
|
-
name?: string;
|
|
10
|
-
type?: string;
|
|
11
|
-
};
|
|
12
|
-
type?: string;
|
|
13
|
-
value?: {
|
|
14
|
-
type?: string;
|
|
15
|
-
value?: unknown;
|
|
16
|
-
} | null;
|
|
17
|
-
}
|
|
18
|
-
interface JSXOpeningElement {
|
|
19
|
-
attributes?: JSXAttribute[];
|
|
20
|
-
name: {
|
|
21
|
-
name?: string;
|
|
22
|
-
type: string;
|
|
23
|
-
};
|
|
24
|
-
type: 'JSXOpeningElement';
|
|
25
|
-
}
|
|
26
4
|
declare const noRuntimeDeadAffordance: {
|
|
27
5
|
create(context: {
|
|
28
6
|
filename: string;
|
|
@@ -33,7 +11,7 @@ declare const noRuntimeDeadAffordance: {
|
|
|
33
11
|
node: unknown;
|
|
34
12
|
}) => void;
|
|
35
13
|
}): {
|
|
36
|
-
JSXOpeningElement(node:
|
|
14
|
+
JSXOpeningElement(node: JsxOpeningElement): void;
|
|
37
15
|
};
|
|
38
16
|
fixShape: string;
|
|
39
17
|
meta: {
|
|
@@ -63,7 +41,6 @@ declare const noRuntimeDeadAffordance: {
|
|
|
63
41
|
}[];
|
|
64
42
|
type: 'problem';
|
|
65
43
|
};
|
|
66
|
-
/** The map is POSITIONAL, so the probe reads `options[0]` rather than a bag. */
|
|
67
44
|
probe(options: readonly unknown[]): Probe;
|
|
68
45
|
};
|
|
69
46
|
export default noRuntimeDeadAffordance;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
// src/rules/no-runtime-dead-affordance.ts
|
|
2
|
+
import { ATOM_MAP_SCHEMA, atomMapOf } from "./lib/atom-map.js";
|
|
3
|
+
import { tagNameOf } from "./lib/jsx.js";
|
|
2
4
|
import { requireOption } from "./lib/options.js";
|
|
3
|
-
import { STRING } from "./lib/schema.js";
|
|
4
5
|
var RULE = "no-runtime-dead-affordance";
|
|
5
6
|
var HANDS_IT_ON = new Set(["asChild", "disabled", "form", "formAction"]);
|
|
6
7
|
var PRESSED_BY_THE_FORM = new Set(["submit", "reset"]);
|
|
8
|
+
var HANDLER = /^on[A-Z]/;
|
|
7
9
|
var nameOf = (attribute) => attribute.name?.type === "JSXIdentifier" ? attribute.name.name ?? "" : "";
|
|
8
10
|
var arms = (attribute) => {
|
|
9
11
|
if (attribute.type !== "JSXAttribute")
|
|
10
12
|
return true;
|
|
11
13
|
const name = nameOf(attribute);
|
|
12
|
-
if (
|
|
14
|
+
if (HANDLER.test(name))
|
|
13
15
|
return true;
|
|
14
16
|
if (HANDS_IT_ON.has(name))
|
|
15
17
|
return true;
|
|
@@ -25,9 +27,7 @@ var noRuntimeDeadAffordance = {
|
|
|
25
27
|
const controls = new Set(requireOption(RULE, context.options[0], "element→atom map").map((one) => one.atom));
|
|
26
28
|
return {
|
|
27
29
|
JSXOpeningElement(node) {
|
|
28
|
-
|
|
29
|
-
return;
|
|
30
|
-
const atom = node.name.name ?? "";
|
|
30
|
+
const atom = tagNameOf(node) ?? "";
|
|
31
31
|
if (!controls.has(atom))
|
|
32
32
|
return;
|
|
33
33
|
if ((node.attributes ?? []).some(arms))
|
|
@@ -51,24 +51,11 @@ the rule reports that once a run and judges nothing.`,
|
|
|
51
51
|
messages: {
|
|
52
52
|
dead: '<{{atom}}> has no onClick, no other handler, no asChild and no submit role, so pressing it does nothing. Give it a handler, hand the behaviour to a child with asChild, make it type="submit" inside its form, or mark it disabled if it is meant to be inert.'
|
|
53
53
|
},
|
|
54
|
-
schema: [
|
|
55
|
-
{
|
|
56
|
-
items: {
|
|
57
|
-
properties: {
|
|
58
|
-
atom: STRING,
|
|
59
|
-
element: STRING,
|
|
60
|
-
importPath: STRING
|
|
61
|
-
},
|
|
62
|
-
required: ["element", "atom", "importPath"],
|
|
63
|
-
type: "object"
|
|
64
|
-
},
|
|
65
|
-
type: "array"
|
|
66
|
-
}
|
|
67
|
-
],
|
|
54
|
+
schema: [ATOM_MAP_SCHEMA],
|
|
68
55
|
type: "problem"
|
|
69
56
|
},
|
|
70
57
|
probe(options) {
|
|
71
|
-
const map =
|
|
58
|
+
const map = atomMapOf(options);
|
|
72
59
|
const atom = map[0]?.atom;
|
|
73
60
|
if (atom === undefined) {
|
|
74
61
|
throw new Error("biological-architecture/no-runtime-dead-affordance has no element→atom map here, so there is no control for a probe to render — enabled without one the rule reports that once a run and judges nothing.");
|
|
@@ -3,7 +3,7 @@ import { propertyNameOf, walkNode } from "./lib/nodes.js";
|
|
|
3
3
|
import { requireOption } from "./lib/options.js";
|
|
4
4
|
import { normalise } from "./lib/paths.js";
|
|
5
5
|
import { bagOf, firstOf, pathMatching } from "./lib/probe.js";
|
|
6
|
-
import { STRINGS } from "./lib/schema.js";
|
|
6
|
+
import { optionsBag, STRINGS } from "./lib/schema.js";
|
|
7
7
|
var RULE = "no-swallowed-catch";
|
|
8
8
|
var ACCEPTS = "{ paths: string[] (regex sources over the filename: the fetch and refresh modules) }";
|
|
9
9
|
var CATCH = "catch";
|
|
@@ -69,13 +69,7 @@ otherwise read exactly like a tree with no swallowed rejection in it.`,
|
|
|
69
69
|
messages: {
|
|
70
70
|
swallowed: "This {{shape}} drops the rejection: it neither writes state nor rethrows, so a failed refresh is indistinguishable from a successful one. Set the error where the caller reads it, or rethrow."
|
|
71
71
|
},
|
|
72
|
-
schema:
|
|
73
|
-
{
|
|
74
|
-
additionalProperties: false,
|
|
75
|
-
properties: { paths: STRINGS },
|
|
76
|
-
type: "object"
|
|
77
|
-
}
|
|
78
|
-
],
|
|
72
|
+
schema: optionsBag({ paths: STRINGS }),
|
|
79
73
|
type: "problem"
|
|
80
74
|
},
|
|
81
75
|
probe(options) {
|
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
import { type RuleContext } from './lib/context.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
name?: string;
|
|
5
|
-
type: string;
|
|
6
|
-
};
|
|
7
|
-
local?: {
|
|
8
|
-
name?: string;
|
|
9
|
-
type: string;
|
|
10
|
-
};
|
|
11
|
-
type: string;
|
|
12
|
-
}
|
|
13
|
-
interface ImportNode {
|
|
14
|
-
source: {
|
|
15
|
-
value: string;
|
|
16
|
-
};
|
|
17
|
-
specifiers?: ImportSpecifier[];
|
|
18
|
-
type: string;
|
|
19
|
-
}
|
|
2
|
+
import { type ModuleNode } from './lib/imports.js';
|
|
3
|
+
import { type Probe } from './lib/probe.js';
|
|
20
4
|
interface FunctionDeclLike {
|
|
21
5
|
body?: {
|
|
22
6
|
body?: unknown[];
|
|
@@ -44,7 +28,7 @@ declare const noTrivialWrapperComponent: {
|
|
|
44
28
|
} | {
|
|
45
29
|
ExportDefaultDeclaration(node: ExportDefaultDeclNode): void;
|
|
46
30
|
ExportNamedDeclaration(node: ExportNamedDeclNode): void;
|
|
47
|
-
ImportDeclaration(node:
|
|
31
|
+
ImportDeclaration(node: ModuleNode): void;
|
|
48
32
|
};
|
|
49
33
|
fixShape: string;
|
|
50
34
|
meta: {
|
|
@@ -57,5 +41,6 @@ declare const noTrivialWrapperComponent: {
|
|
|
57
41
|
schema: never[];
|
|
58
42
|
type: 'problem';
|
|
59
43
|
};
|
|
44
|
+
probe(): Probe;
|
|
60
45
|
};
|
|
61
46
|
export default noTrivialWrapperComponent;
|
|
@@ -1,28 +1,9 @@
|
|
|
1
1
|
// src/rules/no-trivial-wrapper-component.ts
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"layout.tsx",
|
|
8
|
-
"loading.tsx",
|
|
9
|
-
"not-found.tsx",
|
|
10
|
-
"page.tsx",
|
|
11
|
-
"template.tsx"
|
|
12
|
-
]);
|
|
13
|
-
var R3F_PACKAGES = new Set(["@react-three/drei", "@react-three/fiber"]);
|
|
14
|
-
function hasMeaningfulChildren(el) {
|
|
15
|
-
const kids = el.children ?? [];
|
|
16
|
-
for (const c of kids) {
|
|
17
|
-
if (c.type === "JSXText") {
|
|
18
|
-
if ((c.value ?? "").trim().length > 0)
|
|
19
|
-
return true;
|
|
20
|
-
continue;
|
|
21
|
-
}
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
2
|
+
import { isR3fImport, sourceOf } from "./lib/imports.js";
|
|
3
|
+
import { isCapitalised, meaningfulChildren } from "./lib/jsx.js";
|
|
4
|
+
import { isTestFile, normalise, ROUTE_BASENAMES, fileOf } from "./lib/paths.js";
|
|
5
|
+
import { APP_FOLDER, folderOf, inTier, TIERS } from "./lib/tiers.js";
|
|
6
|
+
var hasMeaningfulChildren = (el) => meaningfulChildren(el.children).length > 0;
|
|
26
7
|
function hasDynamicAttr(el) {
|
|
27
8
|
const attrs = el.openingElement?.attributes ?? [];
|
|
28
9
|
for (const a of attrs) {
|
|
@@ -40,7 +21,7 @@ function hasDynamicAttr(el) {
|
|
|
40
21
|
return false;
|
|
41
22
|
}
|
|
42
23
|
function checkFunction(fnName, fn, importedLocals, importSources, isBridgeFromTissue, report) {
|
|
43
|
-
if (
|
|
24
|
+
if (!isCapitalised(fnName))
|
|
44
25
|
return;
|
|
45
26
|
const body = fn.body;
|
|
46
27
|
if (!body || body.type !== "BlockStatement")
|
|
@@ -58,7 +39,7 @@ function checkFunction(fnName, fn, importedLocals, importSources, isBridgeFromTi
|
|
|
58
39
|
if (tagNode?.type !== "JSXIdentifier")
|
|
59
40
|
return;
|
|
60
41
|
const tag = tagNode.name ?? "";
|
|
61
|
-
if (
|
|
42
|
+
if (!isCapitalised(tag))
|
|
62
43
|
return;
|
|
63
44
|
if (!importedLocals.has(tag))
|
|
64
45
|
return;
|
|
@@ -68,7 +49,7 @@ function checkFunction(fnName, fn, importedLocals, importSources, isBridgeFromTi
|
|
|
68
49
|
return;
|
|
69
50
|
if (isBridgeFromTissue) {
|
|
70
51
|
const source = importSources.get(tag) ?? "";
|
|
71
|
-
const wrapsNonTissueBio =
|
|
52
|
+
const wrapsNonTissueBio = folderOf(source, TIERS.filter((tier) => tier !== "tissues")) !== undefined;
|
|
72
53
|
if (wrapsNonTissueBio)
|
|
73
54
|
return;
|
|
74
55
|
}
|
|
@@ -83,10 +64,10 @@ var noTrivialWrapperComponent = {
|
|
|
83
64
|
const normalized = normalise(context.filename);
|
|
84
65
|
if (isTestFile(normalized))
|
|
85
66
|
return {};
|
|
86
|
-
const basename = normalized
|
|
87
|
-
if (
|
|
67
|
+
const basename = fileOf(normalized);
|
|
68
|
+
if (APP_FOLDER.test(normalized) && ROUTE_BASENAMES.has(basename))
|
|
88
69
|
return {};
|
|
89
|
-
const isBridgeFromTissue =
|
|
70
|
+
const isBridgeFromTissue = inTier(normalized, "tissues");
|
|
90
71
|
let fileUsesR3F = false;
|
|
91
72
|
const importedLocals = new Set;
|
|
92
73
|
const importSources = new Map;
|
|
@@ -114,14 +95,13 @@ var noTrivialWrapperComponent = {
|
|
|
114
95
|
checkFunction(name, decl, importedLocals, importSources, isBridgeFromTissue, context.report);
|
|
115
96
|
},
|
|
116
97
|
ImportDeclaration(node) {
|
|
117
|
-
if (
|
|
98
|
+
if (isR3fImport(node))
|
|
118
99
|
fileUsesR3F = true;
|
|
119
|
-
}
|
|
120
100
|
for (const spec of node.specifiers ?? []) {
|
|
121
101
|
const local = spec.local?.name;
|
|
122
102
|
if (local) {
|
|
123
103
|
importedLocals.add(local);
|
|
124
|
-
importSources.set(local, node
|
|
104
|
+
importSources.set(local, sourceOf(node) ?? "");
|
|
125
105
|
}
|
|
126
106
|
}
|
|
127
107
|
}
|
|
@@ -139,6 +119,17 @@ justifies its existence. Route files are exempt: thin delegation is their purpos
|
|
|
139
119
|
},
|
|
140
120
|
schema: [],
|
|
141
121
|
type: "problem"
|
|
122
|
+
},
|
|
123
|
+
probe() {
|
|
124
|
+
return {
|
|
125
|
+
path: "src/cells/geonosis-probe.tsx",
|
|
126
|
+
source: `import { Inner } from './geonosis-inner'
|
|
127
|
+
|
|
128
|
+
export function GeonosisProbe() {
|
|
129
|
+
return <Inner />
|
|
130
|
+
}
|
|
131
|
+
`
|
|
132
|
+
};
|
|
142
133
|
}
|
|
143
134
|
};
|
|
144
135
|
var no_trivial_wrapper_component_default = noTrivialWrapperComponent;
|