react-doctor 0.0.45 → 0.0.46
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/dist/cli.js +31 -28
- package/dist/index.js +30 -27
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1761,14 +1761,14 @@ const REACT_COMPILER_RULES = {
|
|
|
1761
1761
|
"react-hooks-js/todo": "warn"
|
|
1762
1762
|
};
|
|
1763
1763
|
const resolveReactHooksJsPlugin = (hasReactCompiler, customRulesOnly) => {
|
|
1764
|
-
if (!hasReactCompiler || customRulesOnly) return
|
|
1764
|
+
if (!hasReactCompiler || customRulesOnly) return null;
|
|
1765
1765
|
try {
|
|
1766
|
-
return
|
|
1766
|
+
return {
|
|
1767
1767
|
name: "react-hooks-js",
|
|
1768
1768
|
specifier: esmRequire$1.resolve("eslint-plugin-react-hooks")
|
|
1769
|
-
}
|
|
1769
|
+
};
|
|
1770
1770
|
} catch {
|
|
1771
|
-
return
|
|
1771
|
+
return null;
|
|
1772
1772
|
}
|
|
1773
1773
|
};
|
|
1774
1774
|
const TANSTACK_QUERY_RULES = {
|
|
@@ -1915,29 +1915,32 @@ const ALL_REACT_DOCTOR_RULE_KEYS = new Set([
|
|
|
1915
1915
|
...Object.keys(TANSTACK_START_RULES),
|
|
1916
1916
|
...Object.keys(TANSTACK_QUERY_RULES)
|
|
1917
1917
|
]);
|
|
1918
|
-
const createOxlintConfig = ({ pluginPath, framework, hasReactCompiler, hasTanStackQuery, customRulesOnly = false }) =>
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
}
|
|
1918
|
+
const createOxlintConfig = ({ pluginPath, framework, hasReactCompiler, hasTanStackQuery, customRulesOnly = false }) => {
|
|
1919
|
+
const reactHooksJsPlugin = resolveReactHooksJsPlugin(hasReactCompiler, customRulesOnly);
|
|
1920
|
+
return {
|
|
1921
|
+
categories: {
|
|
1922
|
+
correctness: "off",
|
|
1923
|
+
suspicious: "off",
|
|
1924
|
+
pedantic: "off",
|
|
1925
|
+
perf: "off",
|
|
1926
|
+
restriction: "off",
|
|
1927
|
+
style: "off",
|
|
1928
|
+
nursery: "off"
|
|
1929
|
+
},
|
|
1930
|
+
plugins: customRulesOnly ? [] : ["react", "jsx-a11y"],
|
|
1931
|
+
jsPlugins: reactHooksJsPlugin ? [reactHooksJsPlugin, pluginPath] : [pluginPath],
|
|
1932
|
+
rules: {
|
|
1933
|
+
...customRulesOnly ? {} : BUILTIN_REACT_RULES,
|
|
1934
|
+
...customRulesOnly ? {} : BUILTIN_A11Y_RULES,
|
|
1935
|
+
...reactHooksJsPlugin ? REACT_COMPILER_RULES : {},
|
|
1936
|
+
...GLOBAL_REACT_DOCTOR_RULES,
|
|
1937
|
+
...framework === "nextjs" ? NEXTJS_RULES : {},
|
|
1938
|
+
...framework === "expo" || framework === "react-native" ? REACT_NATIVE_RULES : {},
|
|
1939
|
+
...framework === "tanstack-start" ? TANSTACK_START_RULES : {},
|
|
1940
|
+
...hasTanStackQuery ? TANSTACK_QUERY_RULES : {}
|
|
1941
|
+
}
|
|
1942
|
+
};
|
|
1943
|
+
};
|
|
1941
1944
|
//#endregion
|
|
1942
1945
|
//#region src/utils/neutralize-disable-directives.ts
|
|
1943
1946
|
const DISABLE_DIRECTIVE_PATTERN = /(eslint|oxlint)-disable/;
|
|
@@ -3330,7 +3333,7 @@ const promptProjectSelection = async (workspacePackages, rootDirectory) => {
|
|
|
3330
3333
|
};
|
|
3331
3334
|
//#endregion
|
|
3332
3335
|
//#region src/cli.ts
|
|
3333
|
-
const VERSION = "0.0.
|
|
3336
|
+
const VERSION = "0.0.46";
|
|
3334
3337
|
const VALID_FAIL_ON_LEVELS = new Set([
|
|
3335
3338
|
"error",
|
|
3336
3339
|
"warning",
|
package/dist/index.js
CHANGED
|
@@ -1513,14 +1513,14 @@ const REACT_COMPILER_RULES = {
|
|
|
1513
1513
|
"react-hooks-js/todo": "warn"
|
|
1514
1514
|
};
|
|
1515
1515
|
const resolveReactHooksJsPlugin = (hasReactCompiler, customRulesOnly) => {
|
|
1516
|
-
if (!hasReactCompiler || customRulesOnly) return
|
|
1516
|
+
if (!hasReactCompiler || customRulesOnly) return null;
|
|
1517
1517
|
try {
|
|
1518
|
-
return
|
|
1518
|
+
return {
|
|
1519
1519
|
name: "react-hooks-js",
|
|
1520
1520
|
specifier: esmRequire$1.resolve("eslint-plugin-react-hooks")
|
|
1521
|
-
}
|
|
1521
|
+
};
|
|
1522
1522
|
} catch {
|
|
1523
|
-
return
|
|
1523
|
+
return null;
|
|
1524
1524
|
}
|
|
1525
1525
|
};
|
|
1526
1526
|
const TANSTACK_QUERY_RULES = {
|
|
@@ -1667,29 +1667,32 @@ const ALL_REACT_DOCTOR_RULE_KEYS = new Set([
|
|
|
1667
1667
|
...Object.keys(TANSTACK_START_RULES),
|
|
1668
1668
|
...Object.keys(TANSTACK_QUERY_RULES)
|
|
1669
1669
|
]);
|
|
1670
|
-
const createOxlintConfig = ({ pluginPath, framework, hasReactCompiler, hasTanStackQuery, customRulesOnly = false }) =>
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
}
|
|
1670
|
+
const createOxlintConfig = ({ pluginPath, framework, hasReactCompiler, hasTanStackQuery, customRulesOnly = false }) => {
|
|
1671
|
+
const reactHooksJsPlugin = resolveReactHooksJsPlugin(hasReactCompiler, customRulesOnly);
|
|
1672
|
+
return {
|
|
1673
|
+
categories: {
|
|
1674
|
+
correctness: "off",
|
|
1675
|
+
suspicious: "off",
|
|
1676
|
+
pedantic: "off",
|
|
1677
|
+
perf: "off",
|
|
1678
|
+
restriction: "off",
|
|
1679
|
+
style: "off",
|
|
1680
|
+
nursery: "off"
|
|
1681
|
+
},
|
|
1682
|
+
plugins: customRulesOnly ? [] : ["react", "jsx-a11y"],
|
|
1683
|
+
jsPlugins: reactHooksJsPlugin ? [reactHooksJsPlugin, pluginPath] : [pluginPath],
|
|
1684
|
+
rules: {
|
|
1685
|
+
...customRulesOnly ? {} : BUILTIN_REACT_RULES,
|
|
1686
|
+
...customRulesOnly ? {} : BUILTIN_A11Y_RULES,
|
|
1687
|
+
...reactHooksJsPlugin ? REACT_COMPILER_RULES : {},
|
|
1688
|
+
...GLOBAL_REACT_DOCTOR_RULES,
|
|
1689
|
+
...framework === "nextjs" ? NEXTJS_RULES : {},
|
|
1690
|
+
...framework === "expo" || framework === "react-native" ? REACT_NATIVE_RULES : {},
|
|
1691
|
+
...framework === "tanstack-start" ? TANSTACK_START_RULES : {},
|
|
1692
|
+
...hasTanStackQuery ? TANSTACK_QUERY_RULES : {}
|
|
1693
|
+
}
|
|
1694
|
+
};
|
|
1695
|
+
};
|
|
1693
1696
|
//#endregion
|
|
1694
1697
|
//#region src/utils/neutralize-disable-directives.ts
|
|
1695
1698
|
const DISABLE_DIRECTIVE_PATTERN = /(eslint|oxlint)-disable/;
|
package/package.json
CHANGED