{"id":13533082,"url":"https://github.com/solidjs-community/eslint-plugin-solid","last_synced_at":"2026-01-12T01:47:15.667Z","repository":{"id":38540332,"uuid":"383257021","full_name":"solidjs-community/eslint-plugin-solid","owner":"solidjs-community","description":"Solid-specific linting rules for ESLint.","archived":false,"fork":false,"pushed_at":"2025-11-18T13:57:39.000Z","size":1306,"stargazers_count":252,"open_issues_count":40,"forks_count":37,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-18T16:22:39.046Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solidjs-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-07-05T20:26:51.000Z","updated_at":"2025-11-18T13:57:44.000Z","dependencies_parsed_at":"2024-01-08T10:16:19.869Z","dependency_job_id":"87fb2913-83b5-4bc9-b92e-76904f1944d5","html_url":"https://github.com/solidjs-community/eslint-plugin-solid","commit_stats":{"total_commits":303,"total_committers":19,"mean_commits":"15.947368421052632","dds":"0.27722772277227725","last_synced_commit":"4bc8e38487be0782a85016cff33f2f953cb6c607"},"previous_names":["joshwilsonvu/eslint-plugin-solid"],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/solidjs-community/eslint-plugin-solid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidjs-community%2Feslint-plugin-solid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidjs-community%2Feslint-plugin-solid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidjs-community%2Feslint-plugin-solid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidjs-community%2Feslint-plugin-solid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solidjs-community","download_url":"https://codeload.github.com/solidjs-community/eslint-plugin-solid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidjs-community%2Feslint-plugin-solid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T07:01:16.431Z","updated_at":"2026-01-12T01:47:15.650Z","avatar_url":"https://github.com/solidjs-community.png","language":"TypeScript","funding_links":[],"categories":["📦 Components \u0026 Libraries"],"sub_categories":["DX"],"readme":"\u003cp\u003e\n  \u003cimg width=\"100%\" src=\"https://assets.solidjs.com/banner?type=ESLint%20Plugin\u0026background=tiles\u0026project=%20\" alt=\"Solid ESLint Extension\"\u003e\n\u003c/p\u003e\n\n# Solid ESLint Plugin\n\n[![npm version](https://img.shields.io/npm/v/eslint-plugin-solid?style=for-the-badge)](https://npmjs.com/package/eslint-plugin-solid)\n[![GitHub package version](https://img.shields.io/github/package-json/v/solidjs-community/eslint-plugin-solid/main?filename=packages%2Feslint-plugin-solid%2Fpackage.json\u0026style=for-the-badge)](https://github.com/solidjs-community/eslint-plugin-solid)\n![ESLint peer dependency](https://img.shields.io/badge/eslint-6.x--9.x-blue?style=for-the-badge)\n[![CI](https://github.com/solidjs-community/eslint-plugin-solid/actions/workflows/ci.yml/badge.svg?style=for-the-badge)](https://github.com/solidjs-community/eslint-plugin-solid/actions/workflows/ci.yml)\n\nThis package contains [Solid](https://www.solidjs.com/)-specific linting rules for ESLint. It can\nease Solid's learning curve by finding and fixing problems around Solid's reactivity system, and can\nmigrate some React patterns to Solid code.\n\nIt's approaching a `1.0.0` release, and it's well tested and should be helpful in Solid projects\ntoday.\n\n\u003c!-- doc-gen TOC --\u003e\n- [Installation](#installation)\n- [Configuration](#configuration)\n  - [TypeScript](#typescript)\n  - [Manual Configuration](#manual-configuration)\n  - [Flat Configuration](#flat-configuration)\n- [Rules](#rules)\n- [Troubleshooting](#troubleshooting)\n- [Versioning](#versioning)\n\u003c!-- end-doc-gen --\u003e\n\n## Installation\n\nInstall `eslint` and `eslint-plugin-solid` locally.\n\n```sh\nnpm install --save-dev eslint eslint-plugin-solid\n# or\npnpm add --save-dev eslint eslint-plugin-solid\nyarn add --dev eslint eslint-plugin-solid\n\n# optional, to create an ESLint config file\nnpx eslint --init\n# or\npnpm eslint --init\nyarn eslint --init\n```\n\nIf you're using VSCode, you'll want to install the [ESLint\nextension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint). You're\nencouraged to enable auto-fixing problems on save by adding the following to your `settings.json`\nfile.\n\n```json\n{\n  \"editor.codeActionsOnSave\": {\n    \"source.fixAll\": true\n  }\n}\n```\n\nIf you're using Vite, you may want to install\n[vite-plugin-eslint](https://github.com/gxmari007/vite-plugin-eslint).\n\nYou may also want to check out\n[eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y), which provides\nuseful rules for writing accessible HTML.\n\n## Configuration\n\nUse the `\"plugin:solid/recommended\"` configuration to get reasonable defaults as shown [below](#rules).\n\n```json\n{\n  \"plugins\": [\"solid\"],\n  \"extends\": [\"eslint:recommended\", \"plugin:solid/recommended\"]\n}\n```\n\n### TypeScript\n\nIf you're using TypeScript, use the `\"plugin:solid/typescript\"` configuration instead.\nThis disables some features that overlap with type checking.\n\n```json\n{\n  \"parser\": \"@typescript-eslint/parser\",\n  \"plugins\": [\"solid\"],\n  \"extends\": [\"eslint:recommended\", \"plugin:solid/typescript\"]\n}\n```\n\n### Manual Configuration\n\nIf you don't want to use a preset, you can configure rules individually. Add the `\"solid\"` plugin,\nenable JSX with the parser options (or use the equivalent options for `@typescript-eslint/parser` or\n`@babel/eslint-parser`), and configure the rules you would like to use. Some rules have additional\noptions you can set.\n\n```json\n{\n  \"plugins\": [\"solid\"],\n  \"parserOptions\": {\n    \"ecmaFeatures\": {\n      \"jsx\": true\n    }\n  },\n  \"rules\": {\n    \"solid/reactivity\": \"warn\",\n    \"solid/no-destructure\": \"warn\",\n    \"solid/jsx-no-undef\": \"error\"\n  }\n}\n```\n\n### Flat Configuration\n\nESLint's new configuration system, [Flat\nConfiguration](https://eslint.org/docs/latest/use/configure/configuration-files-new#using-configurations-included-in-plugins),\nis available starting in ESLint [v8.23.0](https://github.com/eslint/eslint/releases/tag/v8.23.0). To\nuse it, create an `eslint.config.js` file at the root of your project, instead of `.eslintrc.*`\nand/or `.eslintignore`.\n\n```js\nimport js from \"@eslint/js\";\nimport solid from \"eslint-plugin-solid/configs/recommended\";\n\nexport default [\n  js.configs.recommended, // replaces eslint:recommended\n  solid,\n];\n```\n\nFor TypeScript:\n\n```js\nimport js from \"@eslint/js\";\nimport solid from \"eslint-plugin-solid/configs/typescript\";\nimport * as tsParser from \"@typescript-eslint/parser\";\n\nexport default [\n  js.configs.recommended,\n  {\n    files: [\"**/*.{ts,tsx}\"],\n    ...solid,\n    languageOptions: {\n      parser: tsParser,\n      parserOptions: {\n        project: \"tsconfig.json\",\n      },\n    },\n  },\n];\n```\n\nThese configurations do not configure global variables in ESLint. You can do this yourself manually\nor with a package like [globals](https://www.npmjs.com/package/globals) by creating a configuration\nwith a `languageOptions.globals` object. We recommend setting up global variables for Browser APIs\nas well as at least ES2015.\n\nNote for the ESLint VSCode Extension: Enable the \"Use Flat Config\" setting for your workspace to\nenable Flat Config support.\n\nFlat configs are also available as `plugin.configs['flat/recommended']` and `plugin.configs['flat/typescript']`, after using `import plugin from 'eslint-plugin-solid'`.\n\n## Rules\n\n✔: Enabled in the `recommended` configuration.\n\n🔧: Fixable with [`eslint --fix`](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems)/IDE auto-fix.\n\n\u003c!-- doc-gen RULES --\u003e\n| ✔ | 🔧 | Rule | Description |\n| :---: | :---: | :--- | :--- |\n| ✔ | 🔧 | [solid/components-return-once](/packages/eslint-plugin-solid/docs/components-return-once.md) | Disallow early returns in components. Solid components only run once, and so conditionals should be inside JSX. |\n| ✔ | 🔧 | [solid/event-handlers](/packages/eslint-plugin-solid/docs/event-handlers.md) | Enforce naming DOM element event handlers consistently and prevent Solid's analysis from misunderstanding whether a prop should be an event handler. |\n| ✔ | 🔧 | [solid/imports](/packages/eslint-plugin-solid/docs/imports.md) | Enforce consistent imports from \"solid-js\", \"solid-js/web\", and \"solid-js/store\". |\n| ✔ |  | [solid/jsx-no-duplicate-props](/packages/eslint-plugin-solid/docs/jsx-no-duplicate-props.md) | Disallow passing the same prop twice in JSX. |\n| ✔ |  | [solid/jsx-no-script-url](/packages/eslint-plugin-solid/docs/jsx-no-script-url.md) | Disallow javascript: URLs. |\n| ✔ | 🔧 | [solid/jsx-no-undef](/packages/eslint-plugin-solid/docs/jsx-no-undef.md) | Disallow references to undefined variables in JSX. Handles custom directives. |\n| ✔ |  | [solid/jsx-uses-vars](/packages/eslint-plugin-solid/docs/jsx-uses-vars.md) | Prevent variables used in JSX from being marked as unused. |\n|  |  | [solid/no-array-handlers](/packages/eslint-plugin-solid/docs/no-array-handlers.md) | Disallow usage of type-unsafe event handlers. |\n| ✔ | 🔧 | [solid/no-destructure](/packages/eslint-plugin-solid/docs/no-destructure.md) | Disallow destructuring props. In Solid, props must be used with property accesses (`props.foo`) to preserve reactivity. This rule only tracks destructuring in the parameter list. |\n| ✔ | 🔧 | [solid/no-innerhtml](/packages/eslint-plugin-solid/docs/no-innerhtml.md) | Disallow usage of the innerHTML attribute, which can often lead to security vulnerabilities. |\n|  |  | [solid/no-proxy-apis](/packages/eslint-plugin-solid/docs/no-proxy-apis.md) | Disallow usage of APIs that use ES6 Proxies, only to target environments that don't support them. |\n| ✔ | 🔧 | [solid/no-react-deps](/packages/eslint-plugin-solid/docs/no-react-deps.md) | Disallow usage of dependency arrays in `createEffect` and `createMemo`. |\n| ✔ | 🔧 | [solid/no-react-specific-props](/packages/eslint-plugin-solid/docs/no-react-specific-props.md) | Disallow usage of React-specific `className`/`htmlFor` props, which were deprecated in v1.4.0. |\n| ✔ |  | [solid/no-unknown-namespaces](/packages/eslint-plugin-solid/docs/no-unknown-namespaces.md) | Enforce using only Solid-specific namespaced attribute names (i.e. `'on:'` in `\u003cdiv on:click={...} /\u003e`). |\n|  | 🔧 | [solid/prefer-classlist](/packages/eslint-plugin-solid/docs/prefer-classlist.md) | Enforce using the classlist prop over importing a classnames helper. The classlist prop accepts an object `{ [class: string]: boolean }` just like classnames. |\n| ✔ | 🔧 | [solid/prefer-for](/packages/eslint-plugin-solid/docs/prefer-for.md) | Enforce using Solid's `\u003cFor /\u003e` component for mapping an array to JSX elements. |\n|  | 🔧 | [solid/prefer-show](/packages/eslint-plugin-solid/docs/prefer-show.md) | Enforce using Solid's `\u003cShow /\u003e` component for conditionally showing content. Solid's compiler covers this case, so it's a stylistic rule only. |\n| ✔ |  | [solid/reactivity](/packages/eslint-plugin-solid/docs/reactivity.md) | Enforce that reactivity (props, signals, memos, etc.) is properly used, so changes in those values will be tracked and update the view as expected. |\n| ✔ | 🔧 | [solid/self-closing-comp](/packages/eslint-plugin-solid/docs/self-closing-comp.md) | Disallow extra closing tags for components without children. |\n| ✔ | 🔧 | [solid/style-prop](/packages/eslint-plugin-solid/docs/style-prop.md) | Require CSS properties in the `style` prop to be valid and kebab-cased (ex. 'font-size'), not camel-cased (ex. 'fontSize') like in React, and that property values with dimensions are strings, not numbers with implicit 'px' units. |\n\u003c!-- end-doc-gen --\u003e\n\n## Troubleshooting\n\nThe rules in this plugin provide sensible guidelines as well as possible, but there may be times\nwhere you know better than the rule and want to ignore a warning. To do that, [add a\ncomment](https://eslint.org/docs/latest/user-guide/configuring/rules#disabling-rules) like the\nfollowing:\n\n```jsx\n// eslint-disable-next-line solid/reactivity\nconst [editedValue, setEditedValue] = createSignal(props.value);\n```\n\n_Please note_: there may also be times where a rule correctly warns about a subtle problem,\neven if it looks like a false positive at first. With `solid/reactivity`, please look at the\n[reactivity docs](https://github.com/solidjs-community/eslint-plugin-solid/blob/main/packages/eslint-plugin-solid/docs/reactivity.md#troubleshooting) before deciding to disable the rule.\n\nWhen in doubt, feel free to [file an\nissue](https://github.com/solidjs-community/eslint-plugin-solid/issues/new/choose).\n\n## Versioning\n\nPre-1.0.0, the rules and the `recommended` and `typescript` configuations will be\nstable across patch (`0.0.x`) versions, but may change across minor (`0.x`) versions.\nIf you want to pin a minor version, use a tilde in your `package.json`.\n\n\u003c!-- doc-gen TILDE --\u003e\n```diff\n- \"eslint-plugin-solid\": \"^0.14.5\"\n+ \"eslint-plugin-solid\": \"~0.14.5\"\n```\n\u003c!-- end-doc-gen --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidjs-community%2Feslint-plugin-solid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolidjs-community%2Feslint-plugin-solid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidjs-community%2Feslint-plugin-solid/lists"}