Skip to content

Commit

Permalink
fix: Allow TSAsExpression for useFunctions (#4229)
Browse files Browse the repository at this point in the history
* allow_TSAsExpression

* update tests
  • Loading branch information
Wimpert authored May 17, 2023
1 parent 5ee3fb7 commit 3caabe6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/eslint-plugin-qwik/qwik.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ export const HelloWorld = component$(async () => {
return <div></div>
});
});`,
`export const HelloWorld = component$(async () => {
const test = useFunction() as string;
});
`,
],
invalid: [
{
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin-qwik/src/useMethodUsage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const useMethodUsage: Rule.RuleModule = {
case 'Property':
case 'ObjectExpression':
case 'CallExpression':
case 'TSAsExpression':
break;
case 'ArrowFunctionExpression':
case 'FunctionExpression':
Expand Down

0 comments on commit 3caabe6

Please sign in to comment.