You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'd like to disable some rules for template expressions only - typically rules about typescript. Example:
<buttononClick={() => {clicked+=1}}>Increment</button> // HERE
<scriptlang="ts">
function fn() { // HEREreturn3;}
</script>
With my current configuration, I get the error Missing return type on function (@typescript-eslint/explicit-function-return-type) on the two lines marked by comments. This is problematic, because I can't use TS in template expressions and therefore I can't add a return type annotation to the first line of my snippet. However, I would still like to have the rule turned on for the second case, where it correctly reports that I forgot to add the return type annotation.
Currently, I found no way of doing this other than manually ignoring all the "false positives" or getting rid of any non-trivial template expressions - I would like to have a way to say to eslint that the rule @typescript-eslint/explicit-function-return-type should be turned off for all template expressions, however it should still check <script /> blocks.
The text was updated successfully, but these errors were encountered:
Hi,
thanks for the reply and the pointer - I read the docs but thought this would ignore warnings in all svelte code, not just teplate expressions - maybe I'll submit a PR to make it more obvious :)
However, this does not work for me :( See the repro, run npm run lint:ts:eslint - I would expect one error, but I get two. Is this an issue on my side?
Description
Hi,
I'd like to disable some rules for template expressions only - typically rules about typescript. Example:
With my current configuration, I get the error
Missing return type on function
(@typescript-eslint/explicit-function-return-type
) on the two lines marked by comments. This is problematic, because I can't use TS in template expressions and therefore I can't add a return type annotation to the first line of my snippet. However, I would still like to have the rule turned on for the second case, where it correctly reports that I forgot to add the return type annotation.Currently, I found no way of doing this other than manually ignoring all the "false positives" or getting rid of any non-trivial template expressions - I would like to have a way to say to eslint that the rule
@typescript-eslint/explicit-function-return-type
should be turned off for all template expressions, however it should still check<script />
blocks.The text was updated successfully, but these errors were encountered: