signoz icon indicating copy to clipboard operation
signoz copied to clipboard

removed '@typescript-eslint/no-shadow': 'off' rule

Open Aakarshan-369 opened this issue 1 year ago • 7 comments

removing the second instance of no-shadow: 'off' rule as mentioned in #2089

Aakarshan-369 avatar Jan 23 '23 11:01 Aakarshan-369

Welcome to the SigNoz community! Thank you for your first pull request and making this project better. 🤗

welcome[bot] avatar Jan 23 '23 11:01 welcome[bot]

@palashgdev I removed the @typescript-eslint/no-shadow': 'off' rule and I am getting a lot of error 'event' is already declared in the upper scope error from the no-shadow checks after I run the run lint command in the dev env.
I'm checking up on the no-shadow documentation. Any other way to resolve this? Thanks!

Aakarshan-369 avatar Jan 23 '23 12:01 Aakarshan-369

Maybe changing the name ?

palashgdev avatar Jan 23 '23 13:01 palashgdev

@palashgdev I checked and the no-shadow issue is present in multiple files (caused by same-name variables). Just like you suggested I think the solution is to rename all instances of locally scoped variables to not match the global one. I think the files which need this change were throwing the scope error in the Run ESLint of the build-frontend process image I hope I'm on the right track here. Thanks!

Aakarshan-369 avatar Jan 23 '23 16:01 Aakarshan-369

Yup you are on the right track ! but would be good to have a right and meaningful name...

palashgdev avatar Jan 23 '23 19:01 palashgdev

Hi @palashgdev It took some time but I managed to eliminate the @typescript-eslint/no-shadow': 'off' I essentially renamed all the local instances of variables not to match the global one. I ran npm run lint and got no errors in my dev environment. I tried building using yarn dev and it seems to work fine.

The Quality Gate test is failing and I'm not sure how to resolve it, I would really appreciate any feedback and further changes needed for this to work :)

Thanks so much! I'm learning so much from the codebase :) 👍

Aakarshan-369 avatar Jan 30 '23 13:01 Aakarshan-369

Right now we are not looking into sonar analysis you can skip that one but in future we will

palashgdev avatar Jan 31 '23 03:01 palashgdev

Thanks for the review! Understood the sonar check part.

Anything else that needs work in this PR?

One thing I noticed while working on this was that the linebreak rule in elintjs is not working properly in detecting my windows os (it threw around 40k linebreak errors). On my linux env it wasn't a problem.

Aakarshan-369 avatar Jan 31 '23 06:01 Aakarshan-369

Sure there are some place in which we can give better name will review after some time

palashgdev avatar Jan 31 '23 11:01 palashgdev

@Aakarshan-369 Please resolve merge conflicts

makeavish avatar Feb 06 '23 05:02 makeavish

@makeavish working on it 👍

Aakarshan-369 avatar Feb 06 '23 06:02 Aakarshan-369

@Aakarshan-369 I tried to review your PR and offered some suggestions for variable names. If you think we can do better, we can talk about that.

palashgdev avatar Feb 10 '23 10:02 palashgdev

@palashgdev Thanks for the Review! After correcting all the ESlint no-shadow issue I was trying to resolve this build error, https://github.com/SigNoz/signoz/actions/runs/4053750779/jobs/6974737091 I have reverted those changes and resolved a few merge conflicts. Now working on updating a few variable names again. Which files do you think renaming? I'm thinking eParam and treeParam and similar variables need better naming.

Aakarshan-369 avatar Feb 10 '23 11:02 Aakarshan-369

Hi! @palashgdev thanks for the review and suggestions! I have made the changes as needed and as you suggested. I'm curious to know if more changes or updates are needed. Thanks :)

Aakarshan-369 avatar Feb 22 '23 15:02 Aakarshan-369

Hi! @palashgdev thanks for the review and suggestions! I have made the changes as needed and as you suggested. I'm curious to know if more changes or updates are needed. Thanks :)

Thanks @Aakarshan-369 let me go through it

palashgdev avatar Feb 23 '23 14:02 palashgdev

Hi @palashgdev sir, I have resolved a few merge conflicts and removed the newer lint errors. I am looking forward to knowing if more updates or changes need to be made. Thanks! :)

Aakarshan-369 avatar Mar 04 '23 16:03 Aakarshan-369

Also @Aakarshan-369 please resolve the conservation which are resolved it is easier to track

palashgdev avatar Mar 09 '23 10:03 palashgdev

You have successfully added a new SonarCloud configuration ``. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.

@palashgdev Apologies sir for the long hiatus, I've left comments in the code review and would love to know what further work is needed. Thanks!

Aakarshan-369 avatar Mar 26 '23 10:03 Aakarshan-369

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
5.0% 5.0% Duplication

sonarcloud[bot] avatar Mar 30 '23 16:03 sonarcloud[bot]

Hi @palashgdev sir, should I make the necessary changes to the variable names as mentioned by me in the code review above? Maybe that would resolve all the issues. Thanks!

Aakarshan-369 avatar Apr 06 '23 06:04 Aakarshan-369

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 21 '23 07:04 CLAassistant