Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint crashes when using as in createSignal argument #133

Closed
1 task
noriapi opened this issue Mar 27, 2024 · 2 comments · Fixed by #134
Closed
1 task

eslint crashes when using as in createSignal argument #133

noriapi opened this issue Mar 27, 2024 · 2 comments · Fixed by #134
Assignees
Labels
bug Something isn't working

Comments

@noriapi
Copy link

noriapi commented Mar 27, 2024

Describe the bug
eslint exits with the following error

Oops! Something went wrong! :(

ESLint: 8.57.0

Error: Unknown node type TSAsExpression.
Occurred while linting /home/runner/work/eslint-solid-crash-repro/eslint-solid-crash-repro/src/index.tsx:4
Rule: "solid/reactivity"
    at Controller.traverse (/home/runner/work/eslint-solid-crash-repro/eslint-solid-crash-repro/node_modules/estraverse/estraverse.js:469:31)
    at traverse (/home/runner/work/eslint-solid-crash-repro/eslint-solid-crash-repro/node_modules/estraverse/estraverse.js:670:27)
    at permissivelyTrackNode (/home/runner/work/eslint-solid-crash-repro/eslint-solid-crash-repro/node_modules/eslint-plugin-solid/dist/rules/reactivity.js:532:43)
    at checkForTrackedScopes (/home/runner/work/eslint-solid-crash-repro/eslint-solid-crash-repro/node_modules/eslint-plugin-solid/dist/rules/reactivity.js:687:29)
    at CallExpression (/home/runner/work/eslint-solid-crash-repro/eslint-solid-crash-repro/node_modules/eslint-plugin-solid/dist/rules/reactivity.js:760:17)
    at ruleErrorHandler (/home/runner/work/eslint-solid-crash-repro/eslint-solid-crash-repro/node_modules/eslint/lib/linter/linter.js:1076:28)
    at /home/runner/work/eslint-solid-crash-repro/eslint-solid-crash-repro/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/home/runner/work/eslint-solid-crash-repro/eslint-solid-crash-repro/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/home/runner/work/eslint-solid-crash-repro/eslint-solid-crash-repro/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
error: "eslint" exited with code 2

To Reproduce

import { createSignal } from "solid-js";

export const createSome = () => {
  const [a] = createSignal("a" as string);

  return a;
};

repo

Expected behavior
no error

Environment (please complete the following information):

  • OS: Ubuntu 20.04 on WSL2
  • Node version (node --version): v18.18.2
  • eslint-plugin-solid version (npm list eslint-plugin-solid/yarn why eslint-plugin-solid): 0.13.2
  • eslint version (npm list eslint/yarn why eslint): 8.57.0

Additional context

  • I would be willing to contribute a PR to fix this issue
@noriapi noriapi added the bug Something isn't working label Mar 27, 2024
hymbz added a commit to hymbz/ComicReadScript that referenced this issue Mar 27, 2024
@JfrAziz
Copy link

JfrAziz commented Mar 28, 2024

confirm it, I also get this error when using as in context

nix6839 added a commit to nix6839/eslint-plugin-solid that referenced this issue Apr 4, 2024
nix6839 added a commit to nix6839/eslint-plugin-solid that referenced this issue Apr 4, 2024
@qeleb
Copy link

qeleb commented Apr 10, 2024

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants