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: appease linter #990

Merged
merged 13 commits into from
Jun 25, 2024
Merged

Conversation

BlaineHeffron
Copy link
Contributor

@BlaineHeffron BlaineHeffron commented Jun 11, 2024

A number of fixes to remove the warnings and errors across the src/ directory of the project.

I noticed the src/.eslintrc.js files was not actually being used when running yarn fmt. Since yarn fmt only runs the linter in the src directory anyway, I just merged the src/.eslintrc.js file with the top level .eslintrc.js file.

Then, I added the settings below to be ignored. These were mostly minor docstring formatting complaints or some other trivial things like having spaces in comments.

 "jsdoc/require-param-type": 0,
 "jsdoc/require-returns-type": 0,
 "jsdoc/no-blank-blocks": 0, 
 "jsdoc/no-multi-asterisks": 0,
 "jsdoc/tag-lines": "off",
 "jsdoc/require-jsdoc": "off",
 "valid-jsdoc": "off",
 "import/extensions": 0,
"spaced-comment": 0,

I then fixed all other issues. The only logic changes are where functions contained for loops, I used iterators instead (e.g forEach, some, filter, etc). There was one case where I added eslint-ignore comments for a double nested for loop that was a bit more complicated so I just decided to leave it be.

Sometimes there were names prefixed with an underscore, in those cases I just removed the underscore.

@BlaineHeffron BlaineHeffron marked this pull request as ready for review June 11, 2024 18:53
config/tsconfig.json Outdated Show resolved Hide resolved
src/contract/spec.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@chadoh chadoh left a comment

Choose a reason for hiding this comment

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

Amazing!!! Thanks so much!

@Shaptic
Copy link
Contributor

Shaptic commented Jun 14, 2024

@BlaineHeffron I'm too scared to touch the test conflict 😅

@BlaineHeffron
Copy link
Contributor Author

Addressed @chadoh comments, performed rebase, and then added yarn fmt fixes after the rebase. The main fix applied after the rebase was a dependency cycle involving DEFAULT_TIMEOUT and NULL_ACCOUNT. I moved these to types.ts to fix the issue.

Copy link
Contributor

@chadoh chadoh left a comment

Choose a reason for hiding this comment

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

Looks great, let's get it in fast so we don't need to do it again!

Copy link
Contributor

@Shaptic Shaptic left a comment

Choose a reason for hiding this comment

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

There's so much going on here 😭 but I think I covered all of the bases. I'd feel more comfortable with keeping the WebAuth stuff unchanged for now for security reasons and reviewing that more carefully in a separate PR that aims to minimize the diff so that we can appropriately evaluate the changes. Could you reset that?

src/horizon/account_call_builder.ts Show resolved Hide resolved
src/horizon/account_response.ts Outdated Show resolved Hide resolved
src/horizon/call_builder.ts Outdated Show resolved Hide resolved
src/rpc/server.ts Outdated Show resolved Hide resolved
src/rpc/server.ts Show resolved Hide resolved
src/webauth/utils.ts Outdated Show resolved Hide resolved
src/webauth/utils.ts Outdated Show resolved Hide resolved
src/webauth/utils.ts Outdated Show resolved Hide resolved
@BlaineHeffron
Copy link
Contributor Author

Reverted webauth/utils.ts and addressed the other comments. Should be good to go.

Copy link
Contributor

@Shaptic Shaptic left a comment

Choose a reason for hiding this comment

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

LFG!

@chadoh
Copy link
Contributor

chadoh commented Jun 24, 2024

I think you need to merge, @Shaptic!

@Shaptic Shaptic merged commit b8430dd into stellar:master Jun 25, 2024
10 checks passed
@Shaptic Shaptic mentioned this pull request Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants