eclipse-tractusx / portal-frontend

Portal Frontend
Apache License 2.0
4 stars 25 forks source link

chore: improve pre commit hook and prettier checks #874

Closed oyo closed 2 weeks ago

oyo commented 2 weeks ago

Description

Implement pre-commit hook the intended way

Why

The current pre-commit hook is poorly implemented because

this commit solves all the issues implementing the pre-commit hook the intended way nevertheless we also added pretty checks to the PR check pipeline breaking it in case of unformatted files.

Issue

n/a

Checklist

Please delete options that are not relevant.

evegufy commented 2 weeks ago

why are there so many new packages/dependencies added?

transitive from lint-staged package

oyo commented 2 weeks ago

why are there so many new packages/dependencies added?

@evegufy Only one dev dependency has been added - lint-staged. But it comes with many direct and indirect dependencies. This is a package that is only needed on the developer machine because it is executed before the commit. Maybe it's better to install this globally on the local machine because we don't need to download all those packages in the build pipelines. But then new developers might run into issues on their first commits.

sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

oyo commented 2 weeks ago

why are there so many new packages/dependencies added?

transitive from lint-staged package

Updated the PR: Husky now executes lint-staged through npx which avoids installing it and dependent packages during the pipeline runs.