mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
syntax change, output staged file count
This commit is contained in:
parent
ff9b273a2b
commit
2d43d1cbe9
1 changed files with 7 additions and 4 deletions
|
@ -17,14 +17,17 @@ module.exports = function (grunt) {
|
|||
var patterns = grunt.config.get('eslint.source.files.src');
|
||||
if (!patterns) grunt.fail.warn('eslint file pattern is not defined');
|
||||
|
||||
files = files.split('\n').filter(Boolean).map(function (file) {
|
||||
files = files.split('\n').filter(Boolean)
|
||||
.map(function (file) {
|
||||
return resolve(root, file);
|
||||
})
|
||||
.filter(function (file) {
|
||||
return grunt.file.isMatch(patterns, file);
|
||||
});
|
||||
|
||||
files = grunt.file.match(patterns, files);
|
||||
grunt.log.debug(files);
|
||||
|
||||
grunt.log.ok('Staged files to lint: ' + files.length);
|
||||
if (!_.size(files)) return;
|
||||
|
||||
grunt.config.set('eslint.staged.files.src', files);
|
||||
grunt.task.run(['eslint:staged']);
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue