###前提・実現したいこと
「ゼロから始めるJavaScript生活」というjavascriptフルスタックを目指すチュートリアルの途中のLintの導入でつまずいています。
http://qiita.com/takahashim/items/7838334d1451fb0a9811#6---eslint
”6 - ESLint”を終えた段階ですが、記載のようにエラーが消えず、発生したままになってしまいます。
対処法をお教えいただきたく。。。
###発生している問題・エラーメッセージ
yarn start v0.27.5 $ gulp [07:41:35] Requiring external module babel-register [07:41:36] Using gulpfile ~/workspace/nodetest/gulpfile.babel.js [07:41:36] Starting 'watch'... [07:41:36] Finished 'watch' after 22 ms [07:41:36] Starting 'lint'... [07:41:36] Starting 'clean'... [07:41:36] Finished 'clean' after 22 ms [07:41:39] /home/ubuntu/workspace/nodetest/src/dog.js 1:1 error Definition for rule 'jsx-a11y/href-no-hash' was not found jsx-a11y/href-no-hash /home/ubuntu/workspace/nodetest/src/index.js 2:1 error Definition for rule 'jsx-a11y/href-no-hash' was not found jsx-a11y/href-no-hash /home/ubuntu/workspace/nodetest/gulpfile.babel.js 2:1 error Definition for rule 'jsx-a11y/href-no-hash' was not found jsx-a11y/href-no-hash 21:35 error Missing trailing comma comma-dangle 29:35 error Missing trailing comma comma-dangle 34:5 warning Unexpected console statement no-console ✖ 6 problems (5 errors, 1 warning) 2 errors, 0 warnings potentially fixable with the `--fix` option. [07:41:39] 'lint' errored after 2.91 s [07:41:39] ESLintError in plugin 'gulp-eslint' Message: Failed with 5 errors
###該当のソースコード
すべてのソースはGithubにあります。
https://github.com/ksyunnnn/zero-js-life
どこに原因があるのかわからないので、いくつかピックして記載します。
gulpfile.babel.js
js
1/* eslint-disable import/no-extraneous-dependencies */ 2import gulp from 'gulp'; 3import babel from 'gulp-babel'; 4import del from 'del'; 5import { exec } from 'child_process'; 6import eslint from 'gulp-eslint'; 7 8const paths = { 9 allSrcJs: 'src/**/*.js', 10 gulpFile: 'gulpfile.babel.js', 11 libDir: 'lib', 12}; 13 14gulp.task('lint', () => 15 gulp.src([ 16 paths.allSrcJs, 17 paths.gulpFile, 18 ]) 19 .pipe(eslint()) 20 .pipe(eslint.format()) 21 .pipe(eslint.failAfterError()) 22); 23 24gulp.task('clean', () => del(paths.libDir)); 25 26gulp.task('build', ['lint', 'clean'], () => 27 gulp.src(paths.allSrcJs) 28 .pipe(babel()) 29 .pipe(gulp.dest(paths.libDir)) 30); 31 32gulp.task('main', ['build'], (callback) => { 33 exec(`node ${paths.libDir}`, (error, stdout) => { 34 console.log(stdout); 35 return callback(error); 36 }); 37}); 38 39gulp.task('watch', () => { 40 gulp.watch(paths.allSrcJs, ['main']); 41}); 42 43gulp.task('default', ['watch', 'main']);
index.js
js
1/* eslint-disable no-console */ 2import Dog from './dog'; 3 4const toby = new Dog('Toby'); 5console.log(toby.bark());
dog.js
js
1class Dog { 2 constructor(name) { 3 this.name = name; 4 } 5 6 bark() { 7 return `Wah wah, I am ${this.name}`; 8 } 9} 10 11export default Dog;
###試したこと
ESLintのバージョンに問題がある?といった記事をみかけましたが、実際はよくわかっていませんm(_ _)m
https://github.com/facebookincubator/create-react-app/issues/2631
###補足情報(言語/FW/ツール等のバージョンなど)
- node : v6.11.1
- IDE : Cloud9
よろしくお願いいたしますm(_ _)m

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/07/27 08:51