Skip to content

Latest commit

 

History

History
195 lines (168 loc) · 6.18 KB

README.md

File metadata and controls

195 lines (168 loc) · 6.18 KB

Updated TSLint for MSBuild

Old version seems unmaintained, that's why I forked it.

NuGet Version and Downloads count

An MSBuild target for linting TypeScript code using TSLint. Get it at nuget.org.

Usage

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.

Overrideable Item Groups

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>

Overrideable Properties

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). *.*.*

Output Item Groups

Item Group Description
TSLintOutput Lines of console output from the TSLint CLI.

Output Properties

Property Description
TSLintErrorCode Exit code of the TSLint CLI.

TSLint version

The first available TSLint version in your NuGet packages directory will be used.

Development

Run the following commands to initialize your environment:

npm install -g gulp
npm install

Run gulp to build. gulp test just runs tests.

Updating the version

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.