Solid
Solid TSX rules from eslint-plugin-solid. Solid components compile to fine-grained reactivity, so patterns that look correct in React (destructuring props, calling useEffect-style hooks with array deps) silently break reactivity in Solid. The native implementation uses direct AST patterns and activates Solid-specific reports after Solid imports are present.
Source: eslint-plugin-solid (MIT).
solid/components-return-once: Reject early and conditionalreturnfrom a Solid component, Solid components must return exactly once at the top level.solid/event-handlers: Require DOM event handler props to use canonical Solid casing (onClick, notonclick/onClIcK) so the compiler recognizes them as events.solid/imports: Route each Solid export to the correct entry point (solid-js,solid-js/web, orsolid-js/store) and merge duplicate imports from the same entry.solid/jsx-no-duplicate-props: Reject duplicate JSX props on the same Solid element.solid/jsx-no-script-url: Rejectjavascript:URLs in Solid JSX attributes (href,src, β¦). They evaluate the suffix as code in the page context and are a long-standing XSS vector.solid/jsx-no-undef: Reject Solid JSX component names that are not declared or imported in scope.solid/jsx-uses-vars: Scope-marker compatibility rule (mirrors ESLintβsreact/jsx-uses-vars); registered for config compatibility but does not emit native diagnostics.solid/no-array-handlers: Reject array values passed as Solid event handlers, Solid does not unwrap the array form React supports.solid/no-destructure: Reject destructured Solid component props, destructuring breaks reactivity by reading the property eagerly.solid/no-innerhtml: RejectinnerHTMLJSX attributes because they bypass sanitization and are a common XSS sink.solid/no-proxy-apis: Reject Solid APIs that rely on ES6Proxy(includingnew Proxy,Proxy.revocable, imports fromsolid-js/store, and dynamic spread shapes throughmergeProps).solid/no-react-deps: Reject React-style dependency arrays in Solid tracked scopes (createEffect(() => ..., [deps])).solid/no-react-specific-props: Reject React-specific JSX props such asclassNameandhtmlFor, Solid usesclassandfor.solid/no-unknown-namespaces: Restrict namespaced JSX attributes (ns:name={...}) to the built-in Solid namespaces (on:,oncapture:,use:,prop:,attr:,bool:,style:,class:).solid/prefer-classlist: Rewriteclass={cn({ ... })}/clsx(...)/classnames(...)calls to the reactiveclasslist={{ ... }}prop.solid/prefer-for: Replace inlinearray.map(item => <JSX />)with Solidβs<For>component so the iteration stays keyed and reactive instead of re-creating every child on each update.solid/prefer-show: Rewrite{cond && <JSX />}short-circuits in JSX to<Show when={cond}>...</Show>.solid/reactivity: Reject common Solid reactivity breakages, reading a signal outside a tracking scope, destructuring aStore, etc.solid/self-closing-comp: Collapse JSX elements with no children to the self-closing form (<Foo></Foo>to<Foo />).solid/style-prop: Requirestyle={{...}}keys to be valid kebab-case CSS properties ("font-size", not ReactβsfontSize) and dimensioned values to be strings, Solid does not append implicitpx.solid/validate-jsx-nesting: reject JSX nestings that the HTML parser would silently restructure at runtime,<p>cannot contain block-level children,<a>cannot contain another<a>, and<button>cannot contain other interactive elements.
Last updated on