oxlint-plugin-react-doctor 0.9.2 → 0.9.3-dev.02e3188
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/README.md +7 -0
- package/dist/capability-Cwl9JKjU.js +31 -0
- package/dist/core.d.ts +1045 -0
- package/dist/core.js +14 -0
- package/dist/index.d.ts +146 -322
- package/dist/index.js +14 -140056
- package/dist/react-native-dependency-names-DrsRME-d.d.ts +330 -0
- package/package.json +11 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,155 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TSESTree } from "@typescript-eslint/types";
|
|
1
|
+
import { C as FileScan, D as CapabilityQuery, E as Capability, O as FRAMEWORK_TOKENS, S as EsTreeNode, T as ScannedFile, _ as RuleFramework, a as shouldReadSecurityScanContent, b as BaseRuleContext, c as UNBOUNDED_CROSS_FILE_RULE_IDS, d as CROSS_FILE_RULE_IDS, f as MOTION_LIBRARY_PACKAGES, g as Rule, h as OxlintRuleSeverity, i as classifySecurityScanFile, k as FrameworkToken, l as collectCrossFileDependencyProbes, m as REACT_COMPILER_RULES, n as REACT_NATIVE_DEPENDENCY_PREFIXES, o as resetFilesystemCaches, p as EXTERNAL_RULES, r as isReactNativeDependencyName, s as CROSS_FILE_DEPENDENCY_COLLECTORS, t as REACT_NATIVE_DEPENDENCY_NAMES, u as CrossFileProbeTrace, v as RuleSeverity, w as ScanFinding, x as RuleContext, y as RuleVisitors } from "./react-native-dependency-names-DrsRME-d.js";
|
|
3
2
|
|
|
4
|
-
//#region src/plugin/utils/es-tree-node.d.ts
|
|
5
|
-
type WithLooseParent<NodeType> = NodeType extends NodeType ? Omit<NodeType, "parent"> & {
|
|
6
|
-
parent?: EsTreeNode | null;
|
|
7
|
-
} : never;
|
|
8
|
-
type EsTreeNode = WithLooseParent<TSESTree.Node>;
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/plugin/utils/report-descriptor.d.ts
|
|
11
|
-
interface ReportDescriptor {
|
|
12
|
-
node: EsTreeNode;
|
|
13
|
-
message: string;
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/plugin/semantic/control-flow-graph.d.ts
|
|
17
|
-
type CfgEdgeKind = "uncond" | "cond" | "throw";
|
|
18
|
-
interface CfgEdge {
|
|
19
|
-
readonly from: BasicBlock;
|
|
20
|
-
readonly to: BasicBlock;
|
|
21
|
-
readonly kind: CfgEdgeKind;
|
|
22
|
-
}
|
|
23
|
-
interface BasicBlock {
|
|
24
|
-
readonly id: number;
|
|
25
|
-
readonly nodes: EsTreeNode[];
|
|
26
|
-
readonly successors: CfgEdge[];
|
|
27
|
-
readonly predecessors: CfgEdge[];
|
|
28
|
-
}
|
|
29
|
-
interface FunctionCfg {
|
|
30
|
-
readonly owner: EsTreeNode;
|
|
31
|
-
readonly entry: BasicBlock;
|
|
32
|
-
readonly exit: BasicBlock;
|
|
33
|
-
readonly blocks: BasicBlock[];
|
|
34
|
-
readonly blockOf: (node: EsTreeNode) => BasicBlock | null;
|
|
35
|
-
}
|
|
36
|
-
interface ControlFlowAnalysis {
|
|
37
|
-
readonly cfgFor: (functionLike: EsTreeNode) => FunctionCfg | null;
|
|
38
|
-
readonly enclosingFunction: (node: EsTreeNode) => EsTreeNode | null;
|
|
39
|
-
readonly isUnconditionalFromEntry: (node: EsTreeNode) => boolean;
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
//#region src/plugin/semantic/scope-analysis.d.ts
|
|
43
|
-
type SymbolKind = "var" | "let" | "const" | "using" | "function" | "class" | "parameter" | "import" | "ts-import-equals" | "ts-enum" | "ts-type-alias" | "ts-interface" | "ts-module" | "catch-clause-parameter";
|
|
44
|
-
type ScopeKind = "module" | "function" | "arrow-function" | "method" | "block" | "class" | "catch" | "for" | "switch" | "with" | "ts-module" | "ts-enum";
|
|
45
|
-
interface SymbolDescriptor {
|
|
46
|
-
readonly id: number;
|
|
47
|
-
readonly name: string;
|
|
48
|
-
readonly kind: SymbolKind;
|
|
49
|
-
readonly bindingIdentifier: EsTreeNode;
|
|
50
|
-
readonly declarationNode: EsTreeNode;
|
|
51
|
-
readonly scope: ScopeDescriptor;
|
|
52
|
-
readonly initializer: EsTreeNode | null;
|
|
53
|
-
readonly references: ReferenceDescriptor[];
|
|
54
|
-
}
|
|
55
|
-
type ReferenceFlag = "read" | "write" | "read-write";
|
|
56
|
-
interface ReferenceDescriptor {
|
|
57
|
-
readonly id: number;
|
|
58
|
-
readonly identifier: EsTreeNode;
|
|
59
|
-
resolvedSymbol: SymbolDescriptor | null;
|
|
60
|
-
readonly flag: ReferenceFlag;
|
|
61
|
-
readonly scope: ScopeDescriptor;
|
|
62
|
-
}
|
|
63
|
-
interface ScopeDescriptor {
|
|
64
|
-
readonly id: number;
|
|
65
|
-
readonly kind: ScopeKind;
|
|
66
|
-
readonly node: EsTreeNode;
|
|
67
|
-
readonly parent: ScopeDescriptor | null;
|
|
68
|
-
readonly children: ScopeDescriptor[];
|
|
69
|
-
readonly symbols: SymbolDescriptor[];
|
|
70
|
-
readonly references: ReferenceDescriptor[];
|
|
71
|
-
readonly symbolsByName: Map<string, SymbolDescriptor>;
|
|
72
|
-
}
|
|
73
|
-
interface ScopeAnalysis {
|
|
74
|
-
readonly rootScope: ScopeDescriptor;
|
|
75
|
-
readonly scopeFor: (node: EsTreeNode) => ScopeDescriptor;
|
|
76
|
-
readonly ownScopeFor: (node: EsTreeNode) => ScopeDescriptor | null;
|
|
77
|
-
readonly symbolFor: (identifier: EsTreeNode) => SymbolDescriptor | null;
|
|
78
|
-
readonly referenceFor: (identifier: EsTreeNode) => ReferenceDescriptor | null;
|
|
79
|
-
readonly isGlobalReference: (identifier: EsTreeNode) => boolean;
|
|
80
|
-
}
|
|
81
|
-
//#endregion
|
|
82
|
-
//#region src/plugin/utils/rule-context.d.ts
|
|
83
|
-
interface BaseRuleContext {
|
|
84
|
-
report: (descriptor: ReportDescriptor) => void;
|
|
85
|
-
readonly filename?: string;
|
|
86
|
-
/**
|
|
87
|
-
* @deprecated Rules use `context.filename`. Read only as a fallback by
|
|
88
|
-
* `wrapWithSemanticContext`; ESLint implements it as a `this`-bound class
|
|
89
|
-
* method, so it must be called on the host context, never a detached
|
|
90
|
-
* reference.
|
|
91
|
-
*/
|
|
92
|
-
getFilename?: () => string | undefined;
|
|
93
|
-
readonly settings?: Readonly<Record<string, unknown>>;
|
|
94
|
-
}
|
|
95
|
-
interface RuleContext extends Omit<BaseRuleContext, "getFilename"> {
|
|
96
|
-
readonly scopes: ScopeAnalysis;
|
|
97
|
-
readonly cfg: ControlFlowAnalysis;
|
|
98
|
-
}
|
|
99
|
-
//#endregion
|
|
100
|
-
//#region src/plugin/utils/capability.d.ts
|
|
101
|
-
declare const FRAMEWORK_TOKENS: readonly ["nextjs", "vite", "cra", "remix", "gatsby", "expo", "react-native", "tanstack-start", "preact", "unknown"];
|
|
102
|
-
type FrameworkToken = (typeof FRAMEWORK_TOKENS)[number];
|
|
103
|
-
type Capability = FrameworkToken | "react" | "remotion" | "pure-preact" | "react-native" | "server-actions" | "ssr" | "client-only" | "expo:54" | "nextjs:static-export" | "nextjs:15" | "nextjs:16" | "tailwind" | "tailwind:3.4" | "tailwind:4" | "zod" | "zod:4" | "mobx" | "mobx-react" | "mobx-react-lite" | "mobx-react-binding" | "mobx-react-binding-observer-memo-guard" | "mobx-react-observer-memo-guard" | "mobx-react-lite-observer-memo-guard" | "mobx-state-tree" | "mobx-react-observer" | "zustand" | "typescript" | "react-compiler" | "reanimated" | "reanimated:4" | "tanstack-query" | "valtio" | "i18n" | "styled-components" | "styled-components:6" | "three" | "r3f" | "react-router" | "react-router-framework" | "react-router:6.4" | "react-router:6.7" | "react-router:6.9" | "react-router:6.19" | "react-router:7" | "react-router:7.8" | "react-router:7.9" | "react-router:7.10" | "react-router:7.15" | "react-router:8" | "pre-es2023" | "target-blank-needs-explicit-protection" | "target-blank-needs-noreferrer" | `react:${number}` | `preact:${number}` | `remotion:${number}` | `valtio:${number}` | `mobx:${number}` | `zustand:${number}` | `three:${number}` | `r3f:${number}`;
|
|
104
|
-
type CapabilityQuery = (capability: Capability) => boolean;
|
|
105
|
-
//#endregion
|
|
106
|
-
//#region src/plugin/utils/file-scan.d.ts
|
|
107
|
-
interface ScannedFile {
|
|
108
|
-
readonly absolutePath: string;
|
|
109
|
-
readonly relativePath: string;
|
|
110
|
-
readonly content: string;
|
|
111
|
-
readonly isGeneratedBundle: boolean;
|
|
112
|
-
}
|
|
113
|
-
interface ScanFinding {
|
|
114
|
-
readonly message: string;
|
|
115
|
-
readonly line: number;
|
|
116
|
-
readonly column: number;
|
|
117
|
-
readonly severity?: "error" | "warn";
|
|
118
|
-
readonly title?: string;
|
|
119
|
-
readonly help?: string;
|
|
120
|
-
}
|
|
121
|
-
interface FileScan {
|
|
122
|
-
(file: ScannedFile): ScanFinding[];
|
|
123
|
-
}
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region src/plugin/utils/rule-visitors.d.ts
|
|
126
|
-
interface RuleVisitors {
|
|
127
|
-
[selector: string]: ((node: any) => void) | (() => void);
|
|
128
|
-
}
|
|
129
|
-
//#endregion
|
|
130
|
-
//#region src/plugin/utils/rule.d.ts
|
|
131
|
-
type RuleSeverity = "error" | "warn";
|
|
132
|
-
type RuleFramework = "global" | "nextjs" | "react-native" | "tanstack-start" | "tanstack-query" | "preact";
|
|
133
|
-
interface Rule {
|
|
134
|
-
id: string;
|
|
135
|
-
title?: string;
|
|
136
|
-
severity: RuleSeverity;
|
|
137
|
-
category?: string;
|
|
138
|
-
framework?: RuleFramework;
|
|
139
|
-
requires?: ReadonlyArray<Capability>;
|
|
140
|
-
minimumInkVersion?: string;
|
|
141
|
-
disabledWhen?: ReadonlyArray<Capability>;
|
|
142
|
-
tags?: ReadonlyArray<string>;
|
|
143
|
-
matchByOccurrence?: boolean;
|
|
144
|
-
defaultEnabled?: boolean;
|
|
145
|
-
lifecycle?: "retired";
|
|
146
|
-
scan?: FileScan;
|
|
147
|
-
committedFilesOnly?: boolean;
|
|
148
|
-
recommendation?: string;
|
|
149
|
-
recommendationFor?: (hasCapability: CapabilityQuery) => string | undefined;
|
|
150
|
-
create: (context: RuleContext) => RuleVisitors;
|
|
151
|
-
}
|
|
152
|
-
//#endregion
|
|
153
3
|
//#region src/plugin/utils/rule-plugin.d.ts
|
|
154
4
|
interface HostRule extends Omit<Rule, "create"> {
|
|
155
5
|
create: (context: BaseRuleContext) => RuleVisitors;
|
|
@@ -164,9 +14,6 @@ interface RulePlugin {
|
|
|
164
14
|
//#region src/plugin/react-doctor-plugin.d.ts
|
|
165
15
|
declare const plugin: RulePlugin;
|
|
166
16
|
//#endregion
|
|
167
|
-
//#region src/types.d.ts
|
|
168
|
-
type OxlintRuleSeverity = RuleSeverity | "off";
|
|
169
|
-
//#endregion
|
|
170
17
|
//#region src/rules.d.ts
|
|
171
18
|
declare const REACT_DOCTOR_RULES: readonly [{
|
|
172
19
|
readonly key: "react-doctor/active-static-asset";
|
|
@@ -11304,6 +11151,30 @@ declare const REACT_DOCTOR_RULES: readonly [{
|
|
|
11304
11151
|
readonly recommendationFor?: (hasCapability: CapabilityQuery) => string | undefined;
|
|
11305
11152
|
readonly create: (context: RuleContext) => RuleVisitors;
|
|
11306
11153
|
};
|
|
11154
|
+
}, {
|
|
11155
|
+
readonly key: "react-doctor/no-unowned-async-error-clear";
|
|
11156
|
+
readonly id: "no-unowned-async-error-clear";
|
|
11157
|
+
readonly source: "react-doctor";
|
|
11158
|
+
readonly originallyExternal: false;
|
|
11159
|
+
readonly rule: {
|
|
11160
|
+
readonly framework: "global";
|
|
11161
|
+
readonly category: "Bugs";
|
|
11162
|
+
readonly requires: readonly Capability[];
|
|
11163
|
+
readonly id: string;
|
|
11164
|
+
readonly title?: string;
|
|
11165
|
+
readonly severity: RuleSeverity;
|
|
11166
|
+
readonly minimumInkVersion?: string;
|
|
11167
|
+
readonly disabledWhen?: ReadonlyArray<Capability>;
|
|
11168
|
+
readonly tags?: ReadonlyArray<string>;
|
|
11169
|
+
readonly matchByOccurrence?: boolean;
|
|
11170
|
+
readonly defaultEnabled?: boolean;
|
|
11171
|
+
readonly lifecycle?: "retired";
|
|
11172
|
+
readonly scan?: FileScan;
|
|
11173
|
+
readonly committedFilesOnly?: boolean;
|
|
11174
|
+
readonly recommendation?: string;
|
|
11175
|
+
readonly recommendationFor?: (hasCapability: CapabilityQuery) => string | undefined;
|
|
11176
|
+
readonly create: (context: RuleContext) => RuleVisitors;
|
|
11177
|
+
};
|
|
11307
11178
|
}, {
|
|
11308
11179
|
readonly key: "react-doctor/no-unsafe";
|
|
11309
11180
|
readonly id: "no-unsafe";
|
|
@@ -13224,6 +13095,30 @@ declare const REACT_DOCTOR_RULES: readonly [{
|
|
|
13224
13095
|
readonly recommendationFor?: (hasCapability: CapabilityQuery) => string | undefined;
|
|
13225
13096
|
readonly create: (context: RuleContext) => RuleVisitors;
|
|
13226
13097
|
};
|
|
13098
|
+
}, {
|
|
13099
|
+
readonly key: "react-doctor/r3f-prefer-instanced-mesh";
|
|
13100
|
+
readonly id: "r3f-prefer-instanced-mesh";
|
|
13101
|
+
readonly source: "react-doctor";
|
|
13102
|
+
readonly originallyExternal: false;
|
|
13103
|
+
readonly rule: {
|
|
13104
|
+
readonly framework: "global";
|
|
13105
|
+
readonly category: "Performance";
|
|
13106
|
+
readonly tags: readonly string[];
|
|
13107
|
+
readonly requires: readonly Capability[];
|
|
13108
|
+
readonly id: string;
|
|
13109
|
+
readonly title?: string;
|
|
13110
|
+
readonly severity: RuleSeverity;
|
|
13111
|
+
readonly minimumInkVersion?: string;
|
|
13112
|
+
readonly disabledWhen?: ReadonlyArray<Capability>;
|
|
13113
|
+
readonly matchByOccurrence?: boolean;
|
|
13114
|
+
readonly defaultEnabled?: boolean;
|
|
13115
|
+
readonly lifecycle?: "retired";
|
|
13116
|
+
readonly scan?: FileScan;
|
|
13117
|
+
readonly committedFilesOnly?: boolean;
|
|
13118
|
+
readonly recommendation?: string;
|
|
13119
|
+
readonly recommendationFor?: (hasCapability: CapabilityQuery) => string | undefined;
|
|
13120
|
+
readonly create: (context: RuleContext) => RuleVisitors;
|
|
13121
|
+
};
|
|
13227
13122
|
}, {
|
|
13228
13123
|
readonly key: "react-doctor/r3f-prefer-use-loader";
|
|
13229
13124
|
readonly id: "r3f-prefer-use-loader";
|
|
@@ -17664,6 +17559,30 @@ declare const REACT_DOCTOR_RULES: readonly [{
|
|
|
17664
17559
|
readonly recommendationFor?: (hasCapability: CapabilityQuery) => string | undefined;
|
|
17665
17560
|
readonly create: (context: RuleContext) => RuleVisitors;
|
|
17666
17561
|
};
|
|
17562
|
+
}, {
|
|
17563
|
+
readonly key: "react-doctor/three-prefer-instanced-mesh";
|
|
17564
|
+
readonly id: "three-prefer-instanced-mesh";
|
|
17565
|
+
readonly source: "react-doctor";
|
|
17566
|
+
readonly originallyExternal: false;
|
|
17567
|
+
readonly rule: {
|
|
17568
|
+
readonly framework: "global";
|
|
17569
|
+
readonly category: "Performance";
|
|
17570
|
+
readonly tags: readonly string[];
|
|
17571
|
+
readonly requires: readonly Capability[];
|
|
17572
|
+
readonly id: string;
|
|
17573
|
+
readonly title?: string;
|
|
17574
|
+
readonly severity: RuleSeverity;
|
|
17575
|
+
readonly minimumInkVersion?: string;
|
|
17576
|
+
readonly disabledWhen?: ReadonlyArray<Capability>;
|
|
17577
|
+
readonly matchByOccurrence?: boolean;
|
|
17578
|
+
readonly defaultEnabled?: boolean;
|
|
17579
|
+
readonly lifecycle?: "retired";
|
|
17580
|
+
readonly scan?: FileScan;
|
|
17581
|
+
readonly committedFilesOnly?: boolean;
|
|
17582
|
+
readonly recommendation?: string;
|
|
17583
|
+
readonly recommendationFor?: (hasCapability: CapabilityQuery) => string | undefined;
|
|
17584
|
+
readonly create: (context: RuleContext) => RuleVisitors;
|
|
17585
|
+
};
|
|
17667
17586
|
}, {
|
|
17668
17587
|
readonly key: "react-doctor/three-raw-shader-require-fragment-float-precision";
|
|
17669
17588
|
readonly id: "three-raw-shader-require-fragment-float-precision";
|
|
@@ -18913,71 +18832,6 @@ declare const REACT_DOCTOR_RULES: readonly [{
|
|
|
18913
18832
|
readonly create: (context: RuleContext) => RuleVisitors;
|
|
18914
18833
|
};
|
|
18915
18834
|
}];
|
|
18916
|
-
declare const EXTERNAL_RULES: readonly [{
|
|
18917
|
-
readonly key: "react-hooks-js/set-state-in-render";
|
|
18918
|
-
readonly source: "react-compiler";
|
|
18919
|
-
readonly severity: "error";
|
|
18920
|
-
}, {
|
|
18921
|
-
readonly key: "react-hooks-js/immutability";
|
|
18922
|
-
readonly source: "react-compiler";
|
|
18923
|
-
readonly severity: "error";
|
|
18924
|
-
}, {
|
|
18925
|
-
readonly key: "react-hooks-js/refs";
|
|
18926
|
-
readonly source: "react-compiler";
|
|
18927
|
-
readonly severity: "error";
|
|
18928
|
-
}, {
|
|
18929
|
-
readonly key: "react-hooks-js/purity";
|
|
18930
|
-
readonly source: "react-compiler";
|
|
18931
|
-
readonly severity: "error";
|
|
18932
|
-
}, {
|
|
18933
|
-
readonly key: "react-hooks-js/hooks";
|
|
18934
|
-
readonly source: "react-compiler";
|
|
18935
|
-
readonly severity: "error";
|
|
18936
|
-
}, {
|
|
18937
|
-
readonly key: "react-hooks-js/set-state-in-effect";
|
|
18938
|
-
readonly source: "react-compiler";
|
|
18939
|
-
readonly severity: "warn";
|
|
18940
|
-
}, {
|
|
18941
|
-
readonly key: "react-hooks-js/globals";
|
|
18942
|
-
readonly source: "react-compiler";
|
|
18943
|
-
readonly severity: "error";
|
|
18944
|
-
}, {
|
|
18945
|
-
readonly key: "react-hooks-js/error-boundaries";
|
|
18946
|
-
readonly source: "react-compiler";
|
|
18947
|
-
readonly severity: "error";
|
|
18948
|
-
}, {
|
|
18949
|
-
readonly key: "react-hooks-js/preserve-manual-memoization";
|
|
18950
|
-
readonly source: "react-compiler";
|
|
18951
|
-
readonly severity: "error";
|
|
18952
|
-
}, {
|
|
18953
|
-
readonly key: "react-hooks-js/unsupported-syntax";
|
|
18954
|
-
readonly source: "react-compiler";
|
|
18955
|
-
readonly severity: "error";
|
|
18956
|
-
}, {
|
|
18957
|
-
readonly key: "react-hooks-js/component-hook-factories";
|
|
18958
|
-
readonly source: "react-compiler";
|
|
18959
|
-
readonly severity: "error";
|
|
18960
|
-
}, {
|
|
18961
|
-
readonly key: "react-hooks-js/static-components";
|
|
18962
|
-
readonly source: "react-compiler";
|
|
18963
|
-
readonly severity: "error";
|
|
18964
|
-
}, {
|
|
18965
|
-
readonly key: "react-hooks-js/use-memo";
|
|
18966
|
-
readonly source: "react-compiler";
|
|
18967
|
-
readonly severity: "error";
|
|
18968
|
-
}, {
|
|
18969
|
-
readonly key: "react-hooks-js/void-use-memo";
|
|
18970
|
-
readonly source: "react-compiler";
|
|
18971
|
-
readonly severity: "error";
|
|
18972
|
-
}, {
|
|
18973
|
-
readonly key: "react-hooks-js/incompatible-library";
|
|
18974
|
-
readonly source: "react-compiler";
|
|
18975
|
-
readonly severity: "error";
|
|
18976
|
-
}, {
|
|
18977
|
-
readonly key: "react-hooks-js/todo";
|
|
18978
|
-
readonly source: "react-compiler";
|
|
18979
|
-
readonly severity: "error";
|
|
18980
|
-
}];
|
|
18981
18835
|
declare const RULES: readonly [{
|
|
18982
18836
|
readonly key: "react-doctor/active-static-asset";
|
|
18983
18837
|
readonly id: "active-static-asset";
|
|
@@ -30114,6 +29968,30 @@ declare const RULES: readonly [{
|
|
|
30114
29968
|
readonly recommendationFor?: (hasCapability: CapabilityQuery) => string | undefined;
|
|
30115
29969
|
readonly create: (context: RuleContext) => RuleVisitors;
|
|
30116
29970
|
};
|
|
29971
|
+
}, {
|
|
29972
|
+
readonly key: "react-doctor/no-unowned-async-error-clear";
|
|
29973
|
+
readonly id: "no-unowned-async-error-clear";
|
|
29974
|
+
readonly source: "react-doctor";
|
|
29975
|
+
readonly originallyExternal: false;
|
|
29976
|
+
readonly rule: {
|
|
29977
|
+
readonly framework: "global";
|
|
29978
|
+
readonly category: "Bugs";
|
|
29979
|
+
readonly requires: readonly Capability[];
|
|
29980
|
+
readonly id: string;
|
|
29981
|
+
readonly title?: string;
|
|
29982
|
+
readonly severity: RuleSeverity;
|
|
29983
|
+
readonly minimumInkVersion?: string;
|
|
29984
|
+
readonly disabledWhen?: ReadonlyArray<Capability>;
|
|
29985
|
+
readonly tags?: ReadonlyArray<string>;
|
|
29986
|
+
readonly matchByOccurrence?: boolean;
|
|
29987
|
+
readonly defaultEnabled?: boolean;
|
|
29988
|
+
readonly lifecycle?: "retired";
|
|
29989
|
+
readonly scan?: FileScan;
|
|
29990
|
+
readonly committedFilesOnly?: boolean;
|
|
29991
|
+
readonly recommendation?: string;
|
|
29992
|
+
readonly recommendationFor?: (hasCapability: CapabilityQuery) => string | undefined;
|
|
29993
|
+
readonly create: (context: RuleContext) => RuleVisitors;
|
|
29994
|
+
};
|
|
30117
29995
|
}, {
|
|
30118
29996
|
readonly key: "react-doctor/no-unsafe";
|
|
30119
29997
|
readonly id: "no-unsafe";
|
|
@@ -32034,6 +31912,30 @@ declare const RULES: readonly [{
|
|
|
32034
31912
|
readonly recommendationFor?: (hasCapability: CapabilityQuery) => string | undefined;
|
|
32035
31913
|
readonly create: (context: RuleContext) => RuleVisitors;
|
|
32036
31914
|
};
|
|
31915
|
+
}, {
|
|
31916
|
+
readonly key: "react-doctor/r3f-prefer-instanced-mesh";
|
|
31917
|
+
readonly id: "r3f-prefer-instanced-mesh";
|
|
31918
|
+
readonly source: "react-doctor";
|
|
31919
|
+
readonly originallyExternal: false;
|
|
31920
|
+
readonly rule: {
|
|
31921
|
+
readonly framework: "global";
|
|
31922
|
+
readonly category: "Performance";
|
|
31923
|
+
readonly tags: readonly string[];
|
|
31924
|
+
readonly requires: readonly Capability[];
|
|
31925
|
+
readonly id: string;
|
|
31926
|
+
readonly title?: string;
|
|
31927
|
+
readonly severity: RuleSeverity;
|
|
31928
|
+
readonly minimumInkVersion?: string;
|
|
31929
|
+
readonly disabledWhen?: ReadonlyArray<Capability>;
|
|
31930
|
+
readonly matchByOccurrence?: boolean;
|
|
31931
|
+
readonly defaultEnabled?: boolean;
|
|
31932
|
+
readonly lifecycle?: "retired";
|
|
31933
|
+
readonly scan?: FileScan;
|
|
31934
|
+
readonly committedFilesOnly?: boolean;
|
|
31935
|
+
readonly recommendation?: string;
|
|
31936
|
+
readonly recommendationFor?: (hasCapability: CapabilityQuery) => string | undefined;
|
|
31937
|
+
readonly create: (context: RuleContext) => RuleVisitors;
|
|
31938
|
+
};
|
|
32037
31939
|
}, {
|
|
32038
31940
|
readonly key: "react-doctor/r3f-prefer-use-loader";
|
|
32039
31941
|
readonly id: "r3f-prefer-use-loader";
|
|
@@ -36474,6 +36376,30 @@ declare const RULES: readonly [{
|
|
|
36474
36376
|
readonly recommendationFor?: (hasCapability: CapabilityQuery) => string | undefined;
|
|
36475
36377
|
readonly create: (context: RuleContext) => RuleVisitors;
|
|
36476
36378
|
};
|
|
36379
|
+
}, {
|
|
36380
|
+
readonly key: "react-doctor/three-prefer-instanced-mesh";
|
|
36381
|
+
readonly id: "three-prefer-instanced-mesh";
|
|
36382
|
+
readonly source: "react-doctor";
|
|
36383
|
+
readonly originallyExternal: false;
|
|
36384
|
+
readonly rule: {
|
|
36385
|
+
readonly framework: "global";
|
|
36386
|
+
readonly category: "Performance";
|
|
36387
|
+
readonly tags: readonly string[];
|
|
36388
|
+
readonly requires: readonly Capability[];
|
|
36389
|
+
readonly id: string;
|
|
36390
|
+
readonly title?: string;
|
|
36391
|
+
readonly severity: RuleSeverity;
|
|
36392
|
+
readonly minimumInkVersion?: string;
|
|
36393
|
+
readonly disabledWhen?: ReadonlyArray<Capability>;
|
|
36394
|
+
readonly matchByOccurrence?: boolean;
|
|
36395
|
+
readonly defaultEnabled?: boolean;
|
|
36396
|
+
readonly lifecycle?: "retired";
|
|
36397
|
+
readonly scan?: FileScan;
|
|
36398
|
+
readonly committedFilesOnly?: boolean;
|
|
36399
|
+
readonly recommendation?: string;
|
|
36400
|
+
readonly recommendationFor?: (hasCapability: CapabilityQuery) => string | undefined;
|
|
36401
|
+
readonly create: (context: RuleContext) => RuleVisitors;
|
|
36402
|
+
};
|
|
36477
36403
|
}, {
|
|
36478
36404
|
readonly key: "react-doctor/three-raw-shader-require-fragment-float-precision";
|
|
36479
36405
|
readonly id: "three-raw-shader-require-fragment-float-precision";
|
|
@@ -37796,108 +37722,6 @@ declare const PREACT_RULES: Record<string, OxlintRuleSeverity>;
|
|
|
37796
37722
|
declare const ALL_REACT_DOCTOR_RULES: Record<string, OxlintRuleSeverity>;
|
|
37797
37723
|
declare const ALL_REACT_DOCTOR_RULE_KEYS: ReadonlySet<string>;
|
|
37798
37724
|
declare const FRAMEWORK_SPECIFIC_RULE_KEYS: ReadonlySet<string>;
|
|
37799
|
-
declare const REACT_COMPILER_RULES: Record<string, OxlintRuleSeverity>;
|
|
37800
|
-
//#endregion
|
|
37801
|
-
//#region src/plugin/constants/style.d.ts
|
|
37802
|
-
declare const MOTION_LIBRARY_PACKAGES: Set<string>;
|
|
37803
|
-
//#endregion
|
|
37804
|
-
//#region src/plugin/constants/cross-file-rule-ids.d.ts
|
|
37805
|
-
declare const CROSS_FILE_RULE_IDS: ReadonlySet<string>;
|
|
37806
|
-
//#endregion
|
|
37807
|
-
//#region src/plugin/utils/cross-file-probe-recorder.d.ts
|
|
37808
|
-
interface CrossFileProbeTrace {
|
|
37809
|
-
/** Paths whose existence classification (file / dir / none) was consulted. */
|
|
37810
|
-
readonly existencePaths: Set<string>;
|
|
37811
|
-
/** Paths whose content (bytes, exports, parse) was consulted. */
|
|
37812
|
-
readonly contentPaths: Set<string>;
|
|
37813
|
-
}
|
|
37814
|
-
//#endregion
|
|
37815
|
-
//#region src/plugin/cross-file-dependencies.d.ts
|
|
37816
|
-
/**
|
|
37817
|
-
* Per-rule cross-file dependency collectors — the foundation of the sidecar
|
|
37818
|
-
* lint cache's dependency fingerprints (`@react-doctor/core`,
|
|
37819
|
-
* `runners/oxlint/sidecar-lint-cache.ts`).
|
|
37820
|
-
*
|
|
37821
|
-
* A collector re-runs the SAME resolver helpers its rule calls at lint time
|
|
37822
|
-
* (import resolution, barrel following, ancestor-layout walks, package.json
|
|
37823
|
-
* classification) under the probe recorder
|
|
37824
|
-
* (`utils/cross-file-probe-recorder.ts`), so the recorded probe set is the
|
|
37825
|
-
* exact set of filesystem facts the rule's execution consulted — including
|
|
37826
|
-
* the negative probes (extension candidates that did NOT exist) that make
|
|
37827
|
-
* resolution shadowing detectable when a new file appears.
|
|
37828
|
-
*
|
|
37829
|
-
* SOUNDNESS INVARIANT — each collector's probe set must be a SUPERSET of
|
|
37830
|
-
* every filesystem read its rule can make while linting the file, for any
|
|
37831
|
-
* file content and any filesystem state:
|
|
37832
|
-
*
|
|
37833
|
-
* - Over-approximation is always safe (extra probes only cause a spurious
|
|
37834
|
-
* re-lint); under-approximation is forbidden (a missed probe could
|
|
37835
|
-
* replay a stale verdict).
|
|
37836
|
-
* - Where a rule gates its cross-file reads on in-file conditions, a
|
|
37837
|
-
* collector may skip the gate (probe more) or must mirror it EXACTLY
|
|
37838
|
-
* (probe the same). Each collector documents which it does per gate.
|
|
37839
|
-
* - The replay argument: the stored probe set is the complete read set of
|
|
37840
|
-
* the collector's execution at store time. If every stored probe has
|
|
37841
|
-
* the same answer on a later scan, re-executing the collector — and
|
|
37842
|
-
* therefore the rule, whose reads are a subset — reproduces the same
|
|
37843
|
-
* execution step by step (the file's own content is pinned separately
|
|
37844
|
-
* by the cache key's content hash), so the stored diagnostics are
|
|
37845
|
-
* exactly what a fresh sidecar lint would produce.
|
|
37846
|
-
*
|
|
37847
|
-
* A cross-file rule WITHOUT a collector here must be listed in
|
|
37848
|
-
* `UNBOUNDED_CROSS_FILE_RULE_IDS` — it then re-lints every file on every
|
|
37849
|
-
* scan (the sound fallback). `cross-file-rule-ids.test.ts` in
|
|
37850
|
-
* `@react-doctor/core` forces every `CROSS_FILE_RULE_IDS` entry into
|
|
37851
|
-
* exactly one of the two classifications.
|
|
37852
|
-
*/
|
|
37853
|
-
interface CrossFileDependencyCollectorInput {
|
|
37854
|
-
/** Absolute, forward-slash-normalized path of the file being fingerprinted. */
|
|
37855
|
-
readonly absoluteFilePath: string;
|
|
37856
|
-
readonly sourceText: string;
|
|
37857
|
-
/** oxc module record — the file's static import declarations. */
|
|
37858
|
-
readonly staticImports: ReadonlyArray<StaticImport>;
|
|
37859
|
-
/** Parsed program (no parent references attached). */
|
|
37860
|
-
readonly program: EsTreeNode;
|
|
37861
|
-
}
|
|
37862
|
-
type CrossFileDependencyCollector = (input: CrossFileDependencyCollectorInput) => void;
|
|
37863
|
-
declare const CROSS_FILE_DEPENDENCY_COLLECTORS: ReadonlyMap<string, CrossFileDependencyCollector>;
|
|
37864
|
-
/**
|
|
37865
|
-
* Cross-file rules whose dependency set CANNOT be soundly bounded — they are
|
|
37866
|
-
* excluded from fingerprinting and re-lint every file on every scan. A new
|
|
37867
|
-
* cross-file rule must be added either here or to
|
|
37868
|
-
* `CROSS_FILE_DEPENDENCY_COLLECTORS` (the core guard test enforces the
|
|
37869
|
-
* partition), forcing a conscious classification.
|
|
37870
|
-
*/
|
|
37871
|
-
declare const UNBOUNDED_CROSS_FILE_RULE_IDS: ReadonlySet<string>;
|
|
37872
|
-
/**
|
|
37873
|
-
* Runs the collectors for `ruleIds` over one file and returns every
|
|
37874
|
-
* filesystem probe they made — the file's cross-file dependency set.
|
|
37875
|
-
*
|
|
37876
|
-
* Returns `null` (caller must treat the file as unfingerprintable and always
|
|
37877
|
-
* re-lint it) when the file has a fatal parse error — an execution the
|
|
37878
|
-
* collectors cannot mirror — or when a requested rule has no collector.
|
|
37879
|
-
*/
|
|
37880
|
-
declare const collectCrossFileDependencyProbes: (input: {
|
|
37881
|
-
absoluteFilePath: string;
|
|
37882
|
-
sourceText: string;
|
|
37883
|
-
ruleIds: ReadonlyArray<string>;
|
|
37884
|
-
}) => CrossFileProbeTrace | null;
|
|
37885
|
-
//#endregion
|
|
37886
|
-
//#region src/plugin/utils/read-nearest-package-manifest.d.ts
|
|
37887
|
-
declare const resetManifestCaches: () => void;
|
|
37888
|
-
//#endregion
|
|
37889
|
-
//#region src/plugin/rules/security-scan/utils/classify-security-scan-file.d.ts
|
|
37890
|
-
interface SecurityScanFileClassification {
|
|
37891
|
-
readonly bucket: "priority" | "artifact" | "other";
|
|
37892
|
-
readonly isGeneratedBundleByName: boolean;
|
|
37893
|
-
}
|
|
37894
|
-
declare const classifySecurityScanFile: (relativePath: string) => SecurityScanFileClassification | null;
|
|
37895
|
-
declare const shouldReadSecurityScanContent: (relativePath: string, isGeneratedBundle: boolean) => boolean;
|
|
37896
|
-
//#endregion
|
|
37897
|
-
//#region src/react-native-dependency-names.d.ts
|
|
37898
|
-
declare const REACT_NATIVE_DEPENDENCY_NAMES: ReadonlySet<string>;
|
|
37899
|
-
declare const REACT_NATIVE_DEPENDENCY_PREFIXES: ReadonlyArray<string>;
|
|
37900
|
-
declare const isReactNativeDependencyName: (dependencyName: string) => boolean;
|
|
37901
37725
|
//#endregion
|
|
37902
|
-
export { ALL_REACT_DOCTOR_RULES, ALL_REACT_DOCTOR_RULE_KEYS, CROSS_FILE_DEPENDENCY_COLLECTORS, CROSS_FILE_RULE_IDS, type Capability, type CapabilityQuery, type CrossFileProbeTrace, EXTERNAL_RULES, type EsTreeNode, FRAMEWORK_SPECIFIC_RULE_KEYS, FRAMEWORK_TOKENS, type FileScan, type FrameworkToken, MOTION_LIBRARY_PACKAGES, NEXTJS_RULES, type OxlintRuleSeverity, PREACT_RULES, REACT_COMPILER_RULES, REACT_DOCTOR_RULES, REACT_NATIVE_DEPENDENCY_NAMES, REACT_NATIVE_DEPENDENCY_PREFIXES, REACT_NATIVE_RULES, RECOMMENDED_RULES, RULES, type Rule, type RuleFramework, type RulePlugin, type RuleSeverity, type RuleVisitors, type ScanFinding, type ScannedFile, TANSTACK_QUERY_RULES, TANSTACK_START_RULES, UNBOUNDED_CROSS_FILE_RULE_IDS, classifySecurityScanFile, collectCrossFileDependencyProbes, plugin as default, isReactNativeDependencyName, resetManifestCaches, shouldReadSecurityScanContent };
|
|
37726
|
+
export { ALL_REACT_DOCTOR_RULES, ALL_REACT_DOCTOR_RULE_KEYS, CROSS_FILE_DEPENDENCY_COLLECTORS, CROSS_FILE_RULE_IDS, type Capability, type CapabilityQuery, type CrossFileProbeTrace, EXTERNAL_RULES, type EsTreeNode, FRAMEWORK_SPECIFIC_RULE_KEYS, FRAMEWORK_TOKENS, type FileScan, type FrameworkToken, MOTION_LIBRARY_PACKAGES, NEXTJS_RULES, type OxlintRuleSeverity, PREACT_RULES, REACT_COMPILER_RULES, REACT_DOCTOR_RULES, REACT_NATIVE_DEPENDENCY_NAMES, REACT_NATIVE_DEPENDENCY_PREFIXES, REACT_NATIVE_RULES, RECOMMENDED_RULES, RULES, type Rule, type RuleFramework, type RulePlugin, type RuleSeverity, type RuleVisitors, type ScanFinding, type ScannedFile, TANSTACK_QUERY_RULES, TANSTACK_START_RULES, UNBOUNDED_CROSS_FILE_RULE_IDS, classifySecurityScanFile, collectCrossFileDependencyProbes, plugin as default, isReactNativeDependencyName, resetFilesystemCaches as resetManifestCaches, shouldReadSecurityScanContent };
|
|
37903
37727
|
//# sourceMappingURL=index.d.ts.map
|