eslint-plugin-react-x 3.0.0-rc.2 → 3.0.0-rc.3
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/index.js +9 -7
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -147,7 +147,7 @@ const rules$7 = {
|
|
|
147
147
|
//#endregion
|
|
148
148
|
//#region package.json
|
|
149
149
|
var name$6 = "eslint-plugin-react-x";
|
|
150
|
-
var version = "3.0.0-rc.
|
|
150
|
+
var version = "3.0.0-rc.3";
|
|
151
151
|
|
|
152
152
|
//#endregion
|
|
153
153
|
//#region src/utils/create-rule.ts
|
|
@@ -380,6 +380,7 @@ var error_boundaries_default = createRule({
|
|
|
380
380
|
});
|
|
381
381
|
function create$62(context) {
|
|
382
382
|
if (!context.sourceCode.text.includes("try")) return {};
|
|
383
|
+
const hint = core.JsxDetectionHint.DoNotIncludeJsxWithNullValue | core.JsxDetectionHint.DoNotIncludeJsxWithNumberValue | core.JsxDetectionHint.DoNotIncludeJsxWithBigIntValue | core.JsxDetectionHint.DoNotIncludeJsxWithStringValue | core.JsxDetectionHint.DoNotIncludeJsxWithBooleanValue | core.JsxDetectionHint.DoNotIncludeJsxWithUndefinedValue | core.JsxDetectionHint.DoNotIncludeJsxWithEmptyArrayValue;
|
|
383
384
|
const { ctx, visitor } = core.useComponentCollector(context);
|
|
384
385
|
const reported = /* @__PURE__ */ new Set();
|
|
385
386
|
return defineRuleListener(visitor, {
|
|
@@ -397,6 +398,7 @@ function create$62(context) {
|
|
|
397
398
|
"Program:exit"(node) {
|
|
398
399
|
for (const { rets } of ctx.getAllComponents(node)) for (const ret of rets) {
|
|
399
400
|
if (ret == null) continue;
|
|
401
|
+
if (!core.isJsxLike(context, ret, hint)) continue;
|
|
400
402
|
const stmt = ast.findParentNode(ret, ast.is(AST_NODE_TYPES.TryStatement));
|
|
401
403
|
if (stmt != null && !reported.has(stmt)) {
|
|
402
404
|
context.report({
|
|
@@ -6752,7 +6754,7 @@ var set_state_in_effect_default = createRule({
|
|
|
6752
6754
|
});
|
|
6753
6755
|
function create$6(context) {
|
|
6754
6756
|
if (!/use\w*Effect/u.test(context.sourceCode.text)) return {};
|
|
6755
|
-
const {
|
|
6757
|
+
const { additionalEffectHooks, additionalStateHooks } = getSettingsFromContext(context);
|
|
6756
6758
|
const functionEntries = [];
|
|
6757
6759
|
const setupFnRef = { current: null };
|
|
6758
6760
|
const setupFnIds = [];
|
|
@@ -7355,8 +7357,8 @@ var unstable_rules_of_props_default = createRule({
|
|
|
7355
7357
|
type: "problem",
|
|
7356
7358
|
docs: { description: "Enforces the Rules of Props." },
|
|
7357
7359
|
messages: {
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
+
noControlledAndUncontrolledTogether: "Prop `{{controlled}}` and `{{uncontrolled}}` should not be used together. Use either controlled or uncontrolled components, not both.",
|
|
7361
|
+
noDuplicateProps: "Prop `{{prop}}` is specified more than once. Only the last one will take effect."
|
|
7360
7362
|
},
|
|
7361
7363
|
schema: []
|
|
7362
7364
|
},
|
|
@@ -7534,11 +7536,11 @@ const plugin = {
|
|
|
7534
7536
|
"rules-of-hooks": rule,
|
|
7535
7537
|
"set-state-in-effect": set_state_in_effect_default,
|
|
7536
7538
|
"set-state-in-render": set_state_in_render_default,
|
|
7539
|
+
"unstable-rules-of-props": unstable_rules_of_props_default,
|
|
7540
|
+
"unstable-rules-of-state": unstable_rules_of_state_default,
|
|
7537
7541
|
"unsupported-syntax": unsupported_syntax_default,
|
|
7538
7542
|
"use-memo": use_memo_default,
|
|
7539
|
-
"use-state": use_state_default
|
|
7540
|
-
"unstable-rules-of-props": unstable_rules_of_props_default,
|
|
7541
|
-
"unstable-rules-of-state": unstable_rules_of_state_default
|
|
7543
|
+
"use-state": use_state_default
|
|
7542
7544
|
}
|
|
7543
7545
|
};
|
|
7544
7546
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.3",
|
|
4
4
|
"description": "A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"string-ts": "^2.3.1",
|
|
46
46
|
"ts-api-utils": "^2.4.0",
|
|
47
47
|
"ts-pattern": "^5.9.0",
|
|
48
|
-
"@eslint-react/
|
|
49
|
-
"@eslint-react/
|
|
50
|
-
"@eslint-react/
|
|
51
|
-
"@eslint-react/
|
|
48
|
+
"@eslint-react/ast": "3.0.0-rc.3",
|
|
49
|
+
"@eslint-react/core": "3.0.0-rc.3",
|
|
50
|
+
"@eslint-react/shared": "3.0.0-rc.3",
|
|
51
|
+
"@eslint-react/var": "3.0.0-rc.3"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/react": "^19.2.14",
|