openfoodfacts / openfoodfacts-nodejs

Official Node package for Open Food Facts
https://openfoodfacts.github.io/openfoodfacts-nodejs/
Apache License 2.0
148 stars 27 forks source link

chore: add prettier and eslint configuration, format files and update CI to check lint and format #537

Closed bengeois closed 3 weeks ago

bengeois commented 1 month ago

When developing other PR on this project I've found some improvements to propose to project's linting and formatting configuration to ensure consistency across future contributions.

What Added Prettier configuration file: This ensures that the expected formatting rules are clearly defined and will not rely on Prettier's default values, which may change in future updates.

Updated ESLint configuration for v9 upgrade:

Lint and Prettier checks added to CI: The CI pipeline has been updated to include both lint and Prettier checks. This ensures that all future pull requests will comply with the defined coding standards and formatting, preventing unintentional formatting changes.

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

VaiTon commented 3 weeks ago

This PR includes too many changes. Can we split it up somehow?

bengeois commented 3 weeks ago

Hi @VaiTon, most of the changes if about file format because the prettier and eslint configs are now take into account. I can separate eslint and prettier but one of both will contain lots of changes too. Let me know

VaiTon commented 3 weeks ago

@bengeois there is a commit about GH workflows, then commits about changes in packages.json, then actual formatting. We can at least split this in 3 PR if you don't mind