diff --git a/docs/user-guide/usage/options.md b/docs/user-guide/usage/options.md index 348bf39699..cc19c9e67b 100644 --- a/docs/user-guide/usage/options.md +++ b/docs/user-guide/usage/options.md @@ -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). diff --git a/lib/__tests__/cli.test.js b/lib/__tests__/cli.test.js index 7ba07ac993..263cc1b015 100644 --- a/lib/__tests__/cli.test.js +++ b/lib/__tests__/cli.test.js @@ -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); + }); });