JoshuaKGoldberg / TSLint.MSBuild

[Deprecated] An MSBuild task for running TSLint.
https://www.nuget.org/packages/TSLint.MSBuild
MIT License
15 stars 13 forks source link

Consider an MSBuild param to treat warnings as errors #64

Open JoshuaKGoldberg opened 7 years ago

JoshuaKGoldberg commented 7 years ago

This was originally proposed in #60. Copying @lsvhome's comments:

When I use tslint for specific configurations I want to separate two workflows: 1) Debug mode when tslint warnings allowed 2) Release mode when tslint warnings should be fixed

In my case csproj contains standatd property TreatWarningsAsErrors

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <TreatWarningsAsErrors>false</TreatWarningsAsErrors> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup>

And I use TreatWarningsAsErrors to switch between TSLint warnings modes. Patch don't break base functionality but allows some customization. I mean that way is usefiul for people who use package.

This could be useful. Even after TSLint itself has a difference between errors and warnings, users may still want to change severity based on MSBuild settings.