datopian / playbook

MOVED: this content was moved to https://datopian.com/playbook. Datopian Team Playbook 📕 https://playbook.datopian.com/
https://playbook.datopian.com
8 stars 8 forks source link

husky + lint-staged - discussion #8

Open mariorodeghiero opened 3 years ago

mariorodeghiero commented 3 years ago

This issue is about using husky + lint-staged, with these tools you can keep the pattern fixing the code style (using prettier + eslint) and check if the tests are passing before the commit. But if needed you can skip it by adding a flag at the end of the commit.

There is um question about should this be done (linting) in the developer's machine or in the CI?

Links to the libraries:

cc: @rufuspollock @anuveyatsu

leomrocha commented 3 years ago

Just to start with some discussion:

We are currently using a linter and prettier but in a local configuration, this is nice as every time we save on VSCode it auto-formats. The current configuration is often shared in the repo (not the best thing to do, but it works). Some examples are in the .prettier* files in data-api. Also it can be configured for vscode in the .vscode config files .vscode/settings.json like:

{
  // Set the default
  "editor.formatOnSave": true,
  // Enable per-language
  "[javascript]": {
    "editor.formatOnSave": true
  },
  "editor.defaultFormatter": "esbenp.prettier-vscode"
}

(credits @EvgeniiaVak )

The issue here is that there is no formatting check automatically done in the repo side. We do have some Dockerfiles that have a prettier check only, would be nice to