Skip to content

Conversation

@luka-nextcloud
Copy link
Contributor

📝 Summary

  • Install @nextcloud/prettier-config
  • Install eslint-config-prettier
  • Format code with prettier

Signed-off-by: Luka Trovic <luka@nextcloud.com>
Copy link
Collaborator

@max-nextcloud max-nextcloud left a 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.

Comment on lines +240 to +241
(t) =>
t.status === STATUS_SCHEDULED || t.status === STATUS_RUNNING,
Copy link
Collaborator

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.

Comment on lines -11 to +22
return s.toString()
.split('&').join('&amp;')
.split('<').join('&lt;')
.split('>').join('&gt;')
.split('"').join('&quot;')
.split('\'').join('&#039;')
return s
.toString()
.split('&')
.join('&amp;')
.split('<')
.join('&lt;')
.split('>')
.join('&gt;')
.split('"')
.join('&quot;')
.split("'")
.join('&#039;')
Copy link
Collaborator

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.

Comment on lines -17 to +19
<NcActionButton v-for="type in taskTypes"
<NcActionButton
v-for="type in taskTypes"
Copy link
Collaborator

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.

Copy link
Member

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

@luka-nextcloud
Copy link
Contributor Author

@max-nextcloud I have checked through prettier config options. The only way to avoid line break is rising the value of printWidth. The current value is 85. I think it will work?
BTW, we can use // prettier-ignore to ignore formatting for any code block that we don't want to format.

@max-nextcloud
Copy link
Collaborator

I like the fact that prettier has so little options.
Maybe we can briefly discuss on Monday before moving the code over?

@juliusknorr
Copy link
Member

@luka-nextcloud What are the next steps here? Do we want to continue or close this?

@luka-nextcloud
Copy link
Contributor Author

@max-nextcloud @juliusknorr
I will close this PR and open a new one.

  • Install @nextcloud/prettier-config and eslint-config-prettier
  • Format code with prettier
  • Add flow .github/workflows/lint-prettier.yml
  • Remove flow .github/workflows/lint-stylelint.yml

@github-project-automation github-project-automation bot moved this from 🧭 Planning evaluation (don't pick) to ☑️ Done in 📝 Office team Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

stylelint broken after migrating from webpack to vite

4 participants