├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── feature_request.md
│ └── question.md
└── workflows
│ ├── ci.yml
│ └── version.yml
├── .gitignore
├── .husky
└── pre-commit
├── .npmrc
├── .vscode
└── settings.json
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── eslint.config.mjs
├── package.json
├── packages
├── eslint-plugin-solid
│ ├── README.md
│ ├── docs
│ │ ├── components-return-once.md
│ │ ├── event-handlers.md
│ │ ├── imports.md
│ │ ├── jsx-no-duplicate-props.md
│ │ ├── jsx-no-script-url.md
│ │ ├── jsx-no-undef.md
│ │ ├── jsx-uses-vars.md
│ │ ├── no-array-handlers.md
│ │ ├── no-destructure.md
│ │ ├── no-innerhtml.md
│ │ ├── no-proxy-apis.md
│ │ ├── no-react-deps.md
│ │ ├── no-react-specific-props.md
│ │ ├── no-unknown-namespaces.md
│ │ ├── prefer-classlist.md
│ │ ├── prefer-for.md
│ │ ├── prefer-show.md
│ │ ├── reactivity.md
│ │ ├── self-closing-comp.md
│ │ └── style-prop.md
│ ├── package.json
│ ├── scripts
│ │ └── docs.ts
│ ├── src
│ │ ├── compat.ts
│ │ ├── configs
│ │ │ ├── recommended.ts
│ │ │ └── typescript.ts
│ │ ├── deps.d.ts
│ │ ├── index.ts
│ │ ├── plugin.ts
│ │ ├── rules
│ │ │ ├── components-return-once.ts
│ │ │ ├── event-handlers.ts
│ │ │ ├── imports.ts
│ │ │ ├── jsx-no-duplicate-props.ts
│ │ │ ├── jsx-no-script-url.ts
│ │ │ ├── jsx-no-undef.ts
│ │ │ ├── jsx-uses-vars.ts
│ │ │ ├── no-array-handlers.ts
│ │ │ ├── no-destructure.ts
│ │ │ ├── no-innerhtml.ts
│ │ │ ├── no-proxy-apis.ts
│ │ │ ├── no-react-deps.ts
│ │ │ ├── no-react-specific-props.ts
│ │ │ ├── no-unknown-namespaces.ts
│ │ │ ├── prefer-classlist.ts
│ │ │ ├── prefer-for.ts
│ │ │ ├── prefer-show.ts
│ │ │ ├── reactivity.ts
│ │ │ ├── self-closing-comp.ts
│ │ │ ├── style-prop.ts
│ │ │ └── validate-jsx-nesting.ts
│ │ └── utils.ts
│ ├── test
│ │ ├── ruleTester.ts
│ │ └── rules
│ │ │ ├── components-return-once.test.ts
│ │ │ ├── event-handlers.test.ts
│ │ │ ├── imports.test.ts
│ │ │ ├── jsx-no-duplicate-props.test.ts
│ │ │ ├── jsx-no-script-url.test.ts
│ │ │ ├── jsx-no-undef.test.ts
│ │ │ ├── jsx-uses-vars.test.ts
│ │ │ ├── no-array-handlers.test.ts
│ │ │ ├── no-destructure.test.ts
│ │ │ ├── no-innerhtml.test.ts
│ │ │ ├── no-proxy-apis.test.ts
│ │ │ ├── no-react-deps.test.ts
│ │ │ ├── no-react-specific-props.test.ts
│ │ │ ├── no-unknown-namespaces.test.ts
│ │ │ ├── prefer-classlist.test.ts
│ │ │ ├── prefer-for.test.ts
│ │ │ ├── prefer-show.test.ts
│ │ │ ├── reactivity.test.ts
│ │ │ ├── self-closing-comp.test.ts
│ │ │ └── style-prop.test.ts
│ ├── tsup.config.ts
│ ├── vitest.config.js
│ └── vitest.setup.js
└── eslint-solid-standalone
│ ├── README.md
│ ├── dist.d.ts
│ ├── index.js
│ ├── mock
│ ├── assert.js
│ ├── empty.js
│ ├── glob-parent.js
│ ├── globby.js
│ ├── is-glob.js
│ ├── path.js
│ ├── semver.js
│ └── util.js
│ ├── package.json
│ ├── pnpm-lock.yaml
│ ├── rollup-plugin-replace.mjs
│ ├── rollup.config.mjs
│ └── test.mjs
├── patches
└── eslint@8.57.0.patch
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
├── scripts
└── version.js
├── test
├── README.md
├── eslint.config.js
├── eslint.config.prefixed.js
├── fixture.test.ts
├── format.test.ts
├── invalid
│ ├── jsx-undef.jsx
│ └── reactivity-renaming.jsx
├── package.json
├── valid
│ ├── async
│ │ ├── lazy-components
│ │ │ ├── greeting.tsx
│ │ │ └── main.tsx
│ │ ├── resources
│ │ │ └── main.tsx
│ │ ├── suspense-list
│ │ │ ├── main.tsx
│ │ │ ├── mock-api.tsx
│ │ │ └── profile.tsx
│ │ ├── suspense
│ │ │ ├── greeting.tsx
│ │ │ └── main.tsx
│ │ └── transitions
│ │ │ ├── child.tsx
│ │ │ └── main.tsx
│ ├── bindings
│ │ ├── classlist
│ │ │ └── main.tsx
│ │ ├── directives
│ │ │ ├── click-outside.tsx
│ │ │ └── main.tsx
│ │ ├── events
│ │ │ └── main.tsx
│ │ ├── forwarding-refs
│ │ │ └── main.tsx
│ │ ├── refs
│ │ │ └── main.tsx
│ │ ├── spreads
│ │ │ └── main.tsx
│ │ └── style
│ │ │ └── main.tsx
│ ├── control-flow
│ │ ├── dynamic
│ │ │ └── main.tsx
│ │ ├── error-boundary
│ │ │ └── main.tsx
│ │ ├── for
│ │ │ └── main.tsx
│ │ ├── index
│ │ │ └── main.tsx
│ │ ├── portal
│ │ │ └── main.tsx
│ │ ├── show
│ │ │ └── main.tsx
│ │ └── switch
│ │ │ └── main.tsx
│ ├── examples
│ │ ├── async-resource.tsx
│ │ ├── counter.jsx
│ │ ├── css-animations.jsx
│ │ ├── familiar-and-modern.tsx
│ │ ├── formvalidation-main.tsx
│ │ ├── formvalidation-validation.tsx
│ │ ├── introduction-signals.tsx
│ │ ├── scoreboard.tsx
│ │ ├── simple-todos.tsx
│ │ ├── suspense-transitions-child.tsx
│ │ └── suspense-transitions-main.tsx
│ ├── introduction
│ │ ├── basics
│ │ │ └── main.tsx
│ │ ├── components
│ │ │ ├── main.tsx
│ │ │ └── nested.tsx
│ │ ├── derived-signals
│ │ │ └── main.tsx
│ │ ├── effects
│ │ │ └── main.tsx
│ │ ├── jsx
│ │ │ └── main.tsx
│ │ ├── memos
│ │ │ └── main.tsx
│ │ └── signals
│ │ │ └── main.tsx
│ ├── lifecycles
│ │ ├── onCleanup
│ │ │ └── main.tsx
│ │ └── onMount
│ │ │ └── main.tsx
│ ├── props
│ │ ├── children
│ │ │ ├── colored-list.tsx
│ │ │ └── main.tsx
│ │ ├── default-props
│ │ │ ├── greeting.tsx
│ │ │ └── main.tsx
│ │ └── splitting-props
│ │ │ ├── greeting.tsx
│ │ │ └── main.tsx
│ ├── reactivity
│ │ ├── batching-updates
│ │ │ └── main.tsx
│ │ ├── on
│ │ │ └── main.tsx
│ │ └── untrack
│ │ │ └── main.tsx
│ └── stores
│ │ ├── context
│ │ ├── counter.tsx
│ │ ├── main.tsx
│ │ └── nested.tsx
│ │ ├── create-store
│ │ └── main.tsx
│ │ ├── immutable-stores
│ │ ├── actions.tsx
│ │ ├── main.tsx
│ │ ├── store.tsx
│ │ └── useRedux.tsx
│ │ ├── mutation
│ │ └── main.tsx
│ │ ├── nested-reactivity
│ │ └── main.tsx
│ │ └── without-context
│ │ ├── counter.tsx
│ │ └── main.tsx
└── vitest.config.js
├── tsconfig.json
└── turbo.json
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Tell us what's wrong with the plugin
4 | title: ""
5 | labels: "bug"
6 | assignees: joshwilsonvu
7 | ---
8 |
9 | **Describe the bug**
10 |
11 |
12 | **To Reproduce**
13 |
14 |
15 |
16 | **Expected behavior**
17 |
18 |
19 | **Screenshots**
20 |
21 |
22 | **Environment (please complete the following information):**
23 |
24 | - OS: [e.g. Mac OS 11, Windows 10]
25 | - Node version (`node --version`):
26 | - `eslint-plugin-solid` version (`npm list eslint-plugin-solid`/`yarn why eslint-plugin-solid`):
27 | - `eslint` version (`npm list eslint`/`yarn why eslint`):
28 |
29 | **Additional context**
30 |
31 |
32 |
33 | - [ ] I would be willing to contribute a PR to fix this issue
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Tell us about a rule, option, or other feature you'd like to see added to the plugin
4 | title: ""
5 | labels: "enhancement"
6 | assignees: joshwilsonvu
7 | ---
8 |
9 | **Describe the need**
10 |
11 |
12 | **Suggested Solution**
13 |
14 |
15 | **Possible Alternatives**
16 |
17 |
18 | **Additional context**
19 |
20 |
21 |
22 | - [ ] I would be willing to contribute a PR to implement this feature
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/question.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Question
3 | about: Ask a question not related to a particular bug or feature request
4 | title: ""
5 | labels: "question"
6 | assignees: joshwilsonvu
7 | ---
8 |
9 | **Your Question**
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 | on:
3 | push:
4 | branches: ["main"]
5 | pull_request:
6 | types: [opened, synchronize]
7 | jobs:
8 | build:
9 | name: Build
10 | runs-on: ubuntu-latest
11 | permissions:
12 | id-token: write
13 | strategy:
14 | matrix:
15 | node: ["18", "20", "22"]
16 | steps:
17 | - name: Checkout
18 | uses: actions/checkout@v4
19 |
20 | - name: Setup pnpm
21 | uses: pnpm/action-setup@v4
22 | with:
23 | run_install: false
24 |
25 | - name: Install node
26 | uses: actions/setup-node@v4
27 | with:
28 | node-version: ${{ matrix.node }}
29 | cache: "pnpm"
30 | registry-url: https://registry.npmjs.org/
31 |
32 | - name: Install dependencies
33 | run: pnpm install --frozen-lockfile
34 |
35 | - name: Cache turbo setup
36 | uses: actions/cache@v4
37 | with:
38 | path: .turbo
39 | key: ${{ runner.os }}-turbo-${{ github.sha }}
40 | restore-keys: |
41 | ${{ runner.os }}-turbo-
42 |
43 | - name: Run CI with turbo
44 | run: pnpm run ci
45 |
46 | - name: Publish to npm if needed
47 | if: github.ref == 'refs/heads/main' && matrix.node == '22'
48 | env:
49 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
50 | run: pnpm publish -r --no-git-checks
51 |
--------------------------------------------------------------------------------
/.github/workflows/version.yml:
--------------------------------------------------------------------------------
1 | name: Version
2 | on:
3 | workflow_dispatch:
4 | inputs:
5 | version:
6 | description: "Semver version bump"
7 | required: true
8 | type: choice
9 | options: [patch, minor, major]
10 | jobs:
11 | version:
12 | name: Version
13 | runs-on: ubuntu-latest
14 | if: github.ref == 'refs/heads/main'
15 | steps:
16 | - name: Checkout
17 | uses: actions/checkout@v4
18 |
19 | - name: Setup pnpm
20 | uses: pnpm/action-setup@v4
21 | with:
22 | run_install: false
23 |
24 | - name: Install node
25 | uses: actions/setup-node@v4
26 | with:
27 | node-version: "22"
28 | cache: "pnpm"
29 |
30 | - name: Install dependencies
31 | run: pnpm install --frozen-lockfile
32 |
33 | - name: Bump version
34 | run: |
35 | git config user.name github-actions[bot]
36 | git config user.email github-actions[bot]@users.noreply.github.com
37 | pnpm run version ${{ inputs.version }}
38 |
39 | - name: Create PR with new versions
40 | uses: peter-evans/create-pull-request@v6
41 | with:
42 | branch: "gh-action-version"
43 | base: main
44 | delete-branch: true
45 | title: "Update package versions"
46 | body: "Merging this PR will publish packages to npm at the new version."
47 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build directory
2 | dist
3 | dist.*
4 | !packages/eslint-solid-standalone/dist.d.ts
5 |
6 | # Logs
7 | logs
8 | *.log
9 | npm-debug.log*
10 | yarn-debug.log*
11 | yarn-error.log*
12 | lerna-debug.log*
13 |
14 | # Diagnostic reports (https://nodejs.org/api/report.html)
15 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
16 |
17 | # Runtime data
18 | pids
19 | *.pid
20 | *.seed
21 | *.pid.lock
22 |
23 | # Directory for instrumented libs generated by jscoverage/JSCover
24 | lib-cov
25 |
26 | # Coverage directory used by tools like istanbul
27 | coverage
28 | *.lcov
29 |
30 | # nyc test coverage
31 | .nyc_output
32 |
33 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
34 | .grunt
35 |
36 | # Bower dependency directory (https://bower.io/)
37 | bower_components
38 |
39 | # node-waf configuration
40 | .lock-wscript
41 |
42 | # Compiled binary addons (https://nodejs.org/api/addons.html)
43 | build/Release
44 |
45 | # Dependency directories
46 | node_modules/
47 | jspm_packages/
48 |
49 | # TypeScript v1 declaration files
50 | typings/
51 |
52 | # TypeScript cache
53 | *.tsbuildinfo
54 |
55 | # Optional npm cache directory
56 | .npm
57 |
58 | # Optional eslint cache
59 | .eslintcache
60 |
61 | # Microbundle cache
62 | .rpt2_cache/
63 | .rts2_cache_cjs/
64 | .rts2_cache_es/
65 | .rts2_cache_umd/
66 |
67 | # Optional REPL history
68 | .node_repl_history
69 |
70 | # Output of 'npm pack'
71 | *.tgz
72 |
73 | # Yarn Integrity file
74 | .yarn-integrity
75 |
76 | # dotenv environment variables file
77 | .env
78 | .env.test
79 |
80 | # parcel-bundler cache (https://parceljs.org/)
81 | .cache
82 |
83 | # Next.js build output
84 | .next
85 |
86 | # Nuxt.js build / generate output
87 | .nuxt
88 |
89 | # Gatsby files
90 | .cache/
91 | # Comment in the public line in if your project uses Gatsby and *not* Next.js
92 | # https://nextjs.org/blog/next-9-1#public-directory-support
93 | # public
94 |
95 | # vuepress build output
96 | .vuepress/dist
97 |
98 | # Serverless directories
99 | .serverless/
100 |
101 | # FuseBox cache
102 | .fusebox/
103 |
104 | # DynamoDB Local files
105 | .dynamodb/
106 |
107 | # TernJS port file
108 | .tern-port
109 | .DS_Store
110 |
111 | # Turbo cache
112 | .turbo
113 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | pnpm run docs
5 | git add README.md packages/eslint-plugin-solid/README.md packages/eslint-plugin-solid/docs/*
6 | pnpm lint-staged
7 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | link-workspace-packages=true
2 | disallow-workspace-cycles=true
3 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "typescript.tsdk": "node_modules/typescript/lib"
3 | }
4 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to `eslint-plugin-solid`
2 |
3 | Thanks for your interest in improving this project! We welcome questions, bug reports, and feature
4 | requests. Please file an issue before submitting a PR, and fill out applicable details in the chosen
5 | issue template.
6 |
7 | > Please see our [Code of Conduct](./CODE_OF_CONDUCT.md) before contributing.
8 |
9 | ## Development
10 |
11 | This project uses `pnpm` for package management. Run `pnpm i` to install dependencies after cloning
12 | the repo.
13 |
14 | To type-check and build the code, run `pnpm build`. This will also regenerate the docs from source
15 | code descriptions and test cases, using `scripts/docs.ts`.
16 |
17 | `pnpm lint` runs ESLint on the repo (so meta!).
18 |
19 | Testing is _extremely_ important to maintaining the quality of this project, so we require
20 | comprehensive tests for every rule, and we check against example code provided in the docs. To run
21 | tests for individual rules as well as integration/e2e tests, run `pnpm test`. To run tests for a
22 | specific rule like `reactivity`, run `pnpm test reactivity` or `pnpm test reactivity --watch`.
23 | Before releasing new versions, we run tests against various ESLint parsers with `pnpm test:all`.
24 |
25 | ### Adding a new rule
26 |
27 | For each rule, there's a few things to do for it to be ready for release. Let's say you have
28 | received approval to add a rule named `solid/some-name` in an issue:
29 |
30 | 1. Create `src/rules/some-name.ts`. Add the necessary imports and a default export of the form `{
31 | meta: { ... }, create() { ... } }`.
32 | [`solid/no-react-specific-props`](./src/rules/no-react-specific-props.ts) is a good, brief
33 | example of what's necessary.
34 | 2. Create `test/rules/some-name.test.ts`. Add `valid` and `invalid` test cases, using other files
35 | for inspiration. Be sure to `export const cases` so `scripts/docs.ts` can pick up the test cases.
36 | 3. Create `docs/rules/some-name.md`. You can copy the content of
37 | `docs/rules/no-react-specific-props.md` directly, as all of its content is auto-generated. Run
38 | `pnpm build` and then verify that the content has been updated to reflect the new rule.
39 | 4. When good tests are written and passing, open `src/index.ts` and import your new rule. Add it to
40 | `allRules` and the `recommended` and `typescript` configs as appropriate.
41 | 5. Submit your PR and await feedback. When any necessary changes have been made, it will be merged.
42 | Congratulations!
43 |
44 | ## Publishing
45 |
46 | Publishing is currently done manually by @joshwilsonvu. When publishing a new version of
47 | `eslint-plugin-solid`, we also publish a corresponding version of `eslint-plugin-standalone`, which
48 | is a package primarily intended to support linting on https://playground.solidjs.com.
49 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Josh Wilson
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/eslint.config.mjs:
--------------------------------------------------------------------------------
1 | // @ts-check
2 | import path from "node:path";
3 | import js from "@eslint/js";
4 | import globals from "globals";
5 | import tseslint from "typescript-eslint";
6 | import pluginEslintPlugin from "eslint-plugin-eslint-plugin";
7 |
8 | const tsconfigPath = path.resolve("tsconfig.json");
9 |
10 | export default tseslint.config(
11 | {
12 | ignores: ["**/dist/", "**/dist.*", "**/.tsup/", "**/eslint.config.mjs", "test/"],
13 | },
14 | js.configs.recommended,
15 | tseslint.configs.eslintRecommended,
16 | ...tseslint.configs.recommended,
17 | {
18 | languageOptions: {
19 | sourceType: "module",
20 | parser: tseslint.parser,
21 | parserOptions: {
22 | project: tsconfigPath,
23 | },
24 | globals: globals.node,
25 | },
26 | rules: {
27 | "@typescript-eslint/no-explicit-any": "off",
28 | "@typescript-eslint/no-non-null-assertion": "off",
29 | "@typescript-eslint/non-nullable-type-assertion-style": "warn",
30 | "no-extra-semi": "off",
31 | "no-mixed-spaces-and-tabs": "off",
32 | "no-new-native-nonconstructor": 1,
33 | "no-new-symbol": "off",
34 | "object-shorthand": "warn",
35 | },
36 | },
37 | {
38 | files: ["packages/eslint-plugin-solid/src/rules/*.ts"],
39 | languageOptions: {
40 | globals: globals.node,
41 | },
42 | plugins: {
43 | "eslint-plugin": pluginEslintPlugin,
44 | },
45 | rules: {
46 | ...pluginEslintPlugin.configs.recommended.rules,
47 | "eslint-plugin/meta-property-ordering": "error",
48 | "eslint-plugin/report-message-format": ["error", "^[A-Z\\{'].*\\.$"],
49 | "eslint-plugin/test-case-property-ordering": "error",
50 | "eslint-plugin/require-meta-docs-description": [
51 | "error",
52 | { pattern: "^(Enforce|Require|Disallow)" },
53 | ],
54 | "eslint-plugin/require-meta-docs-url": [
55 | "error",
56 | {
57 | pattern:
58 | "https://github.com/solidjs-community/eslint-plugin-solid/blob/main/packages/eslint-plugin-solid/docs/{{name}}.md",
59 | },
60 | ],
61 | },
62 | }
63 | );
64 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "eslint-plugin-solid-monorepo",
3 | "private": true,
4 | "license": "MIT",
5 | "type": "module",
6 | "workspaces": [
7 | "packages/*"
8 | ],
9 | "scripts": {
10 | "build": "turbo run turbo:build",
11 | "ci": "PARSER=all turbo run turbo:build turbo:test turbo:docs turbo:lint turbo:tsc",
12 | "docs": "turbo run turbo:docs",
13 | "lint": "turbo run turbo:lint",
14 | "prepare": "husky install",
15 | "test": "turbo run turbo:test",
16 | "tsc": "turbo run turbo:tsc",
17 | "turbo:docs": "cp packages/eslint-plugin-solid/README.md README.md",
18 | "turbo:lint": "eslint --max-warnings=0",
19 | "turbo:tsc": "tsc",
20 | "version": "node scripts/version.js"
21 | },
22 | "lint-staged": {
23 | "*.{js,jsx,ts,tsx}": [
24 | "pnpm lint -- --no-warn-ignored --fix",
25 | "prettier --write"
26 | ]
27 | },
28 | "prettier": {
29 | "plugins": [
30 | "prettier-plugin-packagejson"
31 | ],
32 | "printWidth": 100
33 | },
34 | "devDependencies": {
35 | "@tsconfig/node20": "^20.1.4",
36 | "@types/node": "^20",
37 | "@types/prettier": "^2.7.3",
38 | "eslint": "^9.5.0",
39 | "eslint-plugin-eslint-plugin": "^6.1.0",
40 | "globals": "^15.6.0",
41 | "husky": "^8.0.3",
42 | "lint-staged": "^13.3.0",
43 | "prettier": "^2.8.8",
44 | "prettier-plugin-packagejson": "^2.5.1",
45 | "semver": "^7.6.0",
46 | "turbo": "^2.0.14",
47 | "typescript": "^5.5.4",
48 | "typescript-eslint": "^8.1.0"
49 | },
50 | "packageManager": "pnpm@9.7.1",
51 | "pnpm": {
52 | "patchedDependencies": {
53 | "eslint@8.57.0": "patches/eslint@8.57.0.patch"
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/packages/eslint-plugin-solid/docs/imports.md:
--------------------------------------------------------------------------------
1 |
2 | # solid/imports
3 | Enforce consistent imports from "solid-js", "solid-js/web", and "solid-js/store".
4 | This rule is **a warning** by default.
5 |
6 | [View source](../src/rules/imports.ts) · [View tests](../test/rules/imports.test.ts)
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | ## Tests
15 |
16 | ### Invalid Examples
17 |
18 | These snippets cause lint errors, and all of them can be auto-fixed.
19 |
20 | ```js
21 | import { createEffect } from "solid-js/web";
22 | // after eslint --fix:
23 | import { createEffect } from "solid-js";
24 |
25 | import { createEffect } from "solid-js/web";
26 | import { createSignal } from "solid-js";
27 | // after eslint --fix:
28 | import { createSignal, createEffect } from "solid-js";
29 |
30 | import type { Component } from "solid-js/store";
31 | import { createSignal } from "solid-js";
32 | console.log("hi");
33 | // after eslint --fix:
34 | import { createSignal, Component } from "solid-js";
35 | console.log("hi");
36 |
37 | import { createSignal } from "solid-js/web";
38 | import "solid-js";
39 | // after eslint --fix:
40 | import { createSignal } from "solid-js";
41 |
42 | import { createSignal } from "solid-js/web";
43 | import {} from "solid-js";
44 | // after eslint --fix:
45 | import { createSignal } from "solid-js";
46 |
47 | import { createEffect } from "solid-js/web";
48 | import { render } from "solid-js";
49 | // after eslint --fix:
50 | import { render, createEffect } from "solid-js";
51 |
52 | import { render, createEffect } from "solid-js";
53 | // after eslint --fix:
54 | import { render } from "solid-js/web";
55 | import { createEffect } from "solid-js";
56 | ```
57 |
58 | ### Valid Examples
59 |
60 | These snippets don't cause lint errors.
61 |
62 | ```js
63 | import { createSignal, mergeProps as merge } from "solid-js";
64 |
65 | import { createSignal, mergeProps as merge } from "solid-js";
66 |
67 | import { render, hydrate } from "solid-js/web";
68 |
69 | import { createStore, produce } from "solid-js/store";
70 |
71 | import { createSignal } from "solid-js";
72 | import { render } from "solid-js/web";
73 | import { something } from "somewhere/else";
74 | import { createStore } from "solid-js/store";
75 |
76 | import * as Solid from "solid-js";
77 | Solid.render();
78 |
79 | import type { Component, JSX } from "solid-js";
80 | import type { Store } from "solid-js/store";
81 | ```
82 |
83 |
--------------------------------------------------------------------------------
/packages/eslint-plugin-solid/docs/jsx-no-duplicate-props.md:
--------------------------------------------------------------------------------
1 |
2 | # solid/jsx-no-duplicate-props
3 | Disallow passing the same prop twice in JSX.
4 | This rule is **an error** by default.
5 |
6 | [View source](../src/rules/jsx-no-duplicate-props.ts) · [View tests](../test/rules/jsx-no-duplicate-props.test.ts)
7 |
8 |
9 |
10 | ## Rule Options
11 |
12 | Options shown here are the defaults.
13 |
14 | ```js
15 | {
16 | "solid/jsx-no-duplicate-props": ["error", {
17 | // Consider two prop names differing only by case to be the same.
18 | ignoreCase: false,
19 | }]
20 | }
21 | ```
22 |
23 |
24 |
25 | ## Tests
26 |
27 | ### Invalid Examples
28 |
29 | These snippets cause lint errors.
30 |
31 | ```js
32 | let el =
;
33 |
34 | let el = ;
35 |
36 | let el = ;
37 |
38 | let el = ;
39 |
40 | let el = ;
41 |
42 | let el = ;
43 |
44 | let el = (
45 | }>
46 |
47 |
48 | );
49 |
50 | let el = ;
51 | ```
52 |
53 | ### Valid Examples
54 |
55 | These snippets don't cause lint errors.
56 |
57 | ```js
58 | let el = ;
59 |
60 | let el = ;
61 |
62 | let el = ;
63 |
64 | let el = ;
65 |
66 | let el = ;
67 |
68 | let el = ;
69 |
70 | let el = } />;
71 |
72 | let el = (
73 |
74 |
75 |
76 | );
77 | ```
78 |
79 |
--------------------------------------------------------------------------------
/packages/eslint-plugin-solid/docs/jsx-no-script-url.md:
--------------------------------------------------------------------------------
1 |
2 | # solid/jsx-no-script-url
3 | Disallow javascript: URLs.
4 | This rule is **an error** by default.
5 |
6 | [View source](../src/rules/jsx-no-script-url.ts) · [View tests](../test/rules/jsx-no-script-url.test.ts)
7 |
8 |
9 | See [this issue](https://github.com/solidjs-community/eslint-plugin-solid/issues/24) for rationale.
10 |
11 |
12 |
13 |
14 |
15 |
16 | ## Tests
17 |
18 | ### Invalid Examples
19 |
20 | These snippets cause lint errors.
21 |
22 | ```js
23 | let el = ;
24 |
25 | let el = ;
26 |
27 | let el = ;
28 |
29 | const link = "javascript:alert('hacked!')";
30 | let el = ;
31 |
32 | const link = "\tj\na\tv\na\ts\nc\tr\ni\tpt:alert('hacked!')";
33 | let el = ;
34 |
35 | const link = "javascrip" + "t:alert('hacked!')";
36 | let el = ;
37 | ```
38 |
39 | ### Valid Examples
40 |
41 | These snippets don't cause lint errors.
42 |
43 | ```js
44 | let el = ;
45 |
46 | let el = ;
47 |
48 | let el = ;
49 |
50 | const link = "https://example.com";
51 | let el = ;
52 | ```
53 |
54 |
--------------------------------------------------------------------------------
/packages/eslint-plugin-solid/docs/jsx-uses-vars.md:
--------------------------------------------------------------------------------
1 |
2 | # solid/jsx-uses-vars
3 | Prevent variables used in JSX from being marked as unused.
4 | This rule is **an error** by default.
5 |
6 | [View source](../src/rules/jsx-uses-vars.ts) · [View tests](../test/rules/jsx-uses-vars.test.ts)
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/packages/eslint-plugin-solid/docs/no-array-handlers.md:
--------------------------------------------------------------------------------
1 |
2 | # solid/no-array-handlers
3 | Disallow usage of type-unsafe event handlers.
4 | This rule is **off** by default.
5 |
6 | [View source](../src/rules/no-array-handlers.ts) · [View tests](../test/rules/no-array-handlers.test.ts)
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | ## Tests
15 |
16 | ### Invalid Examples
17 |
18 | These snippets cause lint errors.
19 |
20 | ```js
21 | let el =