Old version seems unmaintained, that's why I forked it.
An MSBuild target for linting TypeScript code using TSLint. Get it at nuget.org.
Add this package and TSLint using your NuGet Package Manager. It should be automatically added to your project.
TSLint's default configurations are used by default.
If you'd like to use your own tslint.json
file, add a TSLintConfig
property to your project:
<TSLintConfig>Scripts/tslint.json</TSLintConfig>
All overrideable item groups and properties are below. Read the TSLint documentation for TSLint-specific linting details.
Item Group | Description | Default |
TSLintExclude |
Globs of file names to exclude. | (blank) |
---|---|---|
TSLintInclude |
File names to lint. | @(TypeScriptCompile) (unless TSLintExcludeTypeScriptCompile is true ) |
TSLintRulesDirectory |
Directories for user-created rules | (blank) |
Note that to use special characters (such as *
wildcards) in TSLintExclude
you must escape the special characters.
<ItemGroup>
<TSLintExclude Include="typings/**/*.d.ts"><Visible>False</Visible></TSLintExclude>
</ItemGroup>
Property | Description | Default |
TSLintBreakBuildOnError |
Whether linting failures should break the build. | false |
---|---|---|
TSLintConfig |
Path to a specific tslint.json. | (blank) |
TSLintCli |
Path to a TSLint CLI to run with. | The first TSLint version in the solution's packages directory, or the Project Dir's node_modules/tslint/bin/tslint directory. |
TSLintDisabled |
Whether to skip running TSLint. | false |
TSLintExcludeTypeScriptCompile |
Whether to exclude @(TypeScriptCompile) from @(TSLintInclude) . |
false |
TSLintExtraArgs |
Any extra arguments to pass to the TSLint CLI. | (blank) |
TSLintFileListDisabled |
Whether to disable passing TypeScript file list on the command line. If true, it is expected that the files to lint are specified in the TSLintProject file. |
false |
TSLintNodeExe |
Path to a Node executable to execute the runner script. | The tools\node-7.3.0.exe in the package. |
TSLintProject |
Path to a tsconfig.json file to use as a type checker project. |
(blank) |
TSLintRunOutsideBuildingProject |
Whether to run even if `BuildingProject` isn't `true`. | (blank) |
TSLintTimeout |
Maximum time to run the task, in case TSLint hangs or takes too long. | 10000000 |
TSLintTypeCheck |
Whether to enable the type checker (requires TSLintProject be set). |
false |
TSLintVersion |
Glob filter for the version of TSLint to use (ignored if TSLintConfig is provided). |
*.*.* |
Item Group | Description |
TSLintOutput |
Lines of console output from the TSLint CLI. |
---|
Property | Description |
TSLintErrorCode |
Exit code of the TSLint CLI. |
---|
The first available TSLint version in your NuGet packages directory will be used.
Run the following commands to initialize your environment:
npm install -g gulp
npm install
Run gulp
to build.
gulp test
just runs tests.
The version number is stored both in package.json
and TSLint.MSBuild.nuspec
.
Make sure to update it in both places.
File a bug report if upgrading causes any issues.