From 351033607789a0b7f9b5fb9b38ac9a50ee7fea91 Mon Sep 17 00:00:00 2001 From: spalger Date: Tue, 22 Sep 2015 18:58:14 -0700 Subject: [PATCH] [npm] added lint and lintroller scripts --- package.json | 4 +++- tasks/config/eslint.js | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 7d0669cfa515..eebe1285e6bf 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,9 @@ "start": "./bin/kibana --dev", "precommit": "grunt lintStagedFiles", "karma": "karma start", - "elasticsearch": "grunt esvm:dev:keepalive" + "elasticsearch": "grunt esvm:dev:keepalive", + "lint": "grunt eslint:source", + "lintroller": "grunt eslint:fixSource" }, "repository": { "type": "git", diff --git a/tasks/config/eslint.js b/tasks/config/eslint.js index c7bfd2547f7c..946688a9bb23 100644 --- a/tasks/config/eslint.js +++ b/tasks/config/eslint.js @@ -1,7 +1,25 @@ +var resolve = require('path').resolve; + module.exports = function (grunt) { return { // just lint the source dir source: { + options: { + cache: resolve(grunt.config.get('root'), '.eslint.fixSource.cache') + }, + + files: { + src: '<%= lintThese %>' + } + }, + + // just lint the source dir + fixSource: { + options: { + cache: resolve(grunt.config.get('root'), '.eslint.fixSource.cache'), + fix: true + }, + files: { src: '<%= lintThese %>' }