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

Typescript rules do not apply to Typescript in Vue SFCs #107

Closed
onebytegone opened this issue Dec 17, 2024 · 0 comments · Fixed by #108
Closed

Typescript rules do not apply to Typescript in Vue SFCs #107

onebytegone opened this issue Dec 17, 2024 · 0 comments · Fixed by #108

Comments

@onebytegone
Copy link
Contributor

While some linting rules are being applied to Typescript in Vue SFCs, the typescript-specific rule definitions are not.

Test case

$ cat test-cases/vue/ExampleTypescriptComponent.vue
<template>
   <div>
      <h1>Hello World</h1>
   </div>
</template>

<script setup lang="ts">
// Should error with:
// An empty interface is equivalent to `{}`. eslint@typescript-eslint/no-empty-interface
interface MyInterface {}

// Should error with:
// Expected a space after the ':'. eslint@typescript-eslint/type-annotation-spacing
const myVar:MyInterface = {};

console.log(JSON.stringify(myVar));
</script>

Results

image

Errors as expected in TS file

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant