-
-
Notifications
You must be signed in to change notification settings - Fork 77
Some @typescript-eslint rules doesn't work in vue files #40
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
Comments
Thank you for this report. This is a tough problem. Hmm. Possibly, this parser can tell the typescript parser (instead of rules) something. We need to discuss with typescript-eslint team. |
Hey @mysticatea, thanks for looking into this. Just checking in to see if anyone had a chance to discuss this with the typescript-eslint team already? |
The |
This should be resolved with |
I close this issue. If you have any problems, please open a new issue or follow another related issue. |
Some rules in @typescript-eslint check if the file name ends with
.ts
to determine if the rule should be run or not, because they don't apply to.js
files.For example, if I have this code:
If I place it in a
.ts
file, I will get a warning from@typescript-eslint/explicit-function-return-type
. However, if I place it in a<script lang="ts">
block of a.vue
file, this warning does not appear. This is because @typescript-eslint checks the file ending, and since it is.vue
and not.ts
, the rule isn't run.Is there some other way @typescript-eslint could check if the code is typescript, other than by the file extension? How can it differentiate between
.vue
files which specifylang="ts"
and those that don't?Here is where @typescript-eslint does this check:
https://github.com/typescript-eslint/typescript-eslint/blob/7be56570de9d1983af95db5900ec730930d52712/packages/eslint-plugin/src/rules/explicit-function-return-type.ts#L83
https://github.com/typescript-eslint/typescript-eslint/blob/7be56570de9d1983af95db5900ec730930d52712/packages/eslint-plugin/src/util/misc.ts#L11-L13
The text was updated successfully, but these errors were encountered: