facebook / facebook/flow

Allow changing the "unused suppression comment" lint severity to "error"

Open
#6,891 2 comments 15 reactions 0 assignees View on GitHub
linter
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Currently it is possible to change the severity of all lints except for the "unused suppression comment" lint. I guess that stems from the fact that suppression linting was developed prior to the concept of other lints and follows a different code-path.

It would be very useful to make it configurable, just as with other lints, e.g.:

```ini
[lints]
unused-suppression=error
```

The main reason for this is that we create test suites for Flow typings, and write code like:

```js
// $FlowErrorExpected
const a : number = 'abc'
```

Where `$FlowErrorExpected` is configured to be a suppression comment.

It makes total sense to have the `flow` command fail here in case the suppression assertion is invalid.

An alternative would be to allow a separate suppression comment, used exactly for the purpose of testing errors, like `$FlowErrorExpected`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.