터미널에서 오류를 표시하기 위해 gulp-eslint
을 사용하려고하는데 작동하지 않습니다 ..! GitHub
에서내 gulp-eslint가 작동하지 않습니까?
내 프로젝트 소스 코드 :
https://github.com/nicefellow1234/react-skeleton 내 gulpfile.js
:
eslint.config.json
파일
"use strict";
var gulp = require('gulp');
var connect = require('gulp-connect'); // Runs a local Dev Server
var open = require('gulp-open'); // Open a URL in a Web Browser
var browserify = require('browserify'); // Bundles JS
var reactify = require('reactify'); // Transforms React JSX to JS
var source = require('vinyl-source-stream'); // Use Conventional text strams with Gulp
var concat = require('gulp-concat'); // Concatenates files
var lint = require('gulp-eslint'); // Lint JS files, including JSX
var config = {
port: 9005,
devBaseUrl: 'http:localhost',
paths: {
html: './src/*.html',
js: './src/**/*.js',
css : [
'node_modules/bootstrap/dist/css/bootstrap.min.css',
'node_modules/bootstrap/dist/css/bootstrap-theme.min.css'
],
dist: './dist',
mainJs: './src/main.js'
}
}
gulp.task('connect', function(){
connect.server({
root: ['dist'],
port: config.port,
base: config.devBaseUrl,
livereload: true
});
});
gulp.task('open', ['connect'], function() {
gulp.src(__filename)
.pipe(open({ uri : config.devBaseUrl + ':' + config.port + '/'}))
});
gulp.task('html', function() {
gulp.src(config.paths.html)
.pipe(gulp.dest(config.paths.dist))
.pipe(connect.reload());
});
gulp.task('js', function() {
browserify(config.paths.mainJs)
.transform(reactify)
.bundle()
.on('error',function() {
console.error(console)})
.pipe(source('bundle.js'))
.pipe(gulp.dest(config.paths.dist + '/scripts'))
.pipe(connect.reload());
});
gulp.task('css', function() {
gulp.src(config.paths.css)
.pipe(concat('bundle.css'))
.pipe(gulp.dest(config.paths.dist + '/css'));
});
gulp.task('lint', function() {
return gulp
.src(config.paths.js)
.pipe(lint({config: 'eslint.config.json'}))
.pipe(lint.format())
.pipe(lint.failAfterError());
});
gulp.task('watch', function(){
gulp.watch(config.paths.html, ['html']);
gulp.watch(config.paths.js, ['js','lint']);
});
gulp.task('default',['html','js','css','lint','open','watch']);
:
{
"ecmaFeatures": {
"jsx": true
},
"env": {
"browser": true,
"node": true,
"jquery": true
},
"rules": {
"quotes": 0,
"no-trailing-spaces": 0,
"eol-last": 0,
"no-unused-vars": 0,
"no-underscore-dangle": 0,
"no-alert": 0,
"no-lone-blocks": 0
},
"globals": {
"jQuery": true,
"$": true
}
}
내가 src
에 위치한 test: 1;
main.js
에 파일을 추가하려고 폴더를 저장 한 후 자동 다시로드 때 나는 그것이 년후 재로드를 중지 그럼 수동으로 다시로드 및로드를 유지, 그래서 또한
페이지 : 보풀이 작업은 다시 실행하지만 같이 터미널에서 오류를 포기하지 않았다 이 에스 프 린트 전에 일어난 일이 ..! 아무도 내가 여기에 문제가 뭔지 알려주시겠습니까 ?? 당신이 어떤 rules를 사용할 수 없습니다 때문
확인 응답, 내가 삭제됩니다 그것 –