eslint-plugin-react-x 2.8.1-next.2 → 2.8.1-next.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.
Files changed (2) hide show
  1. package/dist/index.js +5 -2
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -68,7 +68,7 @@ const rules$7 = {
68
68
  //#endregion
69
69
  //#region package.json
70
70
  var name$6 = "eslint-plugin-react-x";
71
- var version = "2.8.1-next.2";
71
+ var version = "2.8.1-next.3";
72
72
 
73
73
  //#endregion
74
74
  //#region src/utils/create-rule.ts
@@ -2459,6 +2459,7 @@ var no_unstable_context_value_default = createRule({
2459
2459
  defaultOptions: []
2460
2460
  });
2461
2461
  function create$12(context) {
2462
+ if (AST.getProgramDirectives(context.sourceCode.ast).some((d) => d.value === "use memo")) return {};
2462
2463
  const { version } = getSettingsFromContext(context);
2463
2464
  const isReact18OrBelow = compare(version, "19.0.0", "<");
2464
2465
  const { ctx, visitor } = useComponentCollector(context);
@@ -2481,7 +2482,8 @@ function create$12(context) {
2481
2482
  getOrElseUpdate(constructions, functionEntry.node, () => []).push(construction);
2482
2483
  },
2483
2484
  "Program:exit"(program) {
2484
- for (const { node: component } of ctx.getAllComponents(program)) for (const construction of constructions.get(component) ?? []) {
2485
+ for (const { node: component, directives } of ctx.getAllComponents(program)) for (const construction of constructions.get(component) ?? []) {
2486
+ if (directives.some((d) => d.value === "use memo")) return;
2485
2487
  const { kind, node: constructionNode } = construction;
2486
2488
  const suggestion = kind === "function" ? "Consider wrapping it in a useCallback hook." : "Consider wrapping it in a useMemo hook.";
2487
2489
  context.report({
@@ -2534,6 +2536,7 @@ function extractIdentifier(node) {
2534
2536
  return null;
2535
2537
  }
2536
2538
  function create$11(context, [options]) {
2539
+ if (AST.getProgramDirectives(context.sourceCode.ast).some((d) => d.value === "use memo")) return {};
2537
2540
  const { ctx, visitor } = useComponentCollector(context);
2538
2541
  const declarators = /* @__PURE__ */ new WeakMap();
2539
2542
  const { safeDefaultProps = [] } = options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "2.8.1-next.2",
3
+ "version": "2.8.1-next.3",
4
4
  "description": "A set of composable ESLint rules for for libraries and frameworks that use React as a UI runtime.",
5
5
  "keywords": [
6
6
  "react",
@@ -46,11 +46,11 @@
46
46
  "string-ts": "^2.3.1",
47
47
  "ts-api-utils": "^2.4.0",
48
48
  "ts-pattern": "^5.9.0",
49
- "@eslint-react/ast": "2.8.1-next.2",
50
- "@eslint-react/core": "2.8.1-next.2",
51
- "@eslint-react/eff": "2.8.1-next.2",
52
- "@eslint-react/shared": "2.8.1-next.2",
53
- "@eslint-react/var": "2.8.1-next.2"
49
+ "@eslint-react/ast": "2.8.1-next.3",
50
+ "@eslint-react/var": "2.8.1-next.3",
51
+ "@eslint-react/core": "2.8.1-next.3",
52
+ "@eslint-react/shared": "2.8.1-next.3",
53
+ "@eslint-react/eff": "2.8.1-next.3"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/react": "^19.2.10",