Skip to content

Commit bcf1065

Browse files
authored
Merge pull request #79 from FullstackAcademy/eslint-env
Split production and dev linting
2 parents 0a609f7 + f6d1374 commit bcf1065

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

generated/.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
},
1313
"rules": {
1414
"global-require": 0, // 0 = off, 1 = warn (yellow), 2 = error (red)
15-
"camelcase": 0
15+
"camelcase": 0,
16+
"no-debugger": 1
1617
// add more rules here to override the fullstack config
1718
}
1819
}

generated/gulpfile.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,22 @@ gulp.task('buildCSS', function () {
109109
// Production tasks
110110
// --------------------------------------------------------------
111111

112+
gulp.task('lintJSProduction', function () {
113+
114+
return gulp.src(['./browser/js/**/*.js', './server/**/*.js'])
115+
.pipe(plumber({
116+
errorHandler: notify.onError('Linting FAILED! Check your gulp process.')
117+
}))
118+
.pipe(eslint({
119+
rules: {
120+
'no-debugger': 2 // 1 in dev
121+
}
122+
}))
123+
.pipe(eslint.format())
124+
.pipe(eslint.failOnError());
125+
126+
});
127+
112128
gulp.task('buildCSSProduction', function () {
113129
return gulp.src('./browser/scss/main.scss')
114130
.pipe(sass())

0 commit comments

Comments
 (0)