Skip to content

Commit 4d4890c

Browse files
Merge pull request Expensify#90297 from Expensify/rory-update-consistency-5-eslint-disable
[No QA] docs: update CONSISTENCY-5 to clarify eslint-disable vs SEATBELT_INCREASE
2 parents 1f6cc0e + ccfeaf3 commit 4d4890c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.claude/skills/coding-standards/rules/consistency-5-justify-eslint-disable.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ title: Justify ESLint rule disables
77

88
### Reasoning
99

10-
ESLint rule disables without justification can mask underlying issues and reduce code quality. Clear documentation ensures team members understand exceptions, promoting better maintainability.
10+
`eslint-disable` comments completely hide violations from the seatbelt baseline — they will never be fixed unless the comment is removed. Because of this, they should only be used for **permanent** suppressions where you are certain the rule genuinely does not apply to that specific case and you don't expect the violation to ever be fixed.
11+
12+
For **temporary** suppressions (e.g. the fix requires a large refactor that is out of scope), prefer widening the seatbelt baseline with `SEATBELT_INCREASE` instead — that keeps the violation visible so it can still be fixed later. See [`LINTING.md`](../../../../contributingGuides/LINTING.md) for full guidance on choosing between the two approaches.
13+
14+
When `eslint-disable` is used, a justification comment is required so that reviewers and future maintainers understand why the rule was deliberately suppressed.
1115

1216
### Incorrect
1317

@@ -37,6 +41,10 @@ Flag ONLY when ALL of these are true:
3741
- An ESLint rule is disabled (via `eslint-disable`, `eslint-disable-next-line`, etc.)
3842
- The disable statement lacks an accompanying comment explaining the reason
3943

44+
**Also consider flagging if:**
45+
46+
- `eslint-disable` is used for what appears to be a temporary/convenience suppression — in those cases, suggest `SEATBELT_INCREASE` as the preferred alternative (see [`LINTING.md`](../../../../contributingGuides/LINTING.md))
47+
4048
**DO NOT flag if:**
4149

4250
- The disablement is justified with a clear comment explaining why the rule is disabled

0 commit comments

Comments
 (0)