Make use of TSLint formatters, rather than custom gulp-tslint reporters #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request removes all gulp-tslint reporters. Instead, formatters included with TSLint, or formatters compatible with TSLint, are used.
This change allows gulp-tslint to use any formatter that is added to TSLint, for example the new VSO formatter recently added to TSLint, without requiring any changes to gulp-tslint. This will close #64 and close #27.
Please let me know if the approach adopted looks acceptable, and whether there are any changes that you would like to see. Overall this change has simplified the code for gulp-tslint and made it more flexible. This has caused some breaking changes, discussed below, so I am more than happy to incorporate feedback into these changes if there are more appropriate ways to introduce this feature.
Overview of changes
This is quite a significant change, and there may be some pain for users. Specifically:
The options passed to
tslintPlugin
have changed. ThePluginOptions
interface is now:The signature for
tslintPlugin.report
has changed.This method no longer takes a reporter name as the first argument (instead a formatter is specified in the options to
tslintPlugin
), and theReporter
interface has been removed. The signature oftslintPlugin.report
has therefore changed fromto
This is arguably the most significant change. All users will have to change existing code that looks like
to
if upgrading to a release that contains these changes.
Custom gulp-tslint reporters will no longer work; instead users will have to make use of the TSLint equivalents.
For example, Instead of gulp-tslint-teamcity, tslint-teamcity-reporter should be used, and instead of gulp-tslint-stylish, tslint-stylish should be used. Note that
gulp-tslint-stylish
already appears to be marked as deprecated.tslintPlugin.ProseErrorFormat
is no longer exported.Rather than defining a custom
Failure
interface (and the associatedPosition
interface), I've made use of the TSLintRuleFailure
interface directly. This, together with the removal of theReporter
interface (see point 2, above) led me to remove theproseErrorFormat
method from the public API.Outstanding concerns
I believe that this pull request contains a complete implementation of this feature. However, I haven't attempted to update the README or CHANGELOG. I am happy to update these in another commit or pull request if these changes are suitable for merging.