diff --git a/packages/plugins/eslint-plugin-react-x/src/rules/prefer-read-only-props.ts b/packages/plugins/eslint-plugin-react-x/src/rules/prefer-read-only-props.ts index 8cedcf112..bd6ef2250 100644 --- a/packages/plugins/eslint-plugin-react-x/src/rules/prefer-read-only-props.ts +++ b/packages/plugins/eslint-plugin-react-x/src/rules/prefer-read-only-props.ts @@ -43,6 +43,8 @@ export function create(context: RuleContext): RuleListener { "Program:exit"(program) { const components = ctx.getAllComponents(program); for (const [, component] of components) { + if (component.id == null) continue; + if (component.name == null) continue; const [props] = component.node.params; if (props == null) { continue;