浏览代码

Exclude .fx.ts from lint

sebastien 6 年之前
父节点
当前提交
4dccce1584
共有 2 个文件被更改,包括 6 次插入1 次删除
  1. 3 0
      Tools/Gulp/helpers/gulp-processShaders.js
  2. 3 1
      Tools/Gulp/tasks/gulpTasks-tsLint.js

+ 3 - 0
Tools/Gulp/helpers/gulp-processShaders.js

@@ -40,6 +40,9 @@ function main() {
             let tsFilename = filename.replace('.fx', '.fx.ts');
             let data = file.contents.toString();
 
+            // Trailing whitespace...
+            data = data.replace(/[^\S\r\n]+$/gm, "");
+
             let tsContent = tsTemplate.replace('##NAME_PLACEHOLDER##', shaderName);
             tsContent = tsContent.replace('##SHADER_PLACEHOLDER##', data);
 

+ 3 - 1
Tools/Gulp/tasks/gulpTasks-tsLint.js

@@ -24,7 +24,7 @@ var config = require("../config.json");
  * TsLint all typescript files from the src directory.
  */
 gulp.task("typescript-tsLint", function() {
-    const dtsFilter = filter(['**', '!**/*.d.ts'], { restore: false });
+    const dtsFilter = filter(['**', '!**/*.d.ts', '!**/*.fx.ts'], { restore: false });
     return gulp.src(config.typescript)
         .pipe(dtsFilter)
         .pipe(gulpTslint(tsLintConfig))
@@ -35,7 +35,9 @@ gulp.task("typescript-tsLint", function() {
  * TsLint all typescript files from the src directory.
  */
 var tsLintExternalLibrary = function(library, settings, watch) {
+    const fxFilter = filter(['**', '!**/*.fx.ts'], { restore: false });
     return gulp.src((settings.build.srcDirectory) + "/**/*.ts")
+        .pipe(fxFilter)
         .pipe(gulpTslint(tsLintConfig))
         .pipe(gulpTslint.report());
 }