Skip to content

Commit

Permalink
Further improvement for quite option in API #4476
Browse files Browse the repository at this point in the history
  • Loading branch information
hudochenkov committed Sep 16, 2021
1 parent 3d821e2 commit 0b2ab7d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/user-guide/usage/options.md
Expand Up @@ -187,3 +187,9 @@ CLI flag: `--stdin-filename`
A filename to assign the input.

If using `code` or `stdin` to pass a source string directly, you can use `codeFilename` to associate that code with a particular filename.

## `quiet`

CLI flag: `--quiet`

Only register violations for rules with an "error"-level severity (ignore "warning"-level).
13 changes: 13 additions & 0 deletions lib/__tests__/cli.test.js
Expand Up @@ -320,4 +320,17 @@ describe('CLI', () => {
'Max warnings exceeded: 1 found. 0 allowed',
);
});

it('--quiet', async () => {
await cli([
'--quiet',
'--config',
fixturesPath('default-severity-warning.json'),
fixturesPath('empty-block.css'),
]);

expect(process.exitCode).toEqual(2);

expect(process.stdout.write).toHaveBeenCalledTimes(0);
});
});

0 comments on commit 0b2ab7d

Please sign in to comment.