Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Expose failures array in JS API #477

Merged
merged 5 commits into from
Aug 5, 2015
Merged

Conversation

gtanner
Copy link
Contributor

@gtanner gtanner commented Jun 30, 2015

When using tslint as a library at bitHound, I would like to use the raw object as
the output.

Expose the raw output as well as add a null formatter that just returns
null (since in my case I will not be using the output).

I can live without the nullFormatter, but having access to the raw
output would be awesome for library users like me since I am just going to json.parse the output anyways.

Review on Reviewable

@@ -22,6 +22,7 @@ module Lint {
failureCount: number;
format: string;
output: string;
raw: RuleFailure[];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's call this property failures

@adidahiya
Copy link
Contributor

hmm I'm not sure we need the null formatter. let's remove it and just expose the raw failures array for your use case.

When using tslint as a library at bitHound, I would like to use the raw object as
the output.

Expose the raw output as well as add a null formatter that just returns
null (since in my case I will not be using the output).

I can live without the nullFormatter, but having access to the raw
output would be awesome for library users.
@gtanner
Copy link
Contributor Author

gtanner commented Jul 28, 2015

Thanks @adidahiya, removed the null formatter and renamed the property

@@ -84,7 +85,8 @@ module Lint {
return {
failureCount: failures.length,
format: this.options.formatter,
output: output
output: output,
failures: failures
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we now alphabetize keys in object literals, and this is enforced by tslint, which is why your build is failing

adidahiya added a commit that referenced this pull request Aug 5, 2015
Add support for a `null` formatter
@adidahiya adidahiya merged commit 2a397f1 into palantir:master Aug 5, 2015
@adidahiya
Copy link
Contributor

thanks @gtanner!

@adidahiya adidahiya changed the title Add support for a null formatter Expose failures array in JS API Aug 21, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants