Skip to content
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

Adopt Prettier for code style #815

Closed
VitGottwald opened this issue May 27, 2020 · 5 comments
Closed

Adopt Prettier for code style #815

VitGottwald opened this issue May 27, 2020 · 5 comments

Comments

@VitGottwald
Copy link
Contributor

Having a unified code style within a repository has many advantages:

  • The code becomes easier to read because it follows the same, predictable visual pattern
  • Easier onboarding. Anyone new to the project can rely on the formatting patterns and does not have to learn different styles in different files.
  • Pull requests do not show changes caused by reformatting code that did not actually change. This can happen accidentally or by using a different editor.
  • Easier code authoring. Developers can focus on the logical structure of their code without having to worry about formatting. The formatting tool takes care of that.
@VitGottwald
Copy link
Contributor Author

Currently our code base does not follow a unified code formatting style. For javascript and typescript codebases Prettier is the de-facto standard used by the majority of projects.

Lets’ adopt prettier for ZOWE Explorer.

@VitGottwald VitGottwald added this to the Developer milestone May 27, 2020
@phaumer
Copy link
Member

phaumer commented May 31, 2020

I converted the FTP extension to eslint with prettier here. If people like this approach then we can apply the same here, but a lot of fixing will be required, which could be a good thing.

https://github.com/zowe/zowe-explorer-ftp-extension/tree/add-eslint-prettier-support

@VitGottwald
Copy link
Contributor Author

Thank you @phaumer for taking the initiative. I completely agree. Let's discuss it in your PR for the FTP plugin and once merged and tested, we can then come up with a suggestion for this repo.

@phaumer
Copy link
Member

phaumer commented Jun 12, 2020

We we had a really good discussion in zowe/zowe-explorer-ftp-extension#3 and zowe/zowe-explorer-ftp-extension#4

and have a proposal for a starting point for this repo as well: https://github.com/zowe/zowe-explorer-ftp-extension

Next steps:

  • go through specific rules we want to enable
  • plan a transition strategy for updating our code base as getting the ideal set of rules will be a slow process of updating the code case by case. We can discuss using warning and switching rules gradually over time.

@VitGottwald
Copy link
Contributor Author

VitGottwald commented Jun 12, 2020

Thank you @phaumer for leading this effort! I think we can break this down a bit more.

The very first step can be reformatting the codebase with prettier without enabling any new linting rules. This will require only minimal manual effort.

Then we can continue a separate discussion as you suggested in next steps. Perhaps in a separate issue dedicated to linting rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants