* [eslint] upgrade to 4.10.0
* [eslint-config-kibana] limit jest config to jest test files
* [ui_framework] remove trailing comma from rest-spreads
* [dashboard/tests] tag jest helpers with .test.js suffix
* explicitly import expect.js where used
* [eslint] apply auto-fixes
* [eslint] manually add/wrap some parens for compliance
* [npm] point to local packages for testing/review
* [jest] remove .test extension from jest helpers
* [ui_framework] fix trailing comma removal from 3bc661a1c8
* [packages] upgrade eslint packages
20 lines
643 B
JavaScript
20 lines
643 B
JavaScript
import { isAdded, getFilename } from './utils/files_to_commit';
|
|
|
|
export default function registerCheckAddedFilenames(grunt) {
|
|
grunt.registerTask('checkAddedFilenames', function () {
|
|
grunt.task.requires('collectFilesToCommit');
|
|
|
|
const invalid = grunt.config
|
|
.get('filesToCommit')
|
|
.map(getFilename)
|
|
.filter(isAdded)
|
|
.filter(name => !name.match(/([\/\\]|^)(docs|tasks[\/\\]config|webpackShims)([\/\\]|$)/))
|
|
.filter(name => name.match(/[A-Z \-]/))
|
|
.reduce((all, name) => `${all} ${name}\n`, '');
|
|
|
|
if (invalid) {
|
|
grunt.fail.fatal(`Filenames must use snake_case.\n${invalid}`);
|
|
}
|
|
});
|
|
}
|