-
-
Notifications
You must be signed in to change notification settings - Fork 666
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
New rule vue/quotes
#2187
Comments
Sounds good, thanks for the suggestion! This should be relatively easy, as we have a reusable function for wrapping core ESLint rules. Would you like to give it a try? See https://eslint.vuejs.org/developer-guide/#proposing-a-new-rule-or-a-rule-change. |
@FloEdelmann I didn't know there was a way to create custom rules. I'd like to try it, but it might take me a while to get to know it. I won't have time for that anytime soon, but maybe later I can help with the new rules. Thanks for the offer! |
Note that we may need to exclude warnings within directives. <template>
<img v-bind:title="$t(`foo`)" />
</template> |
Hi, I just wrote a rule for this, but since it's only for my personal use, the test cases are not comprehensive and only consider quotes in mustache tags. I haven't considered quotes within directives. Maybe you can use it as a reference :) |
@ota-meshi Why should directives be excluded from this rule? If one enables this rule to enforce using a specific quote style, that style should also be enforced in directives, shouldn't it? |
This is because using <template>
<img v-bind:title="$t(`foo`)" />
</template>
That's true. But in that case, I think we need to implement it ourselves. In other words, I don't think we can implement it by referring to |
Oh true, I missed that obvious fact 😅 Can we add a rule configuration option |
My guess is that it's probably easier to implement own rule than it is to extend the core rule 🤔 |
Tell us about your environment
The problem you want to solve.
This warning, but in vue tamplate:
Your take on the correct solution to problem.
Similar like: https://eslint.org/docs/latest/rules/quotes
The text was updated successfully, but these errors were encountered: