Skip to content

Commit

Permalink
Support warnings-as-errors
Browse files Browse the repository at this point in the history
This patch adds support for using --warnings-as-errors as a parameter
for the lint command.

This complements the PR mozilla/addons-linter#1016
and completes the issue mozilla/addons-linter#1014.
  • Loading branch information
josteink committed Oct 26, 2016
1 parent fd662af commit 16103e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cmd/lint.js
Expand Up @@ -16,6 +16,7 @@ export type LinterCreatorParams = {
logLevel: 'debug' | 'fatal',
stack: boolean,
pretty?: boolean,
warningsAsErrors?: boolean,
metadata?: boolean,
output?: LinterOutputType,
boring?: boolean,
Expand All @@ -42,6 +43,7 @@ export type LintCmdParams = {
output?: LinterOutputType,
metadata?: boolean,
pretty?: boolean,
warningsAsErrors?: boolean,
};

export type LintCmdOptions = {
Expand All @@ -52,7 +54,7 @@ export type LintCmdOptions = {
export default function lint(
{
verbose, sourceDir, selfHosted, boring, output,
metadata, pretty,
metadata, pretty, warningsAsErrors,
}: LintCmdParams,
{
createLinter = defaultLinterCreator,
Expand All @@ -65,6 +67,7 @@ export default function lint(
logLevel: verbose ? 'debug' : 'fatal',
stack: Boolean(verbose),
pretty,
warningsAsErrors,
metadata,
output,
boring,
Expand Down
5 changes: 5 additions & 0 deletions src/program.js
Expand Up @@ -297,6 +297,11 @@ Example: $0 --help run.
type: 'boolean',
default: false,
},
'warnings-as-errors': {
describe: 'Treat warnings as errors',
type: 'boolean',
default: false,
},
'pretty': {
describe: 'Prettify JSON output',
type: 'boolean',
Expand Down

0 comments on commit 16103e9

Please sign in to comment.