From e10b831a918cca4681313803c6fdb7b4e7b76e45 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Tue, 27 Sep 2016 20:19:35 +0300 Subject: [PATCH] Added jshint and jscs checks to Grunt tasks. --- Gruntfile.js | 27 ++++++++++++++++++++++++++- package.json | 3 +++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 646705d..a26d125 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -68,6 +68,29 @@ module.exports = function(grunt) { 'dist/panel-triggers/css/panel_triggers.css' : 'src/panel-triggers/sass/panel_triggers.scss', } } + }, + + jshint: { + source: { + files: { + src: ['src/**/*.js'], + } + }, + options: { + jshintrc: true, + reporter: require('jshint-stylish'), + ignores: [ + 'node_modules/*', + 'dist/*', + ] + } + }, + + jscs: { + src: ['src/**/*.js'], + options: { + config: ".jscs.json", + }, } }); @@ -76,7 +99,9 @@ module.exports = function(grunt) { 'clean', 'copy:src_to_dist', 'copy:pluginDef', + 'sass', 'babel', - 'sass' + 'jshint', + 'jscs' ]); }; diff --git a/package.json b/package.json index b4b96f1..560e34b 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,9 @@ "babel-plugin-transform-es2015-modules-systemjs": "^6.5.0", "babel-plugin-transform-es2015-for-of": "^6.5.0", "babel-preset-es2015": "^6.5.0", + "grunt-contrib-jshint": "^1.0.0", + "grunt-jscs": "^2.8.0", + "jshint-stylish": "^2.1.0", "lodash": "~4.0.0" }, "homepage": "http://grafana-zabbix.org"