Describe the bug
ESLint 10's recommended no-unassigned-vars flags Solid refs. For let el; <div ref={el} />, the compiler assigns el, but ESLint only sees a read.
To Reproduce
export const Box = () => {
let el!: HTMLDivElement;
return <div ref={el} onClick={() => el.focus()} />;
};
Config: [js.configs.recommended, ...tseslint.configs.recommended, solid], where solid is eslint-plugin-solid/configs/v2.
2:7 error 'el' is always 'undefined' because it's never assigned no-unassigned-vars
Expected behavior
No report for a variable used as ref={…}.
Environment (please complete the following information):
- OS: macOS
- Node version: v24.19.0
eslint-plugin-solid version: 0.18.0
eslint version: 10.11.0
Additional context
ESLint has no "mark as written" API, so there are two fixes. One is a solid/no-unassigned-vars wrapper that drops reports for ref targets, which is what I'd prefer. The other is turning the core rule off in the configs.
Describe the bug
ESLint 10's recommended
no-unassigned-varsflags Solid refs. Forlet el; <div ref={el} />, the compiler assignsel, but ESLint only sees a read.To Reproduce
Config:
[js.configs.recommended, ...tseslint.configs.recommended, solid], wheresolidiseslint-plugin-solid/configs/v2.Expected behavior
No report for a variable used as
ref={…}.Environment (please complete the following information):
eslint-plugin-solidversion: 0.18.0eslintversion: 10.11.0Additional context
ESLint has no "mark as written" API, so there are two fixes. One is a
solid/no-unassigned-varswrapper that drops reports for ref targets, which is what I'd prefer. The other is turning the core rule off in the configs.