dxc-technology / halstack-react

Library of components for building SPAs with React and Halstack Design System
https://developer.dxc.com/halstack/
Apache License 2.0
15 stars 14 forks source link

Code Quality Update #2033

Open Mil4n0r opened 2 months ago

Mil4n0r commented 2 months ago

Checklist (Check off all the items before submitting)

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 commented 1 week ago

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.