1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-13 16:45:05 +01:00

integrate es6lint

This commit is contained in:
Tim Daubenschütz 2015-06-05 09:17:41 +02:00
parent c177b95f45
commit ae4428795d
3 changed files with 59 additions and 2 deletions

37
.eslintrc Normal file
View File

@ -0,0 +1,37 @@
{
"parser": "babel-eslint",
"env": {
"browser": true,
"es6": true
},
"rules": {
"quotes": [2, "single"],
"eol-last": [0],
"no-mixed-requires": [0],
"no-underscore-dangle": [0],
"react/display-name": 1,
"react/jsx-boolean-value": 1,
"react/jsx-no-undef": 1,
"react/jsx-quotes": 1,
"react/jsx-sort-prop-types": 1,
"react/jsx-sort-props": 1,
"react/jsx-uses-react": 1,
"react/jsx-uses-vars": 1,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1,
"react/no-multi-comp": 1,
"react/no-unknown-property": 1,
"react/prop-types": 1,
"react/react-in-jsx-scope": 1,
"react/self-closing-comp": 1,
"react/sort-comp": 1,
"react/wrap-multilines": 1
},
"plugins": [
"react"
],
"ecmaFeatures": {
"jsx": true,
"modules": true
}
}

View File

@ -12,6 +12,7 @@ var notify = require('gulp-notify');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var _ = require('lodash');
var eslint = require('gulp-eslint');
var config = {
bootstrapDir: './node_modules/bootstrap-sass'
@ -21,7 +22,7 @@ gulp.task('build', function() {
bundle(false);
});
gulp.task('serve', ['browser-sync', 'sass', 'sass:watch', 'copy'], function() {
gulp.task('serve', ['browser-sync', 'sass', 'sass:watch', 'copy', 'lint'], function() {
bundle(true);
});
@ -64,6 +65,19 @@ gulp.task('copy', function () {
.pipe(gulp.dest('./build/fonts'));
});
gulp.task('lint', function () {
return gulp.src(['js/**/*.js'])
// eslint() attaches the lint output to the eslint property
// of the file object so it can be used by other modules.
.pipe(eslint())
// eslint.format() outputs the lint results to the console.
// Alternatively use eslint.formatEach() (see Docs).
.pipe(eslint.format())
// To have the process exit with an error code (1) on
// lint error, return the stream and pipe to failOnError last.
.pipe(eslint.failOnError());
});
function bundle(watch) {
var bro;

View File

@ -3,18 +3,25 @@
"version": "0.0.1",
"description": "Das neue web client for Ascribe",
"main": "js/app.js",
"scripts": {
"lint": "eslint ./js"
},
"author": "Ascribe",
"license": "Copyright",
"private": true,
"devDependencies": {
"babel-eslint": "^3.1.11",
"babel-jest": "^4.0.0",
"babelify": "^6.1.2",
"bootstrap-sass": "^3.3.4",
"browser-sync": "^2.7.5",
"browserify": "^9.0.8",
"envify": "^3.4.0",
"eslint": "^0.22.1",
"eslint-plugin-react": "^2.5.0",
"gulp": "^3.8.11",
"gulp-concat": "^2.5.2",
"gulp-eslint": "^0.13.2",
"gulp-if": "^1.2.5",
"gulp-notify": "^2.2.0",
"gulp-sass": "^2.0.1",
@ -37,7 +44,6 @@
"react-bootstrap": "~0.22.6",
"react-router": "^0.13.3",
"uglifyjs": "^2.4.10",
"react-bootstrap": "~0.22.6",
"react-datepicker": "~0.8.0"
},
"jest": {