switch from eslint cli to gruntify-eslint

This commit is contained in:
spalger 2015-08-03 09:35:31 -07:00
parent ed330d8b76
commit e977e642d5
6 changed files with 20 additions and 14 deletions

View file

@ -58,7 +58,10 @@ module.exports = function (grunt) {
require('load-grunt-config')(grunt, {
configPath: __dirname + '/tasks/config',
init: true,
config: config
config: config,
loadGruntTasks: {
pattern: ['grunt-*', '@*/grunt-*', 'gruntify-*', '@*/gruntify-*']
}
});
// load task definitions

View file

@ -134,6 +134,7 @@
"grunt-run": "spalger/grunt-run#master",
"grunt-s3": "^0.2.0-alpha.3",
"grunt-simple-mocha": "^0.4.0",
"gruntify-eslint": "^1.0.0",
"html-entities": "^1.1.1",
"husky": "^0.8.1",
"karma": "^0.13.3",

12
tasks/config/eslint.js Normal file
View file

@ -0,0 +1,12 @@
module.exports = function (grunt) {
return {
// just lint the source dir
source: {
files: {
src: '<%= lintThese %>'
}
},
staged: {}
};
};

View file

@ -12,16 +12,6 @@ module.exports = function (grunt) {
},
cmd: './bin/kibana',
args: ['--dev', '--no-watch', '--logging.json=false']
},
eslint: {
cmd: root('node_modules/.bin/eslint'),
args: ['Gruntfile.js', 'src/', 'tasks/', '--ignore-path', root('.eslintignore'), '--color']
},
eslintStaged: {
cmd: root('node_modules/.bin/eslint'),
args: ['--ignore-path', root('.eslintignore'), '--color']
}
};

View file

@ -23,8 +23,8 @@ module.exports = function (grunt) {
grunt.log.debug(files);
if (!_.size(files)) return;
grunt.config.set('run.eslintStaged.args', _.union(grunt.config.get('run.eslintStaged.args'), files));
grunt.task.run(['run:eslintStaged']);
grunt.config.set('eslint.staged.files.src', files);
grunt.task.run(['eslint:staged']);
})
.nodeify(this.async());

View file

@ -7,7 +7,7 @@ module.exports = function (grunt) {
}
grunt.task.run(_.compact([
'run:eslint',
'eslint:source',
'maybeStartKibana',
'simplemocha:all',
'karma:unit'