Skip to content
This repository was archived by the owner on Oct 20, 2022. It is now read-only.

Commit 1bea99d

Browse files
committed
build: add directives to ignore JSLint and ESLint in minified version
1 parent 149a046 commit 1bea99d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

build/gulpfile.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ var umd = fs.readFileSync("./umd.js", "utf8");
3232
var umdHeader = umd.substring(0, umd.indexOf('//@@HASPLAYER'));
3333
var umdFooter = umd.substring(umd.indexOf('//@@HASPLAYER') + '//@@HASPLAYER'.length);
3434

35-
// Jshint ignore directives for minifiled build file
36-
var jshint_ignore_start = '/* jshint ignore:start */\n';
37-
var jshint_ignore_end = '\n/* jshint ignore:end */';
35+
// JSHint/JSLint/ESLint ignore directives for minifiled build file
36+
var lint_ignore_start = '/* jshint ignore:start */\n/* ignore jslint start */\n/* eslint-disable */\n';
37+
var lint_ignore_end = '\n/* jshint ignore:end */\n/* ignore jslint end */\n/* eslint-enable */';
3838

3939
var config = {
4040
distDir: '../dist',
@@ -135,8 +135,8 @@ gulp.task('build-src', function() {
135135
.pipe(header(umdHeader))
136136
.pipe(footer(umdFooter))
137137
.pipe(gulpif(minify, uglify()))
138-
.pipe(gulpif(minify, header(jshint_ignore_start)))
139-
.pipe(gulpif(minify, footer(jshint_ignore_end)))
138+
.pipe(gulpif(minify, header(lint_ignore_start)))
139+
.pipe(gulpif(minify, footer(lint_ignore_end)))
140140
.pipe(header(comment, {pkg: pkg}))
141141
.pipe(sourcemaps.write('.'))
142142
.pipe(gulp.dest(config.distDir));

0 commit comments

Comments
 (0)