From cad9843bfbf5def27b1bc95ce53fdd692bff9e71 Mon Sep 17 00:00:00 2001 From: Greg Hurrell Date: Fri, 5 Feb 2021 11:55:49 +0100 Subject: [PATCH] docs(guidelines): provide more info about narrowing suppression scope Seeing as this came up in code review over here: https://github.com/liferay-frontend/liferay-portal/pull/746#discussion_r570879556 --- guidelines/dxp/linting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guidelines/dxp/linting.md b/guidelines/dxp/linting.md index 2b170b55f7..dfb2f0a0e2 100644 --- a/guidelines/dxp/linting.md +++ b/guidelines/dxp/linting.md @@ -76,7 +76,7 @@ As such, overrides need be applied using in-file comments of the form: Key points to note: - If a suppression is temporary, prefer downgrading it from an error to a warning rather than turning it off completely. In this way, it will continue to be visible but it won't cause CI runs to fail. -- If a suppression is permanent and the code cannot (or should not) be rewritten to avoid it, prefer narrowly scoped suppressions (eg. `eslint-disable-next-line` over `eslint-disable`). +- If a suppression is permanent and the code cannot (or should not) be rewritten to avoid it, prefer narrowly scoped suppressions. In other words, prefer more targeted suppressions like `eslint-disable-next-line` over `eslint-disable`, and make sure you always provide a specific rule name as opposed to a blanket suppression (eg. `eslint-disable-next-line no-console` over `eslint-disable-next-line`). Broader suppressions run the risk of masking more problems than the suppression originally intended. **NOTE:** Comments written with a leading `//` will not work: