halstack-react icon indicating copy to clipboard operation
halstack-react copied to clipboard

Code Quality Update

Open Mil4n0r opened this issue 1 year ago • 1 comments

Checklist (Check off all the items before submitting)

  • [ ] Build process is done without errors. All tests pass in the /lib directory.
  • [ ] Self-reviewed the code before submitting.
  • [ ] Meets accessibility standards.
  • [ ] Added/updated documentation to /website as needed.
  • [ ] Added/updated tests as needed.

Description We want to follow the best practices and achieve a higher code quality by using automatic tools (Husky, Prettier, ESLint and Staged-Lint). This PR contains both the setup of the tools and the fix of most existing code quality issues.

The goal to achieve is to remove all the custom rules existing in the eslint configuration file and pass with no errors and no warnings.

Closes #2031, #2043

Mil4n0r avatar Jul 08 '24 12:07 Mil4n0r

I realised that "Error Lens" VSCode extension was detecting problem that ESLint wasn't. This is due to ESLint only checking syntax, making it needed to use another tool to check types and list the errors related to typescript compilation.

In order to achieve this tsc --noemit could be added to the lint script in packages/lib. If I do this a lot of warnings are triggered, however those affect only storybook and jest files AFAIK, so there should be no problem, but it's something that could be added in the future.

Mil4n0r avatar Sep 18 '24 09:09 Mil4n0r