Skip to content

Commit

Permalink
Don't crash when encounter unknown node
Browse files Browse the repository at this point in the history
  • Loading branch information
nix6839 committed Apr 4, 2024
1 parent 06c6095 commit 6e8ae2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/rules/reactivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,7 @@ export default createRule<Options, MessageIds>({
this.skip(); // poor-man's `findInScope`: don't enter child scopes
}
},
fallback: "iteration", // Don't crash when encounter unknown node.
});
};

Expand Down
11 changes: 11 additions & 0 deletions test/fixture/valid/as-expression/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// @ts-nocheck
import { createSignal } from "solid-js";
import { render } from "solid-js/web";

function App() {
const [a] = createSignal("a" as string);

return <div>{a()}</div>;
}

render(() => <App />, document.getElementById("app"));

0 comments on commit 6e8ae2c

Please sign in to comment.