sebastien 7 years ago
parent
commit
0caaf0b954
2 changed files with 13 additions and 6 deletions
  1. 10 4
      Tools/Gulp/gulpfile.js
  2. 3 2
      tslint.json

+ 10 - 4
Tools/Gulp/gulpfile.js

@@ -96,9 +96,11 @@ var externalTsConfig = {
 
 var minimist = require("minimist");
 var commandLineOptions = minimist(process.argv.slice(2), {
-    boolean: "public"
+    boolean: ["public", "tsLintFix"]
 });
 
+var tsLintFix = commandLineOptions.tsLintFix
+
 function processDependency(kind, dependency, filesToLoad, firstLevelOnly) {
     if (!firstLevelOnly && dependency.dependUpon) {
         for (var i = 0; i < dependency.dependUpon.length; i++) {
@@ -270,13 +272,11 @@ gulp.task("build", gulp.series("shaders", function build() {
 * Compiles all typescript files and creating a js and a declaration file.
 */
 gulp.task("typescript-compile", function () {
-    var program = tslint.Linter.createProgram("../../src/tsconfig.json");
-
     var tsResult = gulp.src(config.typescript)
         .pipe(gulpTslint({
             formatter: "stylish",
             configuration: "../../tslint.json",
-            program
+            fix: tsLintFix
         }))
         .pipe(gulpTslint.report())
         .pipe(sourcemaps.init())
@@ -370,6 +370,12 @@ var buildExternalLibrary = function (library, settings, watch) {
     var tsProcess;
     if (library.files && library.files.length) {
         tsProcess = gulp.src(library.files, { base: settings.build.srcOutputDirectory })
+            .pipe(gulpTslint({
+                formatter: "stylish",
+                configuration: "../../tslint.json",
+                fix: tsLintFix
+            }))
+            .pipe(gulpTslint.report())
             .pipe(sourcemaps.init())
             .pipe(typescript(externalTsConfig));
     }

+ 3 - 2
tslint.json

@@ -8,7 +8,7 @@
         "new-parens": true,
         "no-consecutive-blank-lines": true,
         "no-irregular-whitespace": true,
-        "semicolon": true,
+        "semicolon": [true, "always"],
         "space-before-function-paren": [true, "never"],
         "space-within-parens": true,
         "curly": true,
@@ -22,6 +22,7 @@
             "check-type",
             "check-typecast",
             "check-type-operator",
-            "check-preblock"]
+            "check-preblock"],
+        "indent": [true, "spaces", 4]
     }
 }