eslint-plugin-react-x 5.11.0 → 5.11.2

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 +8 -8
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DEFAULT_ESLINT_REACT_SETTINGS, getSettingsFromContext, toRegExp } from "@eslint-react/shared";
2
2
  import { ESLintUtils } from "@typescript-eslint/utils";
3
- import { Check, Compare, Extract, Traverse, is, isOneOf } from "@eslint-react/ast";
3
+ import { Check, Compare, Extract, Traverse } from "@eslint-react/ast";
4
4
  import * as core from "@eslint-react/core";
5
5
  import { merge } from "@eslint-react/eslint";
6
6
  import { JsxDetectionHint, findParentAttribute, getElementFullType, hasAttribute } from "@eslint-react/jsx";
@@ -144,7 +144,7 @@ const rules$6 = {
144
144
  //#endregion
145
145
  //#region package.json
146
146
  var name$6 = "eslint-plugin-react-x";
147
- var version = "5.11.0";
147
+ var version = "5.11.2";
148
148
 
149
149
  //#endregion
150
150
  //#region src/utils/create-rule.ts
@@ -1830,7 +1830,7 @@ function isArrayIndexReference(context, node) {
1830
1830
  const def = findVariable(context.sourceCode.getScope(node), node)?.defs.at(0);
1831
1831
  if (def == null || def.type !== DefinitionType.Parameter) return false;
1832
1832
  const callback = def.node;
1833
- if (!isOneOf([AST_NODE_TYPES.ArrowFunctionExpression, AST_NODE_TYPES.FunctionExpression])(callback)) return false;
1833
+ if (!Check.isOneOf([AST_NODE_TYPES.ArrowFunctionExpression, AST_NODE_TYPES.FunctionExpression])(callback)) return false;
1834
1834
  let argument = callback;
1835
1835
  while (Check.isTypeExpression(argument.parent)) argument = argument.parent;
1836
1836
  const call = argument.parent;
@@ -2302,7 +2302,7 @@ function create$34(context) {
2302
2302
  //#region src/rules/no-direct-mutation-state/no-direct-mutation-state.ts
2303
2303
  const RULE_NAME$33 = "no-direct-mutation-state";
2304
2304
  function isConstructorFunction(node) {
2305
- return isOneOf([AST_NODE_TYPES.FunctionDeclaration, AST_NODE_TYPES.FunctionExpression])(node) && Check.isPropertyOrMethod(node.parent) && node.parent.key.type === AST_NODE_TYPES.Identifier && node.parent.key.name === "constructor";
2305
+ return Check.isOneOf([AST_NODE_TYPES.FunctionDeclaration, AST_NODE_TYPES.FunctionExpression])(node) && Check.isPropertyOrMethod(node.parent) && node.parent.key.type === AST_NODE_TYPES.Identifier && node.parent.key.name === "constructor";
2306
2306
  }
2307
2307
  var no_direct_mutation_state_default = createRule({
2308
2308
  meta: {
@@ -2318,7 +2318,7 @@ var no_direct_mutation_state_default = createRule({
2318
2318
  function create$33(context) {
2319
2319
  return { AssignmentExpression(node) {
2320
2320
  if (!core.isAssignmentToThisState(node)) return;
2321
- const parentClass = Traverse.findParent(node, isOneOf([AST_NODE_TYPES.ClassDeclaration, AST_NODE_TYPES.ClassExpression]));
2321
+ const parentClass = Traverse.findParent(node, Check.isOneOf([AST_NODE_TYPES.ClassDeclaration, AST_NODE_TYPES.ClassExpression]));
2322
2322
  if (parentClass == null) return;
2323
2323
  if (core.isClassComponent(parentClass) && context.sourceCode.getScope(node).block !== Traverse.findParent(node, isConstructorFunction)) context.report({
2324
2324
  messageId: "default",
@@ -2683,7 +2683,7 @@ function create$27(context) {
2683
2683
  */
2684
2684
  function getReportDescriptor(node, visited = /* @__PURE__ */ new Set()) {
2685
2685
  if (node == null) return null;
2686
- if (is(AST_NODE_TYPES.JSXExpressionContainer)(node)) return getReportDescriptor(node.expression, visited);
2686
+ if (Check.is(AST_NODE_TYPES.JSXExpressionContainer)(node)) return getReportDescriptor(node.expression, visited);
2687
2687
  if (Check.isJSX(node)) return null;
2688
2688
  if (Check.isTypeExpression(node)) return getReportDescriptor(node.expression, visited);
2689
2689
  return match(node).with({
@@ -3050,7 +3050,7 @@ function isInsideRenderMethod(node) {
3050
3050
  function isInsideCreateElementProps(context, node) {
3051
3051
  const call = Traverse.findParent(node, core.isCreateElementCall(context));
3052
3052
  if (call == null) return false;
3053
- const prop = Traverse.findParent(node, is(AST_NODE_TYPES.ObjectExpression));
3053
+ const prop = Traverse.findParent(node, Check.is(AST_NODE_TYPES.ObjectExpression));
3054
3054
  if (prop == null) return false;
3055
3055
  return prop === call.arguments[1];
3056
3056
  }
@@ -7632,7 +7632,7 @@ const LAZY_INIT_ALLOW_LIST = [
7632
7632
  * node, and it will return an array of all nested expressions of type AST.
7633
7633
  */
7634
7634
  function getNestedExpressionsOfType(type) {
7635
- const isNodeOfType = is(type);
7635
+ const isNodeOfType = Check.is(type);
7636
7636
  const recurse = (node) => {
7637
7637
  const expressions = [];
7638
7638
  if (isNodeOfType(node)) expressions.push(node);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "5.11.0",
3
+ "version": "5.11.2",
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,12 +45,12 @@
45
45
  "string-ts": "^2.3.1",
46
46
  "ts-api-utils": "^2.5.0",
47
47
  "ts-pattern": "^5.9.0",
48
- "@eslint-react/core": "5.11.0",
49
- "@eslint-react/ast": "5.11.0",
50
- "@eslint-react/jsx": "5.11.0",
51
- "@eslint-react/shared": "5.11.0",
52
- "@eslint-react/eslint": "5.11.0",
53
- "@eslint-react/var": "5.11.0"
48
+ "@eslint-react/jsx": "5.11.2",
49
+ "@eslint-react/shared": "5.11.2",
50
+ "@eslint-react/var": "5.11.2",
51
+ "@eslint-react/eslint": "5.11.2",
52
+ "@eslint-react/core": "5.11.2",
53
+ "@eslint-react/ast": "5.11.2"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/react": "^19.2.17",