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

Resolve eslint warnings #281

Open
lenkan opened this issue Sep 26, 2024 · 1 comment
Open

Resolve eslint warnings #281

lenkan opened this issue Sep 26, 2024 · 1 comment
Labels
improvement Improvement to the codebase

Comments

@lenkan
Copy link
Collaborator

lenkan commented Sep 26, 2024

Currently, there are a few hundred eslint warnings reported in this repository. They were initially errors, but degraded to warnings just to get started with eslint.

I think it is a good idea to fix all these issues and upgrade all of these rules to report as errors. See the list of rules here:

signify-ts/.eslintrc

Lines 10 to 30 in 5801e63

// These are files with more lenient lint config because they have not been "fixed" yet
// Once a directory here is fixed, it should be removed from here so the strict rules applies
"files": [
"src/keri/app/**",
"src/keri/core/**",
"src/keri/end/**",
"examples/integration-scripts/**"
],
"rules": {
"prefer-const": "warn",
"no-var": "warn",
"no-self-assign": "warn",
"no-case-declarations": "warn",
"no-constant-condition": "warn",
"no-empty": "warn",
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-namespace": "warn",
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/no-unused-vars": "warn"
}
.

Also their documentation and rationale here:

I would rather not make this a discussion item for each and every rule. I think we should just accept the eslint "recommended" rules and go with it. I created two PRs previously that resolves some of these errors:

I also have a third one that resolves all the errors in the /core directory, but I will not keep going with it unless there is interest from the community to get them resolved.

Personally I think it is a good idea to fix these issues as it will force proper use of Typescript and Javascript. It will also force us to provide types, which will make the use of the library much easier. If you agree, please say so in the comments. If you are a reviewer and agree, please review the PRs mentioned above so we can get it going.

@iFergal
Copy link
Contributor

iFergal commented Sep 26, 2024

Completely agree and think this is long overdue, thank you for taking the time to do this!

I'm not a maintainer but I did check out both PRs and they look good to me. @rodolfomiranda can you take a look sometime?

@lenkan lenkan added the improvement Improvement to the codebase label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement to the codebase
Projects
None yet
Development

No branches or pull requests

2 participants