-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
prefer-includes
not working in vue templates
#2508
Comments
Correct me if I'm wrong, but this should likely be handled by your parser plugin, not by each rule. If the parser provides |
In the case of rules like I attempted to wrap the Here is a minimal reproducible example I set up, which I hope will be helpful for verifying the issue: https://stackblitz.com/edit/vitejs-vite-hcr8hmge?file=.eslintrc.cjs,src/App.vue&terminal=dev |
Is it possible that it's obsolete code? The plugin itself seems to support of parsing the template string as JS: https://www.npmjs.com/package/vue-eslint-parser Anyway reopening in case someone knows more, e.g. @ota-meshi |
To avoid false positives from other plugin rules, the rule implementation is designed not to traverse |
I added the rule
'unicorn/prefer-includes': 'error'
to my project, which checks for and replaces.indexOf()
with.includes()
. While this works properly within the<script>
block of a Vue SFC, it fails to detect issues within the<template>
block.I attempted to add
checkVueTemplate
to theprefer-includes.js
rule to catch errors within the<template>
block. However, I encountered issues with the automatic fixes not working as expected. Is there a way to resolve this problem?The text was updated successfully, but these errors were encountered: