@eslint-react/core 5.30.0-beta.9 → 5.30.0-rc.0
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.d.ts +2 -1
- package/dist/index.js +3 -3
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -456,7 +456,8 @@ export declare function isHookName(name: string): boolean;
|
|
|
456
456
|
/**
|
|
457
457
|
* Checks if the given node is a hook identifier.
|
|
458
458
|
* @param id The AST node to check.
|
|
459
|
-
* @returns `true` if the node is a hook identifier or member expression with hook name
|
|
459
|
+
* @returns `true` if the node is a hook identifier or a non-computed member expression with a hook name
|
|
460
|
+
* (ex: `useState`, `React.useState`); computed member expressions (ex: `React["useState"]`) do not match.
|
|
460
461
|
*/
|
|
461
462
|
export declare function isHookId(id: TSESTree.Node): id is TSESTree.Identifier | TSESTree.MemberExpression;
|
|
462
463
|
/**
|
package/dist/index.js
CHANGED
|
@@ -254,7 +254,7 @@ const isGetDefaultProps = createLifecycleChecker("getDefaultProps", true);
|
|
|
254
254
|
const isGetDerivedStateFromProps = createLifecycleChecker("getDerivedStateFromProps", true);
|
|
255
255
|
const isGetDerivedStateFromError = createLifecycleChecker("getDerivedStateFromError", true);
|
|
256
256
|
function isRenderMethodLike(node) {
|
|
257
|
-
return Check.isPropertyOrMethod(node) &&
|
|
257
|
+
return Check.isPropertyOrMethod(node) && !node.computed && getStaticKeyName(node.key, node.computed)?.startsWith("render") === true && Check.isClass(node.parent.parent);
|
|
258
258
|
}
|
|
259
259
|
function isRenderMethodCallback(node) {
|
|
260
260
|
let parent = node.parent;
|
|
@@ -848,7 +848,7 @@ const isFalsyStringType = (type) => type.isStringLiteral() && type.value === "";
|
|
|
848
848
|
const isNeverType = (type) => isTypeFlagSet(type, ts.TypeFlags.Never);
|
|
849
849
|
const isNullishType = (type) => isTypeFlagSet(type, ts.TypeFlags.Null | ts.TypeFlags.Undefined | ts.TypeFlags.VoidLike);
|
|
850
850
|
const isNumberType = (type) => isTypeFlagSet(type, ts.TypeFlags.NumberLike);
|
|
851
|
-
const isObjectType = (type) => !isTypeFlagSet(type, ts.TypeFlags.Null | ts.TypeFlags.Undefined | ts.TypeFlags.VoidLike | ts.TypeFlags.BooleanLike | ts.TypeFlags.StringLike | ts.TypeFlags.NumberLike | ts.TypeFlags.BigIntLike | ts.TypeFlags.TypeParameter | ts.TypeFlags.Any | ts.TypeFlags.Unknown | ts.TypeFlags.Never);
|
|
851
|
+
const isObjectType = (type) => !isTypeFlagSet(type, ts.TypeFlags.Null | ts.TypeFlags.Undefined | ts.TypeFlags.VoidLike | ts.TypeFlags.BooleanLike | ts.TypeFlags.StringLike | ts.TypeFlags.NumberLike | ts.TypeFlags.BigIntLike | ts.TypeFlags.ESSymbolLike | ts.TypeFlags.TypeParameter | ts.TypeFlags.Any | ts.TypeFlags.Unknown | ts.TypeFlags.Never);
|
|
852
852
|
const isStringType = (type) => isTypeFlagSet(type, ts.TypeFlags.StringLike);
|
|
853
853
|
const isTruthyBigIntType = (type) => type.isLiteral() && isMatching({ value: { base10Value: P.not("0") } }, type);
|
|
854
854
|
const isTruthyNumberType = (type) => type.isNumberLiteral() && type.value !== 0;
|
|
@@ -895,7 +895,7 @@ function getFullyQualifiedNameEx(checker, symbol) {
|
|
|
895
895
|
}
|
|
896
896
|
const namespace = parent.getSourceFile().statements.find((n) => ts.isNamespaceExportDeclaration(n))?.name.text;
|
|
897
897
|
if (namespace == null) return name;
|
|
898
|
-
if (name.startsWith(`${namespace}.`)) return name;
|
|
898
|
+
if (name === namespace || name.startsWith(`${namespace}.`)) return name;
|
|
899
899
|
return `${namespace}.${name}`;
|
|
900
900
|
}
|
|
901
901
|
// src/type-variant.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "5.30.0-
|
|
3
|
+
"version": "5.30.0-rc.0",
|
|
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": {
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@eslint-react/ast": "5.30.0-
|
|
33
|
-
"@eslint-react/eslint": "5.30.0-
|
|
34
|
-
"@eslint-react/jsx": "5.30.0-
|
|
35
|
-
"@eslint-react/shared": "5.30.0-
|
|
36
|
-
"@eslint-react/var": "5.30.0-
|
|
32
|
+
"@eslint-react/ast": "5.30.0-rc.0",
|
|
33
|
+
"@eslint-react/eslint": "5.30.0-rc.0",
|
|
34
|
+
"@eslint-react/jsx": "5.30.0-rc.0",
|
|
35
|
+
"@eslint-react/shared": "5.30.0-rc.0",
|
|
36
|
+
"@eslint-react/var": "5.30.0-rc.0",
|
|
37
37
|
"@typescript-eslint/types": "^8.72.1",
|
|
38
38
|
"@typescript-eslint/utils": "^8.72.1",
|
|
39
39
|
"ts-pattern": "^5.9.2"
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"@tsconfig/node20": "^20.1.10",
|
|
46
46
|
"@types/node": "^20.19.43",
|
|
47
47
|
"dedent": "^1.7.2",
|
|
48
|
-
"eslint": "^10.
|
|
49
|
-
"tsdown": "^0.23.
|
|
48
|
+
"eslint": "^10.14.0",
|
|
49
|
+
"tsdown": "^0.23.5",
|
|
50
50
|
"typescript": "6.0.3",
|
|
51
|
-
"vitest": "^5.0
|
|
51
|
+
"vitest": "^5.1.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"eslint": "*",
|