-
-
Notifications
You must be signed in to change notification settings - Fork 681
script-indent does not work properly with the ternary operator #625
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
I confirmed it. Btw. why would you style your code like this? Wouldn't this be a little bit more readable? {
imgUrl: hours > 21 || hours < 6
? 'night.png'
: 'day.png',
} Or even better: export default {
data() {
const hours = new Date().getHours();
const isNight = hours > 21 || hours < 6;
return {
imgUrl: isNight ? 'night.png' : 'day.png',
};
},
} |
@mysticatea would you give it a look? You're most proficient with indent-related matter. |
I will do. Sorry for my delay! |
No worries @mysticatea :) For your convenience I assigned you to issues where your help would be the most vital: https://github.com/vuejs/eslint-plugin-vue/issues/assigned/mysticatea |
Tell us about your environment
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
I expect the code to be successfully linted.
What actually happened? Please include the actual, raw output from ESLint.
Additional notes
I was able to reproduce the issue in the playground: follow this link
Additionally, if I change the JS code from:
to
The the lint validation succeeds. Here is a playground link for a fixed case
The text was updated successfully, but these errors were encountered: