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

add prettier config #71

Closed
beeglebug opened this issue Aug 17, 2022 · 4 comments
Closed

add prettier config #71

beeglebug opened this issue Aug 17, 2022 · 4 comments

Comments

@beeglebug
Copy link
Collaborator

From experience, prettier is the nicest solution to keeping a clean, consistently formatted codebase while removing any possible arguments about the details. It's used by thousands of other open source JS projects, so contributors will be familiar with it.

We could auto format everything once in a single cleanup commit and be done with it, most modern IDE's will handle prettier automatically and format on save.

We can then strip out most of the eslint config (certainly any bits pertaining to code formatting).

@bhouston
Copy link
Owner

I had eslint doing cleanup on save in VSCode with all of the auto-formatting. I think you removed this file that enabled that:

https://github.com/bhouston/behave-graph/blob/e596cf818bf034a66b66e9b87c3ca0f46c23eb1f/.vscode/settings.json

Could we just re-enable that? Then this task is done and we do not need prettier.

@bhouston
Copy link
Owner

Here is your commit where you removed this: 684df3d

@bhouston
Copy link
Owner

I've added back auto-formatting via es-lint on save here: https://github.com/bhouston/behave-graph/blob/main/.vscode/settings.json

@beeglebug
Copy link
Collaborator Author

The problem with this approach is firstly that vscode settings file is a userland file and not really intended for sharing between developers (and obviously only works for people with vscode).

Secondly eslint is not really a code formatter, it can highlight code issues, but it's slightly out of scope to handle spacing, braces etc. That's where prettier comes in. Ideally we would use both, and let them do their own things.

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

2 participants