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

Add --report-unused-disable-directives to lint:eslint #1608

Merged
merged 2 commits into from
Dec 7, 2022

Conversation

kachkaev
Copy link
Contributor

@kachkaev kachkaev commented Dec 6, 2022

🌟 What is the purpose of this PR?

This PR makes sure that yarn lint:eslint does not exits with 0 if there are unused ESLint disable comments left in the codebase. These comments should be automatically removed on save because we have reportUnusedDisableDirectives: true in our base ESLint config. However, when we do bulk-edits, unused directives may remain as warnings and not fail the CI.

🔗 Related links

⚠️ Known issues

  • I had to remove --report-unused-disable-directives from packages/graph/clients/typescript/package.json. This package contains auto-generated files like index.ts because of which we need to make an exception. Local .eslintrc.cjs is already aware of this edge case, but unfortunately this config property is not yet synced with the CLI arg. Hope this can be fixed upstream via an RFC + PR.

🐾 Next steps

If there is support for reportUnusedDisableDirectives: "error" upstream, we can remove the CLI option.

🛡 What tests cover this?

I tested the option manually by adding // eslint-disable-next-line in a random place. yarn fix:eslint worked equally with and without the CLI option so I only added it for lint:eslint.

@nathggns nathggns merged commit 2bc27ad into main Dec 7, 2022
@nathggns nathggns deleted the ak/report-unused-disable-directives branch December 7, 2022 00:28
@vilkinsons vilkinsons added area/tests > integration New or updated integration tests type/eng > backend Owned by the @backend team and removed integration labels Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) area/apps > hash-realtime area/apps > hash-search-loader area/blocks Relates to first-party blocks (area) area/tests > integration New or updated integration tests area/tests > playwright New or updated Playwright tests type/eng > backend Owned by the @backend team type/eng > frontend Owned by the @frontend team
Development

Successfully merging this pull request may close these issues.

None yet

3 participants