I configured Gulp on ESLint javascript in HTML script tags with the following code.
const eslint = require('gulp-eslint');
gulp.task('process-js', () => {
const scripts = processInline();
return gulp.src(['src/*.html'])
.pipe(errorNotifier())
.pipe(scripts.extract('script'))
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError())
.pipe(scripts.restore())
.pipe(gulp.dest('dist'))
});
Run codeHide resultLinter works well, but it seems to give me line numbers that do not match my HTML files, and line numbers of extracted javascript from script tags that I never see.
How to get line numbers in an HTML file? Or can I better use javascript in an HTML script?
source
share