@eslint-react/core 5.30.0-beta.22 → 5.30.0-beta.24
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 +3 -2
- package/dist/index.js +1 -1
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -369,7 +369,7 @@ export type FunctionSemanticNode = ClientFunctionSemanticNode | ServerFunctionSe
|
|
|
369
369
|
* @param node The function node to analyze.
|
|
370
370
|
* @returns The identifier node if found, `null` otherwise.
|
|
371
371
|
*/
|
|
372
|
-
export declare function getFunctionId(node: TSESTree.Expression | TSESTreeFunction): TSESTree.
|
|
372
|
+
export declare function getFunctionId(node: TSESTree.Expression | TSESTreeFunction): TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpressionWithBlockBody | TSESTree.ArrowFunctionExpressionWithExpressionBody | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.PrivateInExpression | TSESTree.SymmetricBinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.ImportExpression | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.PrivateIdentifier | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.TemplateLiteral | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSInstantiationExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion | TSESTree.UnaryExpressionBitwiseNot | TSESTree.UnaryExpressionDelete | TSESTree.UnaryExpressionMinus | TSESTree.UnaryExpressionNot | TSESTree.UnaryExpressionPlus | TSESTree.UnaryExpressionTypeof | TSESTree.UnaryExpressionVoid | TSESTree.UpdateExpression | TSESTree.YieldNoStarExpression | TSESTree.YieldStarExpression | null;
|
|
373
373
|
/**
|
|
374
374
|
* Get the initialization path of a function node in the AST.
|
|
375
375
|
*
|
|
@@ -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
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "5.30.0-beta.
|
|
3
|
+
"version": "5.30.0-beta.24",
|
|
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-beta.
|
|
33
|
-
"@eslint-react/eslint": "5.30.0-beta.
|
|
34
|
-
"@eslint-react/jsx": "5.30.0-beta.
|
|
35
|
-
"@eslint-react/shared": "5.30.0-beta.
|
|
36
|
-
"@eslint-react/var": "5.30.0-beta.
|
|
32
|
+
"@eslint-react/ast": "5.30.0-beta.24",
|
|
33
|
+
"@eslint-react/eslint": "5.30.0-beta.24",
|
|
34
|
+
"@eslint-react/jsx": "5.30.0-beta.24",
|
|
35
|
+
"@eslint-react/shared": "5.30.0-beta.24",
|
|
36
|
+
"@eslint-react/var": "5.30.0-beta.24",
|
|
37
37
|
"@typescript-eslint/types": "^8.72.1",
|
|
38
38
|
"@typescript-eslint/utils": "^8.72.1",
|
|
39
39
|
"ts-pattern": "^5.9.2"
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"@types/node": "^20.19.43",
|
|
47
47
|
"dedent": "^1.7.2",
|
|
48
48
|
"eslint": "^10.14.0",
|
|
49
|
-
"tsdown": "^0.23.
|
|
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": "*",
|