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

Contribution Setup #179

Open
nbelzer opened this issue Jul 31, 2020 · 1 comment
Open

Contribution Setup #179

nbelzer opened this issue Jul 31, 2020 · 1 comment

Comments

@nbelzer
Copy link
Collaborator

nbelzer commented Jul 31, 2020

As specified in #175:

nbelzer: I think contributors would greatly benefit from a linting setup for both of these languages as it would remove the need to try and replicate the same code style and would enhance readability of the code as all will have a similar structure.

danielcompton: Yep, this seems like a good idea. SwiftFormat and Prettier would be my preferences for formatting. I have a weak preference for ESLint for linting JS, I have no opinions on linting Swift.

Based on this I think we should implement a Github action (or two) and perhaps a pre-commit hook for linting both Swift and JavaScript code.

Next to this we should probably set up some contribution guidelines as there are currently none.

@nbelzer nbelzer changed the title Linting Contribution Setup Aug 22, 2020
@nbelzer
Copy link
Collaborator Author

nbelzer commented Aug 27, 2020

So these seem to be popular options for formatting and linting both Swift & JavaScript code:

Formatters

  • SwiftFormat :: (repo) seems to be a pretty advanced and mature formatter that can help enforce a chosen code style.
  • Prettier :: (website) can be used for any HTML, JavaScript, JSON and CSS we have. It is opinionated, simply enforcing a style to make sure we get on with our lives. An experimental plugin also exists for Swift.

Linting

  • ESLint :: (website) Seems to be a very standard choice for JavaScript linting.
  • SwiftLint :: (repo) Seems to be a very standard choice for Swift linting.

Personally I don't have a preference in terms of the configuration of these tools, I just prefer having them here as they make sure everyone adheres to a single style. I will try to set these tools up in the repo and see if there are any problems.

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

1 participant