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

Move all linter rules to eslint #1459

Open
1 task done
wemeetagain opened this issue Feb 5, 2024 · 1 comment · May be fixed by #1513
Open
1 task done

Move all linter rules to eslint #1459

wemeetagain opened this issue Feb 5, 2024 · 1 comment · May be fixed by #1513

Comments

@wemeetagain
Copy link
Member

wemeetagain commented Feb 5, 2024

Currently we have linter rules defined both in tsconfig.json, handled by the typescript compiler AND linter rules defined in the eslint config, handled by eslint.

The typescript linter rules are really annoying devex, as they prevent building and experimenting with working code because of linter errors.

Describe the solution you'd like

  • Replace all typescript linter rules with eslint linter rules

Additional context

// linter checks
"noImplicitReturns": false,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": false,

achingbrain pushed a commit to ipfs/eslint-config-ipfs that referenced this issue May 1, 2024
- See ipfs/aegir#1459

Aegir currently relies on typescript to perform two linter rules, which is annoying for reasons mentioned in the above issue.
- `noFallthroughCasesInSwitch`
- `noUnusedLocals`

This PR makes typescript rules more strict to enforce both of these conditions.

For `noFallthroughCasesInSwitch`, it appears that the `standard` eslint rule set [already includes](https://github.com/standard/eslint-config-standard/blob/master/src/index.ts#L143) the [`no-fallthrough`](https://eslint.org/docs/latest/rules/no-fallthrough) rule.
So this PR only needs to enforce `noUnusedLocal`, and we just add [`@typescript-eslint/no-unused-vars`](https://typescript-eslint.io/rules/no-unused-vars/).
@achingbrain
Copy link
Member

@wemeetagain the PR to eslint-config-ipfs has shipped so you should be all good to PR your changes here 👍

@wemeetagain wemeetagain linked a pull request May 1, 2024 that will close this issue
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 a pull request may close this issue.

2 participants