commercetools / sunrise-spa

SUNRISE shop template as a single-page application
https://sunrise-spa.now.sh
Apache License 2.0
51 stars 78 forks source link

ESLint linebreak-style errors #221

Open johnpduane opened 3 years ago

johnpduane commented 3 years ago

I have a team experimenting with this repo and we are using a mix of Windows and Macs for development. If the Windows users touch any files, they get a linebreak-style error during the build portion of an npm run serve, for example:

image

There are straight-forward work-arounds but I think this issue should be addressed in your default branch as I assume this could be a blocker for newer users. Here are a few options to consider:

  1. Disable the lint rule by adding 'linebreak-style': 'off', to the repo's .eslintrc.js
  2. Add a .gitattributes file in the root of the repository per this guidance from github.
  3. Add a .editorconfig to the root of the repository to set end_of_line, see airbnb/javascript/.editorconfig for an example.
  4. Add instructions to your README for how to configure popular editors to set the end of line character you expect. For instance, for VSCode configure setting: "files.eol": "\n".

If you'd like me to submit a PR using any of these suggestions, I'm happy to do so.

harm-meijer commented 3 years ago

@johnpduane I'm leaning towards not using linter as a code formatter at all and remove all formatting rules from the linter (airbnb). Add prettier rules for code formatting but don't enforce them. The team working on the project can set format on save and external contributors code can be formatted on merge.