react-doctor 0.0.41 → 0.0.44
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 +169 -41
- package/bin/react-doctor.js +13 -0
- package/dist/{process-browser-diagnostics-DpaZeYLI.js → browser-BOxs7MrK.js} +39 -45
- package/dist/{diagnose-browser-B17IqMa3.d.ts → browser-Dcq3yn-p.d.ts} +32 -17
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +2 -3
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +1470 -517
- package/dist/index.d.ts +119 -12
- package/dist/index.js +1178 -363
- package/dist/react-doctor-plugin.js +2339 -169
- package/dist/worker.d.ts +2 -2
- package/dist/worker.js +2 -3
- package/package.json +35 -13
- package/dist/cli.js.map +0 -1
- package/dist/diagnose-browser-B17IqMa3.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/process-browser-diagnostics-DpaZeYLI.js.map +0 -1
- package/dist/react-doctor-plugin.d.ts.map +0 -1
- package/dist/react-doctor-plugin.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ interface ProjectInfo {
|
|
|
8
8
|
framework: Framework;
|
|
9
9
|
hasTypeScript: boolean;
|
|
10
10
|
hasReactCompiler: boolean;
|
|
11
|
+
hasTanStackQuery: boolean;
|
|
11
12
|
sourceFileCount: number;
|
|
12
13
|
}
|
|
13
14
|
interface Diagnostic {
|
|
@@ -20,12 +21,35 @@ interface Diagnostic {
|
|
|
20
21
|
line: number;
|
|
21
22
|
column: number;
|
|
22
23
|
category: string;
|
|
23
|
-
weight?: number;
|
|
24
24
|
}
|
|
25
25
|
interface ScoreResult {
|
|
26
26
|
score: number;
|
|
27
27
|
label: string;
|
|
28
28
|
}
|
|
29
|
+
interface DiagnoseOptions {
|
|
30
|
+
lint?: boolean;
|
|
31
|
+
deadCode?: boolean;
|
|
32
|
+
verbose?: boolean;
|
|
33
|
+
includePaths?: string[];
|
|
34
|
+
/**
|
|
35
|
+
* Per-call override for `ReactDoctorConfig.respectInlineDisables`.
|
|
36
|
+
* See that field's docs for the full contract.
|
|
37
|
+
*/
|
|
38
|
+
respectInlineDisables?: boolean;
|
|
39
|
+
}
|
|
40
|
+
interface DiagnoseResult {
|
|
41
|
+
diagnostics: Diagnostic[];
|
|
42
|
+
score: ScoreResult | null;
|
|
43
|
+
project: ProjectInfo;
|
|
44
|
+
elapsedMilliseconds: number;
|
|
45
|
+
}
|
|
46
|
+
interface ScanResult {
|
|
47
|
+
diagnostics: Diagnostic[];
|
|
48
|
+
score: ScoreResult | null;
|
|
49
|
+
skippedChecks: string[];
|
|
50
|
+
project: ProjectInfo;
|
|
51
|
+
elapsedMilliseconds: number;
|
|
52
|
+
}
|
|
29
53
|
interface DiffInfo {
|
|
30
54
|
currentBranch: string;
|
|
31
55
|
baseBranch: string;
|
|
@@ -46,25 +70,108 @@ interface ReactDoctorConfig {
|
|
|
46
70
|
customRulesOnly?: boolean;
|
|
47
71
|
share?: boolean;
|
|
48
72
|
textComponents?: string[];
|
|
73
|
+
/**
|
|
74
|
+
* Whether to respect inline `// eslint-disable*` / `// oxlint-disable*`
|
|
75
|
+
* comments in source files. Default: `true`.
|
|
76
|
+
*
|
|
77
|
+
* File-level ignores (`.gitignore`, `.eslintignore`, `.oxlintignore`,
|
|
78
|
+
* `.prettierignore`, `.gitattributes` `linguist-vendored` /
|
|
79
|
+
* `linguist-generated`) are ALWAYS honored regardless of this option
|
|
80
|
+
* — they typically point at vendored or generated code that
|
|
81
|
+
* genuinely shouldn't be linted at all.
|
|
82
|
+
*
|
|
83
|
+
* Set to `false` for "audit mode": every inline suppression is
|
|
84
|
+
* neutralized so react-doctor reports every diagnostic regardless
|
|
85
|
+
* of historical hide-comments.
|
|
86
|
+
*/
|
|
87
|
+
respectInlineDisables?: boolean;
|
|
88
|
+
}
|
|
89
|
+
type JsonReportMode = "full" | "diff" | "staged";
|
|
90
|
+
interface JsonReportDiffInfo {
|
|
91
|
+
baseBranch: string;
|
|
92
|
+
currentBranch: string;
|
|
93
|
+
changedFileCount: number;
|
|
94
|
+
isCurrentChanges: boolean;
|
|
49
95
|
}
|
|
96
|
+
interface JsonReportProjectEntry {
|
|
97
|
+
directory: string;
|
|
98
|
+
project: ProjectInfo;
|
|
99
|
+
diagnostics: Diagnostic[];
|
|
100
|
+
score: ScoreResult | null;
|
|
101
|
+
skippedChecks: string[];
|
|
102
|
+
elapsedMilliseconds: number;
|
|
103
|
+
}
|
|
104
|
+
interface JsonReportSummary {
|
|
105
|
+
errorCount: number;
|
|
106
|
+
warningCount: number;
|
|
107
|
+
affectedFileCount: number;
|
|
108
|
+
totalDiagnosticCount: number;
|
|
109
|
+
score: number | null;
|
|
110
|
+
scoreLabel: string | null;
|
|
111
|
+
}
|
|
112
|
+
interface JsonReportError {
|
|
113
|
+
message: string;
|
|
114
|
+
name: string;
|
|
115
|
+
chain: string[];
|
|
116
|
+
}
|
|
117
|
+
interface JsonReport {
|
|
118
|
+
schemaVersion: 1;
|
|
119
|
+
version: string;
|
|
120
|
+
ok: boolean;
|
|
121
|
+
directory: string;
|
|
122
|
+
mode: JsonReportMode;
|
|
123
|
+
diff: JsonReportDiffInfo | null;
|
|
124
|
+
projects: JsonReportProjectEntry[];
|
|
125
|
+
/**
|
|
126
|
+
* Flattened across `projects[].diagnostics` for convenience. Equivalent to
|
|
127
|
+
* `projects.flatMap((project) => project.diagnostics)`.
|
|
128
|
+
*/
|
|
129
|
+
diagnostics: Diagnostic[];
|
|
130
|
+
summary: JsonReportSummary;
|
|
131
|
+
elapsedMilliseconds: number;
|
|
132
|
+
error: JsonReportError | null;
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/utils/build-json-report.d.ts
|
|
136
|
+
interface BuildJsonReportInput {
|
|
137
|
+
version: string;
|
|
138
|
+
directory: string;
|
|
139
|
+
mode: JsonReportMode;
|
|
140
|
+
diff: DiffInfo | null;
|
|
141
|
+
scans: Array<{
|
|
142
|
+
directory: string;
|
|
143
|
+
result: ScanResult;
|
|
144
|
+
}>;
|
|
145
|
+
totalElapsedMilliseconds: number;
|
|
146
|
+
}
|
|
147
|
+
declare const buildJsonReport: (input: BuildJsonReportInput) => JsonReport;
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/utils/build-json-report-error.d.ts
|
|
150
|
+
interface BuildJsonReportErrorInput {
|
|
151
|
+
version: string;
|
|
152
|
+
directory: string;
|
|
153
|
+
error: unknown;
|
|
154
|
+
elapsedMilliseconds: number;
|
|
155
|
+
mode?: JsonReportMode;
|
|
156
|
+
}
|
|
157
|
+
declare const buildJsonReportError: (input: BuildJsonReportErrorInput) => JsonReport;
|
|
50
158
|
//#endregion
|
|
51
159
|
//#region src/utils/get-diff-files.d.ts
|
|
52
160
|
declare const getDiffInfo: (directory: string, explicitBaseBranch?: string) => DiffInfo | null;
|
|
53
161
|
declare const filterSourceFiles: (filePaths: string[]) => string[];
|
|
54
162
|
//#endregion
|
|
163
|
+
//#region src/utils/summarize-diagnostics.d.ts
|
|
164
|
+
declare const summarizeDiagnostics: (diagnostics: Diagnostic[], worstScore?: number | null, worstScoreLabel?: string | null) => JsonReportSummary;
|
|
165
|
+
//#endregion
|
|
55
166
|
//#region src/index.d.ts
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
interface DiagnoseResult {
|
|
62
|
-
diagnostics: Diagnostic[];
|
|
63
|
-
score: ScoreResult | null;
|
|
64
|
-
project: ProjectInfo;
|
|
65
|
-
elapsedMilliseconds: number;
|
|
167
|
+
declare const clearCaches: () => void;
|
|
168
|
+
interface ToJsonReportOptions {
|
|
169
|
+
version: string;
|
|
170
|
+
directory?: string;
|
|
171
|
+
mode?: JsonReportMode;
|
|
66
172
|
}
|
|
173
|
+
declare const toJsonReport: (result: DiagnoseResult, options: ToJsonReportOptions) => JsonReport;
|
|
67
174
|
declare const diagnose: (directory: string, options?: DiagnoseOptions) => Promise<DiagnoseResult>;
|
|
68
175
|
//#endregion
|
|
69
|
-
export { DiagnoseOptions, DiagnoseResult, type Diagnostic, type DiffInfo, type ProjectInfo, type ReactDoctorConfig, type ScoreResult, diagnose, filterSourceFiles, getDiffInfo };
|
|
176
|
+
export { type DiagnoseOptions, type DiagnoseResult, type Diagnostic, type DiffInfo, type JsonReport, type JsonReportDiffInfo, type JsonReportError, type JsonReportMode, type JsonReportProjectEntry, type JsonReportSummary, type ProjectInfo, type ReactDoctorConfig, type ScoreResult, buildJsonReport, buildJsonReportError, clearCaches, diagnose, filterSourceFiles, getDiffInfo, summarizeDiagnostics, toJsonReport };
|
|
70
177
|
//# sourceMappingURL=index.d.ts.map
|