From 6964123159f9d557c999d2b5090936c6f8e950f4 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 20 Oct 2016 10:22:00 -0700 Subject: [PATCH] ExtraArgs, Project, TypeCheck, and Version (beta1) --- README.md | 28 +++++++++++-- TSLint.MSBuild.nuspec | 2 +- gulpfile.js | 2 +- package.json | 2 +- src/build/TSLint.MSBuild.targets | 10 +++-- test/TSLintArgs/TSLintArgs/TSLintArgs.csproj | 5 ++- test/TSLintVersion/TSLintVersion.sln | 13 +++++++ .../TSlintVersion/TSLintVersion.csproj | 39 +++++++++++++++++++ .../node_modules/tslint/lib/tslint-cli.js | 1 + .../node_modules/tslint/lib/tslint-cli.js | 1 + .../node_modules/tslint/lib/tslint-cli.js | 1 + .../node_modules/tslint/lib/tslint-cli.js | 1 + 12 files changed, 93 insertions(+), 12 deletions(-) create mode 100644 test/TSLintVersion/TSLintVersion.sln create mode 100644 test/TSLintVersion/TSlintVersion/TSLintVersion.csproj create mode 100644 test/TSLintVersion/packages/tslint.0.4.5/tools/node_modules/tslint/lib/tslint-cli.js create mode 100644 test/TSLintVersion/packages/tslint.1.11.4/tools/node_modules/tslint/lib/tslint-cli.js create mode 100644 test/TSLintVersion/packages/tslint.1.12.2/tools/node_modules/tslint/lib/tslint-cli.js create mode 100644 test/TSLintVersion/packages/tslint.1.3.5/tools/node_modules/tslint/lib/tslint-cli.js diff --git a/README.md b/README.md index 919cfbe..5e112ec 100644 --- a/README.md +++ b/README.md @@ -33,12 +33,12 @@ Read the [TSLint documentation](https://github.com/palantir/tslint) for TSLint-s TSLintExclude Globs of file names to exclude. - (blank) + (blank) TSLintRulesDirectory Directories for user-created rules - (blank) + (blank) @@ -69,7 +69,7 @@ Note that to use special characters (such as `*` wildcards) in `TSLintExclude` y TSLintConfig Path to a specific tslint.json. - (blank) + (blank) TSLintCli @@ -81,15 +81,35 @@ Note that to use special characters (such as `*` wildcards) in `TSLintExclude` y Whether to skip running TSLint. false + + TSLintExtraArgs + Any extra arguments to pass to the TSLint CLI. + (blank) + TSLintNodeExe Path to a Node executable to execute the runner script. The tools\node-6.1.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) + (blank) + + + 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). + *.*.* diff --git a/TSLint.MSBuild.nuspec b/TSLint.MSBuild.nuspec index 628a8a3..f7727ca 100644 --- a/TSLint.MSBuild.nuspec +++ b/TSLint.MSBuild.nuspec @@ -3,7 +3,7 @@ TSLint.MSBuild TSLint.MSBuild - 1.0.0-beta0 + 1.0.0-beta1 palantir, joshuakgoldberg joshuakgoldberg https://github.com/JoshuaKGoldberg/TSLint.MSBuild/blob/master/LICENSE.md diff --git a/gulpfile.js b/gulpfile.js index 32d37d8..e16a9fe 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -5,7 +5,7 @@ const request = require("request"); const runSequence = require("run-sequence"); const msbuild = require("gulp-msbuild"); -const tests = ["TSLintArgs", "TSLintCli", "TSLintOutput"]; +const tests = ["TSLintArgs", "TSLintCli", "TSLintOutput", "TSLintVersion"]; const testTasks = tests.map(testName => `test:${testName}`); tests.forEach(testName => { diff --git a/package.json b/package.json index ffc9b3e..e20d615 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tslint-msbuild", - "version": "1.0.0-beta0", + "version": "1.0.0-beta1", "description": "An MSBuild target for linting TypeScript code using TSLint.", "author": "Joshua K Goldberg", "license": "MIT", diff --git a/src/build/TSLint.MSBuild.targets b/src/build/TSLint.MSBuild.targets index 7b77b65..64a4f5d 100644 --- a/src/build/TSLint.MSBuild.targets +++ b/src/build/TSLint.MSBuild.targets @@ -13,15 +13,14 @@ false - - $([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)..\tools\node-6.1.0.exe")) + *.*.* - - + + @(TSLintPotentialCli); @@ -40,7 +39,10 @@ $(TSLintArgs) --config $(TSLintConfig) $(TSLintArgs) --exclude $(TSLintExcludeJoined) $(TSLintArgs) --format msbuild + $(TSLintArgs) --project $(TSLintProject) + $(TSLintArgs) --type-check $(TSLintTypeCheck) $(TSLintArgs) --rules-dir @(TSLintRulesDirectory, ' --rules-dir ') + $(TSLintArgs) $(TSLintExtraArgs) $(TSLintArgs) @(TypeScriptCompile, ' ') diff --git a/test/TSLintArgs/TSLintArgs/TSLintArgs.csproj b/test/TSLintArgs/TSLintArgs/TSLintArgs.csproj index 99598bb..9c3e5e5 100644 --- a/test/TSLintArgs/TSLintArgs/TSLintArgs.csproj +++ b/test/TSLintArgs/TSLintArgs/TSLintArgs.csproj @@ -28,12 +28,15 @@ true tslint.json + --baz qux + tsconfig.json + true - --config tslint.json --exclude foo.ts --exclude bar.ts --format msbuild --rules-dir rules/foo --rules-dir rules/bar foo.ts bar.ts baz.ts qux.ts + --config tslint.json --exclude foo.ts --exclude bar.ts --format msbuild --project tsconfig.json --type-check true --rules-dir rules/foo --rules-dir rules/bar --baz qux foo.ts bar.ts baz.ts qux.ts + + + + + + + + + + + + + true + + + + + + true + 1.1?.2 + + + + + + $(SolutionDir)packages\tslint.1.12.2\tools\node_modules\tslint\lib\tslint-cli.js + + + + + + + diff --git a/test/TSLintVersion/packages/tslint.0.4.5/tools/node_modules/tslint/lib/tslint-cli.js b/test/TSLintVersion/packages/tslint.0.4.5/tools/node_modules/tslint/lib/tslint-cli.js new file mode 100644 index 0000000..c15f26f --- /dev/null +++ b/test/TSLintVersion/packages/tslint.0.4.5/tools/node_modules/tslint/lib/tslint-cli.js @@ -0,0 +1 @@ +// ... diff --git a/test/TSLintVersion/packages/tslint.1.11.4/tools/node_modules/tslint/lib/tslint-cli.js b/test/TSLintVersion/packages/tslint.1.11.4/tools/node_modules/tslint/lib/tslint-cli.js new file mode 100644 index 0000000..c15f26f --- /dev/null +++ b/test/TSLintVersion/packages/tslint.1.11.4/tools/node_modules/tslint/lib/tslint-cli.js @@ -0,0 +1 @@ +// ... diff --git a/test/TSLintVersion/packages/tslint.1.12.2/tools/node_modules/tslint/lib/tslint-cli.js b/test/TSLintVersion/packages/tslint.1.12.2/tools/node_modules/tslint/lib/tslint-cli.js new file mode 100644 index 0000000..c15f26f --- /dev/null +++ b/test/TSLintVersion/packages/tslint.1.12.2/tools/node_modules/tslint/lib/tslint-cli.js @@ -0,0 +1 @@ +// ... diff --git a/test/TSLintVersion/packages/tslint.1.3.5/tools/node_modules/tslint/lib/tslint-cli.js b/test/TSLintVersion/packages/tslint.1.3.5/tools/node_modules/tslint/lib/tslint-cli.js new file mode 100644 index 0000000..c15f26f --- /dev/null +++ b/test/TSLintVersion/packages/tslint.1.3.5/tools/node_modules/tslint/lib/tslint-cli.js @@ -0,0 +1 @@ +// ...