From 85087e6cd778ba23197c2c3f9504a724257be26c Mon Sep 17 00:00:00 2001 From: Artur Kot Date: Wed, 12 Apr 2017 12:24:39 +0200 Subject: [PATCH 1/2] Add vendor dirs, exclude them from linting --- generators/app/templates/gulp/tasks/lint.js | 4 ++-- generators/app/templates/scripts/vendor/.keep | 0 generators/app/templates/styles/vendor/.keep | 0 generators/app/utils/generator.js | 2 ++ 4 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 generators/app/templates/scripts/vendor/.keep create mode 100644 generators/app/templates/styles/vendor/.keep diff --git a/generators/app/templates/gulp/tasks/lint.js b/generators/app/templates/gulp/tasks/lint.js index c90a8a99..d505bdc3 100644 --- a/generators/app/templates/gulp/tasks/lint.js +++ b/generators/app/templates/gulp/tasks/lint.js @@ -4,14 +4,14 @@ var path = require('path'); var lintTask = function (gulp, plugins, config) { gulp.task('lint-js', function() { - return gulp.src([path.join(config.src.base, config.src.scripts), '!node_modules/**']) + return gulp.src([path.join(config.src.base, config.src.scripts), '!node_modules/**', '!src/scripts/vendor/**']) .pipe(plugins.eslint()) .pipe(plugins.eslint.format()) .pipe(plugins.eslint.failAfterError()); }); gulp.task('lint-css', function() { - return gulp.src(path.join(config.src.base, config.src.styles)) + return gulp.src([path.join(config.src.base, config.src.styles), '!src/styles/vendor/**']) .pipe(plugins.stylelint({ reporters: [ {formatter: 'string', console: true} diff --git a/generators/app/templates/scripts/vendor/.keep b/generators/app/templates/scripts/vendor/.keep new file mode 100644 index 00000000..e69de29b diff --git a/generators/app/templates/styles/vendor/.keep b/generators/app/templates/styles/vendor/.keep new file mode 100644 index 00000000..e69de29b diff --git a/generators/app/utils/generator.js b/generators/app/utils/generator.js index 08dc7241..e5a5536f 100644 --- a/generators/app/utils/generator.js +++ b/generators/app/utils/generator.js @@ -48,10 +48,12 @@ var Generator = { }, stylesheets: function () { + helpers.copy.call(this, 'styles/vendor/.keep', 'src/styles/vendor/.keep'); helpers.copy.call(this, 'styles/itcss/**/*', 'src/styles/', this.prompts); }, javascripts: function () { + helpers.copy.call(this, 'scripts/vendor/.keep', 'src/scripts/vendor/.keep'); helpers.copy.call(this, 'scripts/browserify/**/*', 'src/scripts/', this.prompts); } }; From 2df3590b406b0544bc146bcb6235c89dc86f2e81 Mon Sep 17 00:00:00 2001 From: Artur Kot Date: Wed, 12 Apr 2017 15:34:49 +0200 Subject: [PATCH 2/2] Styelint, Eslint: use ignore files instead of gulp tasks --- generators/app/templates/.eslintignore | 2 ++ generators/app/templates/.stylelintignore | 1 + generators/app/templates/gulp/tasks/lint.js | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 generators/app/templates/.eslintignore create mode 100644 generators/app/templates/.stylelintignore diff --git a/generators/app/templates/.eslintignore b/generators/app/templates/.eslintignore new file mode 100644 index 00000000..022b9885 --- /dev/null +++ b/generators/app/templates/.eslintignore @@ -0,0 +1,2 @@ +node_modules +vendor diff --git a/generators/app/templates/.stylelintignore b/generators/app/templates/.stylelintignore new file mode 100644 index 00000000..22d0d82f --- /dev/null +++ b/generators/app/templates/.stylelintignore @@ -0,0 +1 @@ +vendor diff --git a/generators/app/templates/gulp/tasks/lint.js b/generators/app/templates/gulp/tasks/lint.js index d505bdc3..d8dbc33c 100644 --- a/generators/app/templates/gulp/tasks/lint.js +++ b/generators/app/templates/gulp/tasks/lint.js @@ -4,14 +4,14 @@ var path = require('path'); var lintTask = function (gulp, plugins, config) { gulp.task('lint-js', function() { - return gulp.src([path.join(config.src.base, config.src.scripts), '!node_modules/**', '!src/scripts/vendor/**']) + return gulp.src(path.join(config.src.base, config.src.scripts)) .pipe(plugins.eslint()) .pipe(plugins.eslint.format()) .pipe(plugins.eslint.failAfterError()); }); gulp.task('lint-css', function() { - return gulp.src([path.join(config.src.base, config.src.styles), '!src/styles/vendor/**']) + return gulp.src(path.join(config.src.base, config.src.styles)) .pipe(plugins.stylelint({ reporters: [ {formatter: 'string', console: true}