diff --git a/VERSION b/VERSION index d503b8887..e764cfbde 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.15.1-next.9 +1.15.1-next.10 diff --git a/package.json b/package.json index ce3d19d4f..8d152e523 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/monorepo", - "version": "1.15.1-next.9", + "version": "1.15.1-next.10", "private": true, "description": "A series of composable ESLint plugins for libraries and frameworks that use React as a UI runtime.", "keywords": [ diff --git a/packages/core/package.json b/packages/core/package.json index 8097903a0..ab50d5a32 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/core", - "version": "1.15.1-next.9", + "version": "1.15.1-next.10", "description": "ESLint React's ESLint utility module for static analysis of React core APIs and Patterns.", "homepage": "https://github.com/rel1cx/eslint-react", "bugs": { diff --git a/packages/plugins/eslint-plugin-react-debug/package.json b/packages/plugins/eslint-plugin-react-debug/package.json index edfc9d27e..65ee3f219 100644 --- a/packages/plugins/eslint-plugin-react-debug/package.json +++ b/packages/plugins/eslint-plugin-react-debug/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-debug", - "version": "1.15.1-next.9", + "version": "1.15.1-next.10", "description": "ESLint React's ESLint plugin for debugging related rules.", "keywords": [ "eslint", diff --git a/packages/plugins/eslint-plugin-react-debug/src/rules/function-component.spec.ts b/packages/plugins/eslint-plugin-react-debug/src/rules/function-component.spec.ts index 8fc16bc29..46ca103d7 100644 --- a/packages/plugins/eslint-plugin-react-debug/src/rules/function-component.spec.ts +++ b/packages/plugins/eslint-plugin-react-debug/src/rules/function-component.spec.ts @@ -1373,5 +1373,23 @@ ruleTester.run(RULE_NAME, rule, { "const results = allSettled.map((x) => (x.status === 'fulfilled' ?
: null))", "const results = allSettled.map((x) => (x.status === 'fulfilled' ? format(x.value) : null))", "const results = allSettled.mapLike((x) => (x.status === 'fulfilled' ? format(x.value) : null))", + /* tsx */ ` + export const action = (() => { + // ^? + return null; + }); + `, + /* tsx */ ` + export const action = (() => { + // ^? + return null; + }) as ActionFUnction; + `, + /* tsx */ ` + export const action = (() => { + // ^? + return null; + }) satisfies ActionFUnction; + `, ], }); diff --git a/packages/plugins/eslint-plugin-react-dom/package.json b/packages/plugins/eslint-plugin-react-dom/package.json index aff4c5468..cad8bbe06 100644 --- a/packages/plugins/eslint-plugin-react-dom/package.json +++ b/packages/plugins/eslint-plugin-react-dom/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-dom", - "version": "1.15.1-next.9", + "version": "1.15.1-next.10", "description": "ESLint React's ESLint plugin for React DOM related rules.", "keywords": [ "eslint", diff --git a/packages/plugins/eslint-plugin-react-hooks-extra/package.json b/packages/plugins/eslint-plugin-react-hooks-extra/package.json index 841da57bd..b6022d8ae 100644 --- a/packages/plugins/eslint-plugin-react-hooks-extra/package.json +++ b/packages/plugins/eslint-plugin-react-hooks-extra/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-hooks-extra", - "version": "1.15.1-next.9", + "version": "1.15.1-next.10", "description": "ESLint React's ESLint plugin for React Hooks related rules.", "keywords": [ "eslint", diff --git a/packages/plugins/eslint-plugin-react-naming-convention/package.json b/packages/plugins/eslint-plugin-react-naming-convention/package.json index a2a515a89..07cfb9cb5 100644 --- a/packages/plugins/eslint-plugin-react-naming-convention/package.json +++ b/packages/plugins/eslint-plugin-react-naming-convention/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-naming-convention", - "version": "1.15.1-next.9", + "version": "1.15.1-next.10", "description": "ESLint React's ESLint plugin for naming convention related rules.", "keywords": [ "eslint", diff --git a/packages/plugins/eslint-plugin-react-web-api/package.json b/packages/plugins/eslint-plugin-react-web-api/package.json index b36a1428e..7559c665e 100644 --- a/packages/plugins/eslint-plugin-react-web-api/package.json +++ b/packages/plugins/eslint-plugin-react-web-api/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-web-api", - "version": "1.15.1-next.9", + "version": "1.15.1-next.10", "description": "ESLint React's ESLint plugin for interacting with Web APIs", "keywords": [ "eslint", diff --git a/packages/plugins/eslint-plugin-react-x/package.json b/packages/plugins/eslint-plugin-react-x/package.json index 8fc157bfb..b1777d989 100644 --- a/packages/plugins/eslint-plugin-react-x/package.json +++ b/packages/plugins/eslint-plugin-react-x/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-x", - "version": "1.15.1-next.9", + "version": "1.15.1-next.10", "description": "A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.", "keywords": [ "eslint", diff --git a/packages/plugins/eslint-plugin/package.json b/packages/plugins/eslint-plugin/package.json index c4e9e14b0..9732ef0ac 100644 --- a/packages/plugins/eslint-plugin/package.json +++ b/packages/plugins/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/eslint-plugin", - "version": "1.15.1-next.9", + "version": "1.15.1-next.10", "description": "The main ESLint plugin of ESLint React. Contains all the rules and presets of ESLint React.", "keywords": [ "eslint", diff --git a/packages/shared/package.json b/packages/shared/package.json index e0b2f0c60..7b8b863dd 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/shared", - "version": "1.15.1-next.9", + "version": "1.15.1-next.10", "description": "ESLint React's Shared constants and functions.", "homepage": "https://github.com/rel1cx/eslint-react", "bugs": { diff --git a/packages/tools/package.json b/packages/tools/package.json index 5cbfb57d2..40f075d16 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/tools", - "version": "1.15.1-next.9", + "version": "1.15.1-next.10", "description": "ESLint React's std library and primitives.", "homepage": "https://github.com/rel1cx/eslint-react", "bugs": { diff --git a/packages/types/package.json b/packages/types/package.json index 85840cf3d..3b5fcceb2 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/types", - "version": "1.15.1-next.9", + "version": "1.15.1-next.10", "description": "ESLint React's type definitions.", "homepage": "https://github.com/rel1cx/eslint-react", "bugs": { diff --git a/packages/utilities/ast/package.json b/packages/utilities/ast/package.json index ecb94c54a..885798636 100644 --- a/packages/utilities/ast/package.json +++ b/packages/utilities/ast/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/ast", - "version": "1.15.1-next.9", + "version": "1.15.1-next.10", "description": "ESLint React's TSESTree AST utility module.", "homepage": "https://github.com/rel1cx/eslint-react", "bugs": { diff --git a/packages/utilities/ast/src/get-function-identifier.ts b/packages/utilities/ast/src/get-function-identifier.ts index 58fce802f..e6b70d926 100644 --- a/packages/utilities/ast/src/get-function-identifier.ts +++ b/packages/utilities/ast/src/get-function-identifier.ts @@ -14,10 +14,10 @@ import { AST_NODE_TYPES } from "@typescript-eslint/types"; import { isOneOf } from "./is"; import type { TSESTreeFunction } from "./types"; -export function getFunctionIdentifier(node: TSESTreeFunction): O.Option { +export function getFunctionIdentifier(node: TSESTree.Expression | TSESTreeFunction): O.Option { // function MaybeComponent() {} // const whatever = function MaybeComponent() {}; - if (node.id) return O.some(node.id); + if ("id" in node && node.id) return O.some(node.id); // const MaybeComponent = () => {}; if ( node.parent.type === AST_NODE_TYPES.VariableDeclarator @@ -67,5 +67,11 @@ export function getFunctionIdentifier(node: TSESTreeFunction): O.Option