Browse Source

Enable linting for Travis (#3331)

* Enable linting for Travis

Since all code has been linted (thanks **TODO**!), it is now safe to enable linting for Travis.

Some cleanup actions have been performed; notably the additional `gulp` tasks for modules has
been removed. Since all code has been fixed for linting, these are not useful any more.

* Force linting error to check travis working

* Travis works! Remove forced linting error
revert-3409-performance
wimrijnders 7 years ago
committed by Yotam Berkowitz
parent
commit
aa07e2fa2f
4 changed files with 12 additions and 40 deletions
  1. +4
    -13
      .eslintrc
  2. +1
    -1
      .travis.yml
  3. +6
    -25
      gulpfile.js
  4. +1
    -1
      package.json

+ 4
- 13
.eslintrc View File

@ -12,23 +12,14 @@
"extends": "eslint:recommended",
// For the full list of rules, see: http://eslint.org/docs/rules/
"rules": {
"complexity": [2, 55],
"max-statements": [2, 115],
"no-unreachable": 1,
"no-useless-escape": 0,
"no-console": 0,
"no-useless-escape": 0
/*
// some disabled options which might be useful
"no-empty": 0,
"no-extra-semi": 0,
"no-fallthrough": 0,
"no-inner-declarations": 0,
"no-mixed-spaces-and-tabs": 0,
"no-redeclare": 0,
"no-unused-vars": 0,
// following will flag presence of console.log as error.
"no-console": ["error", { allow: ["warn", "error"] }],
*/
// To flag presence of console.log without breaking linting:
//"no-console": ["warn", { allow: ["warn", "error"] }],
}
}

+ 1
- 1
.travis.yml View File

@ -11,7 +11,7 @@ addons:
- libgif-dev
- g++-4.8
before_script:
# - npm run lint
- npm run lint
- npm install gulp
script:
- gulp

+ 6
- 25
gulpfile.js View File

@ -218,38 +218,19 @@ gulp.task('watch', watchTasks, function () {
});
////////////////////////////////////////////////////////////////////////////////////////
// Linting
//
// Linting has intentionally NOT been added yet to the default task; there are simply
// too many errors at the moment to make this comfortable. Run it separately with:
// Linting usage:
//
// > gulp lint or > gulp lint-<module name>
// > gulp lint
// or > npm run lint
//
// This is set up so that 'gulp lint' runs the linting over the complete lib directory.
// You can also run linting on the separate modules, e.g. 'gulp lint-network' for just
// the network module. Scan the tasks below for the available lint commands.
//
// Note that currently a separate lint is missing for Graph2d, DataSet and DataGroup.
////////////////////////////////////////////////////////////////////////////////////////
function runLintTask(pathPrefix) {
return gulp.src([ pathPrefix + '/**/*.js', '!node_modules/**'])
gulp.task('lint', function () {
return gulp.src(['lib/**/*.js', '!node_modules/**'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
}
gulp.task('lint', function () {return runLintTask('lib');});
gulp.task('lint-timeline', function () {return runLintTask('lib/timeline');});
gulp.task('lint-network', function () {return runLintTask('lib/network');});
gulp.task('lint-graph3d', function () {return runLintTask('lib/graph3d');});
});
////////////////////////////////////////////////////////////////////////////////////////
// End Linting
////////////////////////////////////////////////////////////////////////////////////////
// The default task (called when you run `gulp`)
gulp.task('default', ['clean', 'bundle', 'minify']);

+ 1
- 1
package.json View File

@ -28,7 +28,7 @@
"scripts": {
"test": "mocha --compilers js:babel-core/register",
"build": "gulp",
"lint": "eslint lib",
"lint": "gulp lint",
"watch": "gulp watch",
"watch-dev": "gulp watch --bundle"
},

Loading…
Cancel
Save