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

feat: add eslint, prettier and editorconfig #166

Merged
merged 6 commits into from
Jun 30, 2024

Conversation

cyrdam
Copy link
Contributor

@cyrdam cyrdam commented Dec 14, 2023

This is a fix for #163

Added:

  • eslint + config
  • prettier + config
  • editorconfig

@simonh1000 simonh1000 self-requested a review December 14, 2023 09:33
@simonh1000
Copy link
Owner

Thansk,hopefully will have some time around xmas to review

@cyrdam
Copy link
Contributor Author

cyrdam commented Jan 29, 2024

Here is an update on the PR:

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

@cyrdam
Copy link
Contributor Author

cyrdam commented Mar 27, 2024

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

@simonh1000
Copy link
Owner

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 🤷

@cyrdam
Copy link
Contributor Author

cyrdam commented Jun 27, 2024

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.

@simonh1000 simonh1000 merged commit 149f6dc into simonh1000:master Jun 30, 2024
@cyrdam cyrdam deleted the feature/prettier-eslint branch July 17, 2024 08:25
This was referenced Jul 17, 2024
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

Successfully merging this pull request may close these issues.

2 participants