diff --git a/docs/usage/cli/index.md b/docs/usage/cli/index.md index daf9304e0c6..abff541ae1e 100644 --- a/docs/usage/cli/index.md +++ b/docs/usage/cli/index.md @@ -44,7 +44,7 @@ Options: --print-config print resolved configuration for a file -r, --rules-dir [rules-dir] rules directory -s, --formatters-dir [formatters-dir] formatters directory --t, --format [format] output format (prose, json, stylish, verbose, pmd, msbuild, checkstyle, vso, fileslist, codeFrame) +-t, --format [format] output format (json, stylish, verbose, pmd, prose, msbuild, checkstyle, vso, fileslist, codeFrame) -q, --quiet hide non "error" severity linting errors from output --test test that tslint produces the correct output for the specified directory -p, --project [project] tsconfig.json file @@ -113,11 +113,12 @@ tslint accepts the following command-line options: -t, --format: The formatter to use to format the results of the linter before outputting it to stdout or the file passed in --out. The core - formatters are prose (human readable), json (machine readable) - and verbose. prose is the default if this option is not used. + formatters are stylish (colored and human readable), json (machine + readable), and verbose (human readable). + stylish is the default if this option is not used. Other built-in options include pmd, msbuild, checkstyle, and vso. Additional formatters can be added and used if the --formatters-dir - option is set. + option is set.`, -q, --quiet Hide non "error" severity linting errors from output. This can be diff --git a/src/formatters/verboseFormatter.ts b/src/formatters/verboseFormatter.ts index 2ea8fa0feac..d64a64c1e17 100644 --- a/src/formatters/verboseFormatter.ts +++ b/src/formatters/verboseFormatter.ts @@ -24,8 +24,7 @@ export class Formatter extends AbstractFormatter { public static metadata: IFormatterMetadata = { formatterName: "verbose", description: "The human-readable formatter which includes the rule name in messages.", - descriptionDetails: - "The output is the same as the prose formatter with the rule name included", + descriptionDetails: "Basic formatter which outputs simple human-readable messages", sample: "ERROR: (semicolon) myFile.ts[1, 14]: Missing semicolon", consumer: "human", }; diff --git a/src/linter.ts b/src/linter.ts index 58703200b70..f78dcff3b31 100644 --- a/src/linter.ts +++ b/src/linter.ts @@ -184,7 +184,7 @@ export class Linter { const failures = this.options.quiet ? errors : this.failures; const formatterName = - this.options.formatter !== undefined ? this.options.formatter : "prose"; + this.options.formatter !== undefined ? this.options.formatter : "stylish"; const Formatter = findFormatter(formatterName, this.options.formattersDirectory); if (Formatter === undefined) { throw new Error(`formatter '${String(formatterName)}' not found`); diff --git a/src/runner.ts b/src/runner.ts index 7e47595a226..1d5be8412a3 100644 --- a/src/runner.ts +++ b/src/runner.ts @@ -232,7 +232,7 @@ async function doLinting( formatter = configFile && configFile.linterOptions && configFile.linterOptions.format ? configFile.linterOptions.format - : "prose"; + : "stylish"; } const linter = new Linter( diff --git a/src/tslintCli.ts b/src/tslintCli.ts index a980480dd7e..8fadea17c45 100644 --- a/src/tslintCli.ts +++ b/src/tslintCli.ts @@ -161,13 +161,14 @@ const options: Option[] = [ name: "format", type: "string", describe: - "output format (prose, json, stylish, verbose, pmd, msbuild, checkstyle, vso, fileslist, codeFrame)", + "output format (json, stylish, verbose, pmd, msbuild, checkstyle, vso, fileslist, codeFrame)", description: dedent` The formatter to use to format the results of the linter before outputting it to stdout or the file passed in --out. The core - formatters are prose (human readable), json (machine readable) - and verbose. prose is the default if this option is not used. - Other built-in options include pmd, msbuild, checkstyle, and vso. + formatters are stylish (colored and human readable), json (machine + readable), and verbose (human readable). + stylish is the default if this option is not used. + Other built-in options include pmd, prose, msbuild, checkstyle, and vso. Additional formatters can be added and used if the --formatters-dir option is set.`, }, diff --git a/test/executable/executableTests.ts b/test/executable/executableTests.ts index 51a8d7e6e0b..cf89d1793a4 100644 --- a/test/executable/executableTests.ts +++ b/test/executable/executableTests.ts @@ -775,7 +775,7 @@ function execRunnerWithOutput(options: Partial) { // tslint:disable-next-line:promise-function-async function execRunner(options: Partial, logger: Logger = dummyLogger) { - return run({ exclude: [], files: [], ...options }, logger); + return run({ exclude: [], files: [], format: "prose", ...options }, logger); } // tslint:disable-next-line:ban-types diff --git a/test/runner/runnerTests.ts b/test/runner/runnerTests.ts index 02400c41c6c..74fcf7e8950 100644 --- a/test/runner/runnerTests.ts +++ b/test/runner/runnerTests.ts @@ -22,6 +22,7 @@ const customRulesOptions: Options = { config: "./test/config/tslint-custom-rules.json", exclude: [], files: ["src/test.ts"], + format: "prose", rulesDirectory: "./test/files/custom-rules", };