@eslint-react/core 2.7.0 → 2.7.1-beta.1

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 +6 -4
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -789,10 +789,12 @@ function isFunctionOfRenderMethod(node) {
789
789
  * @returns `true` if the function matches an exclusion hint
790
790
  */
791
791
  function shouldExcludeBasedOnHint(node, hint) {
792
- if (hint & ComponentDetectionHint.SkipObjectMethod && isMatching(FUNCTION_PATTERNS.OBJECT_METHOD)(node)) return true;
793
- if (hint & ComponentDetectionHint.SkipClassMethod && isMatching(FUNCTION_PATTERNS.CLASS_METHOD)(node)) return true;
794
- if (hint & ComponentDetectionHint.SkipClassProperty && isMatching(FUNCTION_PATTERNS.CLASS_PROPERTY)(node)) return true;
795
- if (hint & ComponentDetectionHint.SkipArrayMapCallback && AST.isArrayMapCall(node.parent)) return true;
792
+ switch (true) {
793
+ case hint & ComponentDetectionHint.SkipObjectMethod && isMatching(FUNCTION_PATTERNS.OBJECT_METHOD)(node): return true;
794
+ case hint & ComponentDetectionHint.SkipClassMethod && isMatching(FUNCTION_PATTERNS.CLASS_METHOD)(node): return true;
795
+ case hint & ComponentDetectionHint.SkipClassProperty && isMatching(FUNCTION_PATTERNS.CLASS_PROPERTY)(node): return true;
796
+ case hint & ComponentDetectionHint.SkipArrayMapCallback && node.parent.type === AST_NODE_TYPES.CallExpression && node.parent.callee.type === AST_NODE_TYPES.MemberExpression && node.parent.callee.property.type === AST_NODE_TYPES.Identifier && node.parent.callee.property.name === "map": return true;
797
+ }
796
798
  return false;
797
799
  }
798
800
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/core",
3
- "version": "2.7.0",
3
+ "version": "2.7.1-beta.1",
4
4
  "description": "ESLint React's ESLint utility module for static analysis of React core APIs and patterns.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -35,10 +35,10 @@
35
35
  "@typescript-eslint/utils": "^8.53.0",
36
36
  "birecord": "^0.1.1",
37
37
  "ts-pattern": "^5.9.0",
38
- "@eslint-react/ast": "2.7.0",
39
- "@eslint-react/shared": "2.7.0",
40
- "@eslint-react/eff": "2.7.0",
41
- "@eslint-react/var": "2.7.0"
38
+ "@eslint-react/ast": "2.7.1-beta.1",
39
+ "@eslint-react/eff": "2.7.1-beta.1",
40
+ "@eslint-react/shared": "2.7.1-beta.1",
41
+ "@eslint-react/var": "2.7.1-beta.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "tsdown": "^0.20.0-beta.3",