diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 4ee202f..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - "extends": "airbnb" -}; \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..a63d482 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,22 @@ +const gulp = require('gulp'); +const eslint = require('gulp-eslint'); + +const srcDir = [ + 'src/*.js', + 'src/**/*.js', +]; + +function checkSrc() { + return gulp.src(srcDir) + .pipe(eslint()) + .pipe(eslint.format()) + .pipe(eslint.failAfterError()); +} + +function watchEslint() { + gulp.watch(srcDir, checkSrc); +} + +gulp.task('check:lint', checkSrc); +gulp.task('watch:lint', watchEslint); +gulp.task('default', gulp.parallel('watch:lint')); diff --git a/package.json b/package.json index c61a304..8078618 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "homepage": "https://outils.darkou.fr/", "dependencies": { "bootstrap": "^4.1.3", + "proptypes": "^1.1.0", "react": "^16.4.1", "react-dom": "^16.4.1", "react-md-file": "^1.1.0", @@ -20,10 +21,12 @@ }, "devDependencies": { "@svgr/cli": "^2.2.0", - "eslint": "^4.19.1", + "eslint": "^5.16.0", "eslint-config-airbnb": "^17.1.0", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-jsx-a11y": "^6.1.1", - "eslint-plugin-react": "^7.11.1" + "eslint-plugin-import": "^2.18.0", + "eslint-plugin-jsx-a11y": "^6.2.1", + "eslint-plugin-react": "^7.14.2", + "gulp": "^4.0.2", + "gulp-eslint": "^5.0.0" } }