ftp-deploy icon indicating copy to clipboard operation
ftp-deploy copied to clipboard

feat: add eslint, prettier and editorconfig

Open cyrdam opened this issue 1 year ago • 3 comments
trafficstars

This is a fix for #163

Added:

  • eslint + config
  • prettier + config
  • editorconfig

cyrdam avatar Dec 14 '23 09:12 cyrdam

Thansk,hopefully will have some time around xmas to review

simonh1000 avatar Dec 14 '23 09:12 simonh1000

Here is an update on the PR:

  • updated: dependencies
  • updated: eslint config
  • fixed: issues with linter and formatter

cyrdam avatar Jan 29 '24 07:01 cyrdam

I fixed an unused variable within a unit test. Can you check it out, @simonh1000?

cyrdam avatar Mar 27 '24 10:03 cyrdam

Apologies for the delays. I forget about these things, but the underlying issue is that I do not use eslint nor editorconfig so reveiwing first mans learnign what they are and then deciding whether I want them in the repo. And that's when I don't even get started 🤷

simonh1000 avatar Jun 27 '24 08:06 simonh1000

Hi, no problem, as time has passed, I've updated to the latest changes in these tools. Here's a list of what you can use them for and how they can assist you:

Tools

editorconfig

This is utilized by IDEs when the plugin is activated, or by default, and aids in setting project-specific configurations such as line-ending formats, using tabs or spaces, etc. It automates what your editor would do based on your settings, but in a different editor, too.

prettier

This tool formats your code according to a predefined style guide. It ensures consistent code formatting without manual corrections. It also encompasses the options from editorconfig, ensuring consistency across IDEs/editors. This way, there are no conflicts between tabs and spaces, and it adheres to your preferred format.

eslint

It identifies issues in your code, such as unused variables (refer to the file in my PR: test/server.js). It also supports best practices that you can enable, but that requires more research into how you wish to construct your code and manage code quality. The default/recommended rules work fine.

While it can assist with formatting, I recommend separating formatting and linting into distinct steps for those specific tools.

Quality gate and workflow

These tools aid developers in maintaining consistency with your defined code quality standards. They enhance the overall process and checks. These tools are optional unless you establish a quality gate within your guidelines or pipeline/GitHub Actions (eslint and prettier, while editorconfig is only functional in IDEs/editors).

I suggest at least using eslint, as it is instrumental in resolving code issues.

cyrdam avatar Jun 27 '24 11:06 cyrdam