X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=blobdiff_plain;f=Gruntfile.js;h=b7283412e4a107f0b7d3f6a9776fdea2528afcba;hp=a1d525e2224a783e10369b41a9c39ec1e179be7a;hb=f8731225f99a1f18d656607d7176d7ee51ee0057;hpb=b18478b935602e4b2c1b61ac807654e3ba714d1e diff --git a/Gruntfile.js b/Gruntfile.js index a1d525e2224..b7283412e4a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -98,22 +98,6 @@ module.exports = function(grunt) { return libs; }; - // An array of paths to third party directories. - var thirdPartyPaths = getThirdPartyPathsFromXML(); - - /** - * Determine if the file is a Moodle file, or its listed in - * the thirdpartylibs.xml file paths as a third party file. - * - * @param {string} file The file path to determine if thirdparty - * @return {bool} false If thid party file. - */ - var isMoodleFile = function(file) { - if (grunt.file.isMatch(thirdPartyPaths, file)) { - return false; - } - return true; - }; // Project configuration. grunt.initConfig({ @@ -129,7 +113,6 @@ module.exports = function(grunt) { // to YUI rollups. amd: { src: amdSrc, - filter: isMoodleFile, options: { rules: {'no-undef': 'error', 'no-unused-vars': 'error', 'no-empty': 'error', 'no-unused-expressions': 'error'} } @@ -137,7 +120,6 @@ module.exports = function(grunt) { // Check YUI module source files. yui: { src: ['**/yui/src/**/*.js', '!*/**/yui/src/*/meta/*.js'], - filter: isMoodleFile } }, uglify: { @@ -189,6 +171,8 @@ module.exports = function(grunt) { * Generate ignore files (utilising thirdpartylibs.xml data) */ tasks.ignorefiles = function() { + // An array of paths to third party directories. + var thirdPartyPaths = getThirdPartyPathsFromXML(); // Generate .eslintignore. var eslintIgnores = ['# Generated by "grunt ignorefiles"', '*/**/yui/src/*/meta/', '*/**/build/'].concat(thirdPartyPaths); grunt.file.write('.eslintignore', eslintIgnores.join('\n'));