diff options
Diffstat (limited to 'node_modules/tslint/lib/formatters')
11 files changed, 86 insertions, 88 deletions
diff --git a/node_modules/tslint/lib/formatters/checkstyleFormatter.js b/node_modules/tslint/lib/formatters/checkstyleFormatter.js index c3345f774..8163a75a1 100644 --- a/node_modules/tslint/lib/formatters/checkstyleFormatter.js +++ b/node_modules/tslint/lib/formatters/checkstyleFormatter.js @@ -28,9 +28,7 @@ var Formatter = (function (_super) { Formatter.prototype.format = function (failures) { var output = '<?xml version="1.0" encoding="utf-8"?><checkstyle version="4.3">'; if (failures.length !== 0) { - var failuresSorted = failures.sort(function (a, b) { - return a.getFileName().localeCompare(b.getFileName()); - }); + var failuresSorted = failures.sort(function (a, b) { return a.getFileName().localeCompare(b.getFileName()); }); var previousFilename = null; for (var _i = 0, failuresSorted_1 = failuresSorted; _i < failuresSorted_1.length; _i++) { var failure = failuresSorted_1[_i]; @@ -64,15 +62,15 @@ var Formatter = (function (_super) { .replace(/'/g, "'") .replace(/"/g, """); }; + /* tslint:disable:object-literal-sort-keys */ + Formatter.metadata = { + formatterName: "checkstyle", + description: "Formats errors as through they were Checkstyle output.", + descriptionDetails: (_a = ["\n Imitates the XMLLogger from Checkstyle 4.3. All failures have the 'warning' severity."], _a.raw = ["\n Imitates the XMLLogger from Checkstyle 4.3. All failures have the 'warning' severity."], Utils.dedent(_a)), + sample: (_b = ["\n <?xml version=\"1.0\" encoding=\"utf-8\"?>\n <checkstyle version=\"4.3\">\n <file name=\"myFile.ts\">\n <error line=\"1\" column=\"14\" severity=\"warning\" message=\"Missing semicolon\" source=\"failure.tslint.semicolon\" />\n </file>\n </checkstyle>"], _b.raw = ["\n <?xml version=\"1.0\" encoding=\"utf-8\"?>\n <checkstyle version=\"4.3\">\n <file name=\"myFile.ts\">\n <error line=\"1\" column=\"14\" severity=\"warning\" message=\"Missing semicolon\" source=\"failure.tslint.semicolon\" />\n </file>\n </checkstyle>"], Utils.dedent(_b)), + consumer: "machine", + }; return Formatter; }(abstractFormatter_1.AbstractFormatter)); -/* tslint:disable:object-literal-sort-keys */ -Formatter.metadata = { - formatterName: "checkstyle", - description: "Formats errors as through they were Checkstyle output.", - descriptionDetails: (_a = ["\n Imitates the XMLLogger from Checkstyle 4.3. All failures have the 'warning' severity."], _a.raw = ["\n Imitates the XMLLogger from Checkstyle 4.3. All failures have the 'warning' severity."], Utils.dedent(_a)), - sample: (_b = ["\n <?xml version=\"1.0\" encoding=\"utf-8\"?>\n <checkstyle version=\"4.3\">\n <file name=\"myFile.ts\">\n <error line=\"1\" column=\"14\" severity=\"warning\" message=\"Missing semicolon\" source=\"failure.tslint.semicolon\" />\n </file>\n </checkstyle>"], _b.raw = ["\n <?xml version=\"1.0\" encoding=\"utf-8\"?>\n <checkstyle version=\"4.3\">\n <file name=\"myFile.ts\">\n <error line=\"1\" column=\"14\" severity=\"warning\" message=\"Missing semicolon\" source=\"failure.tslint.semicolon\" />\n </file>\n </checkstyle>"], Utils.dedent(_b)), - consumer: "machine", -}; exports.Formatter = Formatter; var _a, _b; diff --git a/node_modules/tslint/lib/formatters/codeFrameFormatter.js b/node_modules/tslint/lib/formatters/codeFrameFormatter.js index b828bf58e..0b46e244c 100644 --- a/node_modules/tslint/lib/formatters/codeFrameFormatter.js +++ b/node_modules/tslint/lib/formatters/codeFrameFormatter.js @@ -65,15 +65,15 @@ var Formatter = (function (_super) { } return outputLines.join("\n") + "\n"; }; + /* tslint:disable:object-literal-sort-keys */ + Formatter.metadata = { + formatterName: "codeFrame", + description: "Framed formatter which creates a frame of error code.", + descriptionDetails: (_a = ["\n Prints syntax highlighted code in a frame with a pointer to where\n exactly lint error is happening."], _a.raw = ["\n Prints syntax highlighted code in a frame with a pointer to where\n exactly lint error is happening."], Utils.dedent(_a)), + sample: (_b = ["\n src/components/Payment.tsx\n Parentheses are required around the parameters of an arrow function definition (arrow-parens)\n 21 | public componentDidMount() {\n 22 | this.input.focus();\n > 23 | loadStripe().then(Stripe => Stripe.pay());\n | ^\n 24 | }\n 25 |\n 26 | public render() {"], _b.raw = ["\n src/components/Payment.tsx\n Parentheses are required around the parameters of an arrow function definition (arrow-parens)\n 21 | public componentDidMount() {\n 22 | this.input.focus();\n > 23 | loadStripe().then(Stripe => Stripe.pay());\n | ^\n 24 | }\n 25 |\n 26 | public render() {"], Utils.dedent(_b)), + consumer: "human", + }; return Formatter; }(abstractFormatter_1.AbstractFormatter)); -/* tslint:disable:object-literal-sort-keys */ -Formatter.metadata = { - formatterName: "codeFrame", - description: "Framed formatter which creates a frame of error code.", - descriptionDetails: (_a = ["\n Prints syntax highlighted code in a frame with a pointer to where\n exactly lint error is happening."], _a.raw = ["\n Prints syntax highlighted code in a frame with a pointer to where\n exactly lint error is happening."], Utils.dedent(_a)), - sample: (_b = ["\n src/components/Payment.tsx\n Parentheses are required around the parameters of an arrow function definition (arrow-parens)\n 21 | public componentDidMount() {\n 22 | this.input.focus();\n > 23 | loadStripe().then(Stripe => Stripe.pay());\n | ^\n 24 | }\n 25 |\n 26 | public render() {"], _b.raw = ["\n src/components/Payment.tsx\n Parentheses are required around the parameters of an arrow function definition (arrow-parens)\n 21 | public componentDidMount() {\n 22 | this.input.focus();\n > 23 | loadStripe().then(Stripe => Stripe.pay());\n | ^\n 24 | }\n 25 |\n 26 | public render() {"], Utils.dedent(_b)), - consumer: "human", -}; exports.Formatter = Formatter; var _a, _b; diff --git a/node_modules/tslint/lib/formatters/fileslistFormatter.js b/node_modules/tslint/lib/formatters/fileslistFormatter.js index 23bda6bcb..5585c4224 100644 --- a/node_modules/tslint/lib/formatters/fileslistFormatter.js +++ b/node_modules/tslint/lib/formatters/fileslistFormatter.js @@ -40,13 +40,13 @@ var Formatter = (function (_super) { } return files.join("\n") + "\n"; }; + /* tslint:disable:object-literal-sort-keys */ + Formatter.metadata = { + formatterName: "filesList", + description: "Lists files containing lint errors.", + sample: "directory/myFile.ts", + consumer: "machine", + }; return Formatter; }(abstractFormatter_1.AbstractFormatter)); -/* tslint:disable:object-literal-sort-keys */ -Formatter.metadata = { - formatterName: "filesList", - description: "Lists files containing lint errors.", - sample: "directory/myFile.ts", - consumer: "machine", -}; exports.Formatter = Formatter; diff --git a/node_modules/tslint/lib/formatters/jsonFormatter.js b/node_modules/tslint/lib/formatters/jsonFormatter.js index 73b8fd9d1..5dfc53263 100644 --- a/node_modules/tslint/lib/formatters/jsonFormatter.js +++ b/node_modules/tslint/lib/formatters/jsonFormatter.js @@ -29,14 +29,14 @@ var Formatter = (function (_super) { var failuresJSON = failures.map(function (failure) { return failure.toJson(); }); return JSON.stringify(failuresJSON); }; + /* tslint:disable:object-literal-sort-keys */ + Formatter.metadata = { + formatterName: "json", + description: "Formats errors as simple JSON.", + sample: (_a = ["\n [\n {\n \"endPosition\": {\n \"character\": 13,\n \"line\": 0,\n \"position\": 13\n },\n \"failure\": \"Missing semicolon\",\n \"fix\": {\n \"innerStart\": 13,\n \"innerLength\": 0,\n \"innerText\": \";\"\n },\n \"name\": \"myFile.ts\",\n \"ruleName\": \"semicolon\",\n \"startPosition\": {\n \"character\": 13,\n \"line\": 0,\n \"position\": 13\n }\n }\n ]"], _a.raw = ["\n [\n {\n \"endPosition\": {\n \"character\": 13,\n \"line\": 0,\n \"position\": 13\n },\n \"failure\": \"Missing semicolon\",\n \"fix\": {\n \"innerStart\": 13,\n \"innerLength\": 0,\n \"innerText\": \";\"\n },\n \"name\": \"myFile.ts\",\n \"ruleName\": \"semicolon\",\n \"startPosition\": {\n \"character\": 13,\n \"line\": 0,\n \"position\": 13\n }\n }\n ]"], Utils.dedent(_a)), + consumer: "machine", + }; return Formatter; }(abstractFormatter_1.AbstractFormatter)); -/* tslint:disable:object-literal-sort-keys */ -Formatter.metadata = { - formatterName: "json", - description: "Formats errors as simple JSON.", - sample: (_a = ["\n [\n {\n \"endPosition\": {\n \"character\": 13,\n \"line\": 0,\n \"position\": 13\n },\n \"failure\": \"Missing semicolon\",\n \"fix\": {\n \"innerStart\": 13,\n \"innerLength\": 0,\n \"innerText\": \";\"\n },\n \"name\": \"myFile.ts\",\n \"ruleName\": \"semicolon\",\n \"startPosition\": {\n \"character\": 13,\n \"line\": 0,\n \"position\": 13\n }\n }\n ]"], _a.raw = ["\n [\n {\n \"endPosition\": {\n \"character\": 13,\n \"line\": 0,\n \"position\": 13\n },\n \"failure\": \"Missing semicolon\",\n \"fix\": {\n \"innerStart\": 13,\n \"innerLength\": 0,\n \"innerText\": \";\"\n },\n \"name\": \"myFile.ts\",\n \"ruleName\": \"semicolon\",\n \"startPosition\": {\n \"character\": 13,\n \"line\": 0,\n \"position\": 13\n }\n }\n ]"], Utils.dedent(_a)), - consumer: "machine", -}; exports.Formatter = Formatter; var _a; diff --git a/node_modules/tslint/lib/formatters/msbuildFormatter.js b/node_modules/tslint/lib/formatters/msbuildFormatter.js index 6f3792d14..f00960be4 100644 --- a/node_modules/tslint/lib/formatters/msbuildFormatter.js +++ b/node_modules/tslint/lib/formatters/msbuildFormatter.js @@ -37,15 +37,15 @@ var Formatter = (function (_super) { }); return outputLines.join("\n") + "\n"; }; + /* tslint:disable:object-literal-sort-keys */ + Formatter.metadata = { + formatterName: "msbuild", + description: "Formats errors for consumption by msbuild.", + descriptionDetails: (_a = ["\n The output is compatible with both msbuild and Visual Studio. All failures have the\n 'warning' severity."], _a.raw = ["\n The output is compatible with both msbuild and Visual Studio. All failures have the\n 'warning' severity."], utils_1.dedent(_a)), + sample: "myFile.ts(1,14): warning: Missing semicolon", + consumer: "machine", + }; return Formatter; }(abstractFormatter_1.AbstractFormatter)); -/* tslint:disable:object-literal-sort-keys */ -Formatter.metadata = { - formatterName: "msbuild", - description: "Formats errors for consumption by msbuild.", - descriptionDetails: (_a = ["\n The output is compatible with both msbuild and Visual Studio. All failures have the\n 'warning' severity."], _a.raw = ["\n The output is compatible with both msbuild and Visual Studio. All failures have the\n 'warning' severity."], utils_1.dedent(_a)), - sample: "myFile.ts(1,14): warning: Missing semicolon", - consumer: "machine", -}; exports.Formatter = Formatter; var _a; diff --git a/node_modules/tslint/lib/formatters/pmdFormatter.js b/node_modules/tslint/lib/formatters/pmdFormatter.js index 927d90428..04a1aa7d9 100644 --- a/node_modules/tslint/lib/formatters/pmdFormatter.js +++ b/node_modules/tslint/lib/formatters/pmdFormatter.js @@ -46,15 +46,15 @@ var Formatter = (function (_super) { output += "</pmd>"; return output; }; + /* tslint:disable:object-literal-sort-keys */ + Formatter.metadata = { + formatterName: "pmd", + description: "Formats errors as through they were PMD output.", + descriptionDetails: "Imitates the XML output from PMD. All errors have a priority of 1.", + sample: (_a = ["\n <pmd version=\"tslint\">\n <file name=\"myFile.ts\">\n <violation begincolumn=\"14\" beginline=\"1\" priority=\"3\" rule=\"Missing semicolon\"></violation>\n </file>\n </pmd>"], _a.raw = ["\n <pmd version=\"tslint\">\n <file name=\"myFile.ts\">\n <violation begincolumn=\"14\" beginline=\"1\" priority=\"3\" rule=\"Missing semicolon\"></violation>\n </file>\n </pmd>"], Utils.dedent(_a)), + consumer: "machine", + }; return Formatter; }(abstractFormatter_1.AbstractFormatter)); -/* tslint:disable:object-literal-sort-keys */ -Formatter.metadata = { - formatterName: "pmd", - description: "Formats errors as through they were PMD output.", - descriptionDetails: "Imitates the XML output from PMD. All errors have a priority of 1.", - sample: (_a = ["\n <pmd version=\"tslint\">\n <file name=\"myFile.ts\">\n <violation begincolumn=\"14\" beginline=\"1\" priority=\"3\" rule=\"Missing semicolon\"></violation>\n </file>\n </pmd>"], _a.raw = ["\n <pmd version=\"tslint\">\n <file name=\"myFile.ts\">\n <violation begincolumn=\"14\" beginline=\"1\" priority=\"3\" rule=\"Missing semicolon\"></violation>\n </file>\n </pmd>"], Utils.dedent(_a)), - consumer: "machine", -}; exports.Formatter = Formatter; var _a; diff --git a/node_modules/tslint/lib/formatters/proseFormatter.js b/node_modules/tslint/lib/formatters/proseFormatter.js index 981884a1e..43ecfefae 100644 --- a/node_modules/tslint/lib/formatters/proseFormatter.js +++ b/node_modules/tslint/lib/formatters/proseFormatter.js @@ -50,13 +50,13 @@ var Formatter = (function (_super) { }); return fixLines.concat(errorLines).join("\n") + "\n"; }; + /* tslint:disable:object-literal-sort-keys */ + Formatter.metadata = { + formatterName: "prose", + description: "The default formatter which outputs simple human-readable messages.", + sample: "ERROR: myFile.ts[1, 14]: Missing semicolon", + consumer: "human", + }; return Formatter; }(abstractFormatter_1.AbstractFormatter)); -/* tslint:disable:object-literal-sort-keys */ -Formatter.metadata = { - formatterName: "prose", - description: "The default formatter which outputs simple human-readable messages.", - sample: "ERROR: myFile.ts[1, 14]: Missing semicolon", - consumer: "human", -}; exports.Formatter = Formatter; diff --git a/node_modules/tslint/lib/formatters/stylishFormatter.js b/node_modules/tslint/lib/formatters/stylishFormatter.js index c358dcaec..ded0ca567 100644 --- a/node_modules/tslint/lib/formatters/stylishFormatter.js +++ b/node_modules/tslint/lib/formatters/stylishFormatter.js @@ -97,15 +97,15 @@ var Formatter = (function (_super) { } return ruleMaxSize; }; + /* tslint:disable:object-literal-sort-keys */ + Formatter.metadata = { + formatterName: "stylish", + description: "Human-readable formatter which creates stylish messages.", + descriptionDetails: (_a = ["\n The output matches that produced by eslint's stylish formatter. Its readability\n enhanced through spacing and colouring"], _a.raw = ["\n The output matches that produced by eslint's stylish formatter. Its readability\n enhanced through spacing and colouring"], Utils.dedent(_a)), + sample: (_b = ["\n myFile.ts\n 1:14 semicolon Missing semicolon"], _b.raw = ["\n myFile.ts\n 1:14 semicolon Missing semicolon"], Utils.dedent(_b)), + consumer: "human", + }; return Formatter; }(abstractFormatter_1.AbstractFormatter)); -/* tslint:disable:object-literal-sort-keys */ -Formatter.metadata = { - formatterName: "stylish", - description: "Human-readable formatter which creates stylish messages.", - descriptionDetails: (_a = ["\n The output matches that produced by eslint's stylish formatter. Its readability\n enhanced through spacing and colouring"], _a.raw = ["\n The output matches that produced by eslint's stylish formatter. Its readability\n enhanced through spacing and colouring"], Utils.dedent(_a)), - sample: (_b = ["\n myFile.ts\n 1:14 semicolon Missing semicolon"], _b.raw = ["\n myFile.ts\n 1:14 semicolon Missing semicolon"], Utils.dedent(_b)), - consumer: "human", -}; exports.Formatter = Formatter; var _a, _b; diff --git a/node_modules/tslint/lib/formatters/tapFormatter.js b/node_modules/tslint/lib/formatters/tapFormatter.js index 1bf56b9fc..f7743c173 100644 --- a/node_modules/tslint/lib/formatters/tapFormatter.js +++ b/node_modules/tslint/lib/formatters/tapFormatter.js @@ -50,15 +50,15 @@ var Formatter = (function (_super) { var _a; }); }; + /* tslint:disable:object-literal-sort-keys */ + Formatter.metadata = { + formatterName: "tap", + description: "Formats output as TAP stream.", + descriptionDetails: "Provides error messages output in TAP13 format which can be consumed by any TAP formatter.", + sample: (_a = ["\n TAP version 13\n 1..1\n not ok 1 - Some error\n ---\n message: Variable has any type\n severity: error\n data:\n ruleName: no-any\n fileName: test-file.ts\n line: 10\n character: 10\n failureString: Some error\n rawLines: Some raw output\n ..."], _a.raw = ["\n TAP version 13\n 1..1\n not ok 1 - Some error\n ---\n message: Variable has any type\n severity: error\n data:\n ruleName: no-any\n fileName: test-file.ts\n line: 10\n character: 10\n failureString: Some error\n rawLines: Some raw output\n ..."], Utils.dedent(_a)), + consumer: "machine", + }; return Formatter; }(abstractFormatter_1.AbstractFormatter)); -/* tslint:disable:object-literal-sort-keys */ -Formatter.metadata = { - formatterName: "tap", - description: "Formats output as TAP stream.", - descriptionDetails: "Provides error messages output in TAP13 format which can be consumed by any TAP formatter.", - sample: (_a = ["\n TAP version 13\n 1..1\n not ok 1 - Some error\n ---\n message: Variable has any type\n severity: error\n data:\n ruleName: no-any\n fileName: test-file.ts\n line: 10\n character: 10\n failureString: Some error\n rawLines: Some raw output\n ..."], _a.raw = ["\n TAP version 13\n 1..1\n not ok 1 - Some error\n ---\n message: Variable has any type\n severity: error\n data:\n ruleName: no-any\n fileName: test-file.ts\n line: 10\n character: 10\n failureString: Some error\n rawLines: Some raw output\n ..."], Utils.dedent(_a)), - consumer: "machine", -}; exports.Formatter = Formatter; var _a; diff --git a/node_modules/tslint/lib/formatters/verboseFormatter.js b/node_modules/tslint/lib/formatters/verboseFormatter.js index dfaf66313..2b49e7e45 100644 --- a/node_modules/tslint/lib/formatters/verboseFormatter.js +++ b/node_modules/tslint/lib/formatters/verboseFormatter.js @@ -37,14 +37,14 @@ var Formatter = (function (_super) { return failure.getRuleSeverity().toUpperCase() + ": (" + ruleName + ") " + fileName + positionTuple + ": " + failureString; }); }; + /* tslint:disable:object-literal-sort-keys */ + Formatter.metadata = { + 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", + sample: "ERROR: (semicolon) myFile.ts[1, 14]: Missing semicolon", + consumer: "human", + }; return Formatter; }(abstractFormatter_1.AbstractFormatter)); -/* tslint:disable:object-literal-sort-keys */ -Formatter.metadata = { - 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", - sample: "ERROR: (semicolon) myFile.ts[1, 14]: Missing semicolon", - consumer: "human", -}; exports.Formatter = Formatter; diff --git a/node_modules/tslint/lib/formatters/vsoFormatter.js b/node_modules/tslint/lib/formatters/vsoFormatter.js index b2c4082ed..ac00d3de0 100644 --- a/node_modules/tslint/lib/formatters/vsoFormatter.js +++ b/node_modules/tslint/lib/formatters/vsoFormatter.js @@ -40,15 +40,15 @@ var Formatter = (function (_super) { }); return outputLines.join("\n") + "\n"; }; + /* tslint:disable:object-literal-sort-keys */ + Formatter.metadata = { + formatterName: "vso", + description: "Formats output as VSO/TFS logging commands.", + descriptionDetails: (_a = ["\n Integrates with Visual Studio Online and Team Foundation Server by outputting errors\n as 'warning' logging commands."], _a.raw = ["\n Integrates with Visual Studio Online and Team Foundation Server by outputting errors\n as 'warning' logging commands."], Utils.dedent(_a)), + sample: "##vso[task.logissue type=warning;sourcepath=myFile.ts;linenumber=1;columnnumber=14;code=semicolon;]Missing semicolon", + consumer: "machine", + }; return Formatter; }(abstractFormatter_1.AbstractFormatter)); -/* tslint:disable:object-literal-sort-keys */ -Formatter.metadata = { - formatterName: "vso", - description: "Formats output as VSO/TFS logging commands.", - descriptionDetails: (_a = ["\n Integrates with Visual Studio Online and Team Foundation Server by outputting errors\n as 'warning' logging commands."], _a.raw = ["\n Integrates with Visual Studio Online and Team Foundation Server by outputting errors\n as 'warning' logging commands."], Utils.dedent(_a)), - sample: "##vso[task.logissue type=warning;sourcepath=myFile.ts;linenumber=1;columnnumber=14;code=semicolon;]Missing semicolon", - consumer: "machine", -}; exports.Formatter = Formatter; var _a; |