-
Notifications
You must be signed in to change notification settings - Fork 92
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
chore: install @nextcloud/prettier-config, eslint-config-prettier #6510
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Luka Trovic <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this @luka-nextcloud
I'm all for standardizing things and linting them. I'll point out a few things that i am not so sure about though.
(t) => | ||
t.status === STATUS_SCHEDULED || t.status === STATUS_RUNNING, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like splitting the arrow function like this. Maybe just personal taste.
return s.toString() | ||
.split('&').join('&') | ||
.split('<').join('<') | ||
.split('>').join('>') | ||
.split('"').join('"') | ||
.split('\'').join(''') | ||
return s | ||
.toString() | ||
.split('&') | ||
.join('&') | ||
.split('<') | ||
.join('<') | ||
.split('>') | ||
.join('>') | ||
.split('"') | ||
.join('"') | ||
.split("'") | ||
.join(''') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the previous version as these calls come im pairs of split(..).join(...)
and that's easier to see in the original.
Normally I would agree that it's a good idea to put every function call on a new line... But here I don't. So I wonder if the rule that enforces this is really a good idea.
<NcActionButton v-for="type in taskTypes" | ||
<NcActionButton | ||
v-for="type in taskTypes" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think pretty much everywhere else in nextcloud we have the first attribute on the line with the tag name just like this was before.
I actually like the separation - but I care about consistency more. So not sure what best to do here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, we should avoid custom rules like this. If we consider them useful, we should propose them upstream to our shared prettier config
@max-nextcloud I have checked through prettier config options. The only way to avoid line break is rising the value of |
I like the fact that prettier has so little options. |
📝 Summary