react-doctor 0.1.6 → 0.2.0-beta.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.
@@ -0,0 +1,53 @@
1
+ import { b as isReactDoctorError, c as ReactDoctorError, f as ReactDoctorNoReactDependencyError, h as ReactDoctorProjectNotFoundError, p as ReactDoctorPackageJsonNotFoundError, t as ReactDoctorAmbiguousProjectError } from "./errors-ZdckckLr.js";
2
+
3
+ //#region src/sdk/compat.d.ts
4
+ interface Diagnostic {
5
+ filePath: string;
6
+ plugin: string;
7
+ rule: string;
8
+ severity: "error" | "warning";
9
+ message: string;
10
+ help: string;
11
+ url?: string;
12
+ line: number;
13
+ column: number;
14
+ category: string;
15
+ suppressionHint?: string;
16
+ }
17
+ interface ScoreResult {
18
+ score: number;
19
+ label: string;
20
+ }
21
+ interface ProjectInfo {
22
+ rootDirectory: string;
23
+ projectName: string;
24
+ reactVersion: string | null;
25
+ tailwindVersion: string | null;
26
+ framework: string;
27
+ hasTypeScript: boolean;
28
+ hasReactCompiler: boolean;
29
+ hasTanStackQuery: boolean;
30
+ sourceFileCount: number;
31
+ }
32
+ interface DiagnoseOptions {
33
+ lint?: boolean;
34
+ deadCode?: boolean;
35
+ verbose?: boolean;
36
+ includePaths?: string[];
37
+ respectInlineDisables?: boolean;
38
+ signal?: AbortSignal;
39
+ }
40
+ interface DiagnoseResult {
41
+ diagnostics: Diagnostic[];
42
+ score: ScoreResult | null;
43
+ project: ProjectInfo;
44
+ elapsedMilliseconds: number;
45
+ }
46
+ /**
47
+ * @deprecated Use `createReactDoctor({ rootDirectory }).inspect()` from the main SDK instead.
48
+ */
49
+ declare const diagnose: (directory: string, options?: DiagnoseOptions) => Promise<DiagnoseResult>;
50
+ declare const clearCaches: () => void;
51
+ //#endregion
52
+ export { ReactDoctorAmbiguousProjectError as AmbiguousProjectError, DiagnoseOptions, DiagnoseResult, Diagnostic, ReactDoctorNoReactDependencyError as NoReactDependencyError, ReactDoctorPackageJsonNotFoundError as PackageJsonNotFoundError, ProjectInfo, ReactDoctorProjectNotFoundError as ProjectNotFoundError, ReactDoctorError, ScoreResult, clearCaches, diagnose, isReactDoctorError };
53
+ //# sourceMappingURL=compat.d.ts.map
package/dist/compat.js ADDED
@@ -0,0 +1,3 @@
1
+ import { E as ReactDoctorError, I as isReactDoctorError, O as ReactDoctorNoReactDependencyError, j as ReactDoctorProjectNotFoundError, k as ReactDoctorPackageJsonNotFoundError, y as ReactDoctorAmbiguousProjectError } from "./rules-BfZ4Ujfv.js";
2
+ import { n as diagnose, t as clearCaches } from "./compat-CM6aj69a.js";
3
+ export { ReactDoctorAmbiguousProjectError as AmbiguousProjectError, ReactDoctorNoReactDependencyError as NoReactDependencyError, ReactDoctorPackageJsonNotFoundError as PackageJsonNotFoundError, ReactDoctorProjectNotFoundError as ProjectNotFoundError, ReactDoctorError, clearCaches, diagnose, isReactDoctorError };
@@ -0,0 +1,87 @@
1
+ //#region src/core/errors.d.ts
2
+ interface ReactDoctorErrorInfo {
3
+ name: string;
4
+ message: string;
5
+ code: string;
6
+ cause?: ReactDoctorErrorInfo;
7
+ }
8
+ interface ReactDoctorErrorOptions extends ErrorOptions {
9
+ code?: string;
10
+ }
11
+ declare class ReactDoctorError extends Error {
12
+ readonly name: string;
13
+ readonly code: string;
14
+ constructor(message: string, options?: ReactDoctorErrorOptions);
15
+ }
16
+ declare class ReactDoctorCancelledError extends ReactDoctorError {
17
+ readonly name: string;
18
+ constructor(message?: string, options?: ErrorOptions);
19
+ }
20
+ declare class ReactDoctorConfigError extends ReactDoctorError {
21
+ readonly name: string;
22
+ constructor(message: string, options?: ReactDoctorErrorOptions);
23
+ }
24
+ declare class ReactDoctorConfigNotFoundError extends ReactDoctorConfigError {
25
+ readonly name: string;
26
+ constructor(message?: string, options?: ErrorOptions);
27
+ }
28
+ declare class ReactDoctorInvalidConfigError extends ReactDoctorConfigError {
29
+ readonly name: string;
30
+ constructor(message: string, options?: ErrorOptions);
31
+ }
32
+ declare class ReactDoctorProjectError extends ReactDoctorError {
33
+ readonly name: string;
34
+ readonly rootDirectory: string;
35
+ constructor(rootDirectory: string, message: string, options?: ReactDoctorErrorOptions);
36
+ }
37
+ declare class ReactDoctorProjectNotFoundError extends ReactDoctorProjectError {
38
+ readonly name: string;
39
+ constructor(rootDirectory: string, options?: ErrorOptions);
40
+ }
41
+ declare class ReactDoctorPackageJsonNotFoundError extends ReactDoctorProjectError {
42
+ readonly name: string;
43
+ constructor(rootDirectory: string, options?: ErrorOptions);
44
+ }
45
+ declare class ReactDoctorNoReactDependencyError extends ReactDoctorProjectError {
46
+ readonly name: string;
47
+ constructor(rootDirectory: string, options?: ErrorOptions);
48
+ }
49
+ declare class ReactDoctorAmbiguousProjectError extends ReactDoctorProjectError {
50
+ readonly name: string;
51
+ readonly candidates: readonly string[];
52
+ constructor(rootDirectory: string, candidates: readonly string[], options?: ErrorOptions);
53
+ }
54
+ declare class ReactDoctorCheckError extends ReactDoctorError {
55
+ readonly name: string;
56
+ readonly checkId: string;
57
+ constructor(checkId: string, message: string, options?: ReactDoctorErrorOptions);
58
+ }
59
+ declare class ReactDoctorCheckFailedError extends ReactDoctorCheckError {
60
+ readonly name: string;
61
+ constructor(checkId: string, message: string, options?: ErrorOptions);
62
+ }
63
+ declare class ReactDoctorCheckSkippedError extends ReactDoctorCheckError {
64
+ readonly name: string;
65
+ constructor(checkId: string, message: string, options?: ErrorOptions);
66
+ }
67
+ declare class ReactDoctorRunnerUnavailableError extends ReactDoctorCheckError {
68
+ readonly name: string;
69
+ constructor(checkId: string, message: string, options?: ErrorOptions);
70
+ }
71
+ declare class ReactDoctorUnsupportedRuntimeError extends ReactDoctorError {
72
+ readonly name: string;
73
+ constructor(message: string, options?: ErrorOptions);
74
+ }
75
+ declare class ReactDoctorTimeoutError extends ReactDoctorError {
76
+ readonly name: string;
77
+ constructor(message: string, options?: ErrorOptions);
78
+ }
79
+ declare class ReactDoctorReportError extends ReactDoctorError {
80
+ readonly name: string;
81
+ constructor(message: string, options?: ErrorOptions);
82
+ }
83
+ declare const isReactDoctorError: (value: unknown) => value is ReactDoctorError;
84
+ declare const toReactDoctorErrorInfo: (error: unknown) => ReactDoctorErrorInfo;
85
+ //#endregion
86
+ export { ReactDoctorRunnerUnavailableError as _, ReactDoctorCheckSkippedError as a, isReactDoctorError as b, ReactDoctorError as c, ReactDoctorInvalidConfigError as d, ReactDoctorNoReactDependencyError as f, ReactDoctorReportError as g, ReactDoctorProjectNotFoundError as h, ReactDoctorCheckFailedError as i, ReactDoctorErrorInfo as l, ReactDoctorProjectError as m, ReactDoctorCancelledError as n, ReactDoctorConfigError as o, ReactDoctorPackageJsonNotFoundError as p, ReactDoctorCheckError as r, ReactDoctorConfigNotFoundError as s, ReactDoctorAmbiguousProjectError as t, ReactDoctorErrorOptions as u, ReactDoctorTimeoutError as v, toReactDoctorErrorInfo as x, ReactDoctorUnsupportedRuntimeError as y };
87
+ //# sourceMappingURL=errors-ZdckckLr.d.ts.map
@@ -0,0 +1,105 @@
1
+ import { a as RuleContext, i as RuleVisitors } from "./index-CFzh1cBi.js";
2
+
3
+ //#region src/core/rules/lint/config.d.ts
4
+ interface OxlintRuleSeverityMap {
5
+ [ruleKey: string]: "error" | "warn" | "off";
6
+ }
7
+ declare const REACT_COMPILER_OXLINT_RULES: OxlintRuleSeverityMap;
8
+ declare const BUILTIN_REACT_OXLINT_RULES: OxlintRuleSeverityMap;
9
+ declare const BUILTIN_A11Y_OXLINT_RULES: OxlintRuleSeverityMap;
10
+ declare const BUILTIN_OXLINT_RULES: OxlintRuleSeverityMap;
11
+ declare const NEXTJS_OXLINT_RULES: OxlintRuleSeverityMap;
12
+ declare const REACT_NATIVE_OXLINT_RULES: OxlintRuleSeverityMap;
13
+ declare const TANSTACK_START_OXLINT_RULES: OxlintRuleSeverityMap;
14
+ declare const TANSTACK_QUERY_OXLINT_RULES: OxlintRuleSeverityMap;
15
+ declare const GLOBAL_REACT_DOCTOR_OXLINT_RULES: OxlintRuleSeverityMap;
16
+ declare const REACT_DOCTOR_CUSTOM_OXLINT_RULES: OxlintRuleSeverityMap;
17
+ declare const CURATED_OXLINT_RULES: OxlintRuleSeverityMap;
18
+ declare const ALL_REACT_DOCTOR_OXLINT_RULE_KEYS: ReadonlySet<string>;
19
+ type ReactDoctorOxlintFramework = "expo" | "nextjs" | "react" | "react-native" | "tanstack-start" | "unknown";
20
+ interface ReactDoctorOxlintConfigOptions {
21
+ pluginPath: string;
22
+ projectRootDirectory?: string;
23
+ project?: ReactDoctorOxlintProjectInfo;
24
+ framework?: ReactDoctorOxlintFramework;
25
+ customRulesOnly?: boolean;
26
+ hasReactCompiler?: boolean;
27
+ hasTanStackAI?: boolean;
28
+ hasTanStackQuery?: boolean;
29
+ includeEcosystemRules?: boolean;
30
+ extendsPaths?: string[];
31
+ ignoredTags?: ReadonlySet<string>;
32
+ }
33
+ interface ReactDoctorOxlintProjectInfo {
34
+ framework?: ReactDoctorOxlintFramework;
35
+ hasReactCompiler?: boolean;
36
+ hasTanStackAI?: boolean;
37
+ hasTanStackQuery?: boolean;
38
+ hasTypeScript?: boolean;
39
+ reactMajorVersion?: number | null;
40
+ reactPeerDependencyRange?: string | null;
41
+ tailwindVersion?: string | null;
42
+ }
43
+ interface ReactDoctorOxlintJsPluginEntry {
44
+ name: string;
45
+ specifier: string;
46
+ }
47
+ interface ReactDoctorOxlintGeneratedConfig {
48
+ extends?: string[];
49
+ categories: Record<string, "off">;
50
+ plugins: string[];
51
+ jsPlugins: Array<string | ReactDoctorOxlintJsPluginEntry>;
52
+ rules: OxlintRuleSeverityMap;
53
+ }
54
+ declare const reactPeerRangeMinMajor: (range: string | null | undefined) => number | null;
55
+ declare const buildReactDoctorOxlintCapabilities: (project: ReactDoctorOxlintProjectInfo) => ReadonlySet<string>;
56
+ declare const shouldEnableReactDoctorOxlintRule: (requires: ReadonlyArray<string> | undefined, tags: ReadonlySet<string>, capabilities: ReadonlySet<string>, ignoredTags: ReadonlySet<string>) => boolean;
57
+ declare const createReactDoctorOxlintConfig: ({
58
+ pluginPath,
59
+ projectRootDirectory,
60
+ project,
61
+ framework,
62
+ customRulesOnly,
63
+ hasReactCompiler,
64
+ hasTanStackAI,
65
+ hasTanStackQuery,
66
+ includeEcosystemRules,
67
+ extendsPaths,
68
+ ignoredTags
69
+ }: ReactDoctorOxlintConfigOptions) => ReactDoctorOxlintGeneratedConfig;
70
+ //#endregion
71
+ //#region src/eslint-plugin.d.ts
72
+ interface EslintRuleDefinition {
73
+ meta: {
74
+ docs: {
75
+ description: string;
76
+ recommended: boolean;
77
+ };
78
+ type: "problem" | "suggestion";
79
+ };
80
+ create: (context: RuleContext) => RuleVisitors;
81
+ }
82
+ interface EslintPlugin {
83
+ meta: {
84
+ name: string;
85
+ version: string;
86
+ };
87
+ rules: Record<string, EslintRuleDefinition>;
88
+ configs: {
89
+ recommended: EslintFlatConfig;
90
+ next: EslintFlatConfig;
91
+ "react-native": EslintFlatConfig;
92
+ "tanstack-start": EslintFlatConfig;
93
+ "tanstack-query": EslintFlatConfig;
94
+ all: EslintFlatConfig;
95
+ };
96
+ }
97
+ interface EslintFlatConfig {
98
+ name: string;
99
+ plugins: Record<string, EslintPlugin>;
100
+ rules: OxlintRuleSeverityMap;
101
+ }
102
+ declare const reactDoctorEslintPlugin: EslintPlugin;
103
+ //#endregion
104
+ export { shouldEnableReactDoctorOxlintRule as C, reactPeerRangeMinMajor as S, ReactDoctorOxlintProjectInfo as _, BUILTIN_REACT_OXLINT_RULES as a, buildReactDoctorOxlintCapabilities as b, NEXTJS_OXLINT_RULES as c, REACT_DOCTOR_CUSTOM_OXLINT_RULES as d, REACT_NATIVE_OXLINT_RULES as f, ReactDoctorOxlintJsPluginEntry as g, ReactDoctorOxlintGeneratedConfig as h, BUILTIN_OXLINT_RULES as i, OxlintRuleSeverityMap as l, ReactDoctorOxlintFramework as m, ALL_REACT_DOCTOR_OXLINT_RULE_KEYS as n, CURATED_OXLINT_RULES as o, ReactDoctorOxlintConfigOptions as p, BUILTIN_A11Y_OXLINT_RULES as r, GLOBAL_REACT_DOCTOR_OXLINT_RULES as s, reactDoctorEslintPlugin as t, REACT_COMPILER_OXLINT_RULES as u, TANSTACK_QUERY_OXLINT_RULES as v, createReactDoctorOxlintConfig as x, TANSTACK_START_OXLINT_RULES as y };
105
+ //# sourceMappingURL=eslint-plugin-BIjw2MeW.d.ts.map
@@ -1,57 +1,2 @@
1
- //#region src/oxlint-config.d.ts
2
- type RuleSeverity = "error" | "warn" | "off";
3
- //#endregion
4
- //#region src/plugin/types.d.ts
5
- interface RuleVisitors {
6
- [selector: string]: ((node: EsTreeNode) => void) | (() => void);
7
- }
8
- interface EsTreeNode {
9
- type: string;
10
- [key: string]: any;
11
- }
12
- //#endregion
13
- //#region src/eslint-plugin.d.ts
14
- interface EslintRuleContext {
15
- report: (descriptor: {
16
- node: EsTreeNode;
17
- message: string;
18
- }) => void;
19
- getFilename?: () => string;
20
- }
21
- interface EslintRuleMeta {
22
- type: "problem" | "suggestion" | "layout";
23
- docs: {
24
- description: string;
25
- url: string;
26
- recommended: boolean;
27
- };
28
- schema: unknown[];
29
- }
30
- interface EslintRule {
31
- meta: EslintRuleMeta;
32
- create: (context: EslintRuleContext) => RuleVisitors;
33
- }
34
- interface EslintFlatConfig {
35
- name: string;
36
- plugins: Record<string, EslintPlugin>;
37
- rules: Record<string, RuleSeverity>;
38
- }
39
- interface EslintPlugin {
40
- meta: {
41
- name: string;
42
- version: string;
43
- };
44
- rules: Record<string, EslintRule>;
45
- configs: {
46
- recommended: EslintFlatConfig;
47
- next: EslintFlatConfig;
48
- "react-native": EslintFlatConfig;
49
- "tanstack-start": EslintFlatConfig;
50
- "tanstack-query": EslintFlatConfig;
51
- all: EslintFlatConfig;
52
- };
53
- }
54
- declare const eslintPlugin: EslintPlugin;
55
- //#endregion
56
- export { eslintPlugin as default };
57
- //# sourceMappingURL=eslint-plugin.d.ts.map
1
+ import { t as reactDoctorEslintPlugin } from "./eslint-plugin-BIjw2MeW.js";
2
+ export { reactDoctorEslintPlugin as default, reactDoctorEslintPlugin };