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

chore: Adds eslint rules in eslintrc #3173

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

konstantinabl
Copy link
Collaborator

@konstantinabl konstantinabl commented Oct 29, 2024

Description:

This PR adds relevant rules to the .eslintrc.js file, adds lint script to package.json in different packages and adds eslint to husky hook
This is much needed to ensure good practices are followed, as well as styling and formatting of the code

Related issue(s):

Fixes #3064

…r running pre commit hook

Signed-off-by: Konstantina Blazhukova <[email protected]>
@konstantinabl konstantinabl linked an issue Oct 29, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Oct 29, 2024

Test Results

 20 files  ± 0  279 suites  +18   36m 4s ⏱️ - 2m 39s
605 tests ± 0  597 ✅ + 4  4 💤 ±0  4 ❌  - 4 
786 runs  +65  777 ✅ +72  4 💤 ±0  5 ❌  - 7 

For more details on these failures, see this check.

Results for commit 3b0d0ac. ± Comparison against base commit c73d7cd.

This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
"before all" hook in "@precompile-calls Tests for eth_call with HTS" ‑ RPC Server Acceptance Tests Acceptance tests @precompile-calls Tests for eth_call with HTS "before all" hook in "@precompile-calls Tests for eth_call with HTS"
"before each" hook for "@release should execute "eth_getBalance" for contract with id converted to evm_address" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-2 RPC Server Acceptance Tests "before each" hook for "@release should execute "eth_getBalance" for contract with id converted to evm_address"

♻️ This comment has been updated with latest results.

@konstantinabl konstantinabl changed the title Adds eslint hook to be ran before committing chore: Adds eslint hook to be ran before committing Oct 30, 2024
Copy link

sonarcloud bot commented Oct 30, 2024

@konstantinabl konstantinabl marked this pull request as ready for review October 30, 2024 20:50
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

.eslintrc.js Show resolved Hide resolved
Copy link
Member

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful! Thanks for doing this!

Q: So now will it automatically lint the whole codebase or do I still have to manually run the lint command?

@quiet-node quiet-node added the Internal For changes that affect the project's internal workings but not its outward-facing functionality. label Oct 30, 2024
@quiet-node quiet-node added this to the 0.60.0 milestone Oct 30, 2024
@konstantinabl
Copy link
Collaborator Author

Wonderful! Thanks for doing this!

Q: So now will it automatically lint the whole codebase or do I still have to manually run the lint command?

@quiet-node yes, currently its not automatic yet, i will do the eslint --fix in a separate pr together with the hook that will fix linting issues before each commit. Its better to do it this way in order to not flood this PR with changes

@konstantinabl konstantinabl changed the title chore: Adds eslint hook to be ran before committing chore: Adds eslint rules in eslintrc Oct 31, 2024
@konstantinabl konstantinabl merged commit d6fece1 into main Oct 31, 2024
45 of 47 checks passed
@konstantinabl konstantinabl deleted the 3064-add-eslint-to-be-run-pre-commit branch October 31, 2024 08:26
Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.39%. Comparing base (ef9d696) to head (3b0d0ac).
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3173      +/-   ##
==========================================
+ Coverage   82.58%   83.39%   +0.81%     
==========================================
  Files          69       66       -3     
  Lines        4438     4283     -155     
  Branches      870      835      -35     
==========================================
- Hits         3665     3572      -93     
+ Misses        527      471      -56     
+ Partials      246      240       -6     
Flag Coverage Δ
config-service 98.14% <ø> (ø)
relay 85.60% <ø> (+0.02%) ⬆️
server 83.52% <ø> (ø)
ws-server 36.87% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 14 files with indirect coverage changes

belloibrahv pushed a commit to belloibrahv/hedera-json-rpc-relay that referenced this pull request Oct 31, 2024
* Adds linting rules and lint script to all the packages; foundation for running pre commit hook

Signed-off-by: Konstantina Blazhukova <[email protected]>

* Removes license header rule and uninstalls unecessary plugin

Signed-off-by: Konstantina Blazhukova <[email protected]>

---------

Signed-off-by: Konstantina Blazhukova <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal For changes that affect the project's internal workings but not its outward-facing functionality.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add eslint to be run pre-commit
3 participants