From f8731225f99a1f18d656607d7176d7ee51ee0057 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Wed, 15 Jun 2016 15:50:46 +0100 Subject: [PATCH] MDL-52127 grunt: add .eslingingore file, keep task Eloy prefers we keep the ignorefiles grunt task --- .eslintignore | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 1 - Gruntfile.js | 20 ++---------------- 3 files changed, 59 insertions(+), 19 deletions(-) create mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000000..4c89fdbe7c687 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,57 @@ +# Generated by "grunt ignorefiles" +*/**/yui/src/*/meta/ +*/**/build/ +node_modules/ +vendor/ +auth/cas/CAS/ +auth/fc/fcFPP.php +enrol/lti/ims-blti/ +filter/algebra/AlgParser.pm +filter/tex/mimetex.* +lib/editor/atto/yui/src/rangy/js/*.* +lib/editor/tinymce/plugins/pdw/tinymce/ +lib/editor/tinymce/plugins/spellchecker/rpc.php +lib/editor/tinymce/tiny_mce/ +lib/adodb/ +lib/alfresco/ +lib/bennu/ +lib/evalmath/ +lib/lessphp/ +lib/phpexcel/ +lib/pear/Net/ +lib/google/ +lib/htmlpurifier/ +lib/jabber/ +lib/minify/ +lib/flowplayer/ +lib/password_compat/ +lib/pear/Auth/RADIUS.php +lib/pear/Crypt/CHAP.php +lib/pear/HTML/Common.php +lib/pear/HTML/QuickForm.php +lib/pear/HTML/QuickForm/ +lib/pear/PEAR.php +lib/phpmailer/ +lib/simplepie/ +lib/tcpdf/ +lib/typo3/ +lib/yuilib/ +lib/yuilib/gallery/ +lib/jquery/ +lib/html2text/ +lib/markdown/ +lib/recaptchalib.php +lib/xhprof/ +lib/xmlize.php +lib/horde/ +lib/requirejs/ +lib/amd/src/loglevel.js +lib/mustache/ +lib/amd/src/mustache.js +lib/graphlib.php +lib/spout/ +mod/assign/feedback/editpdf/fpdi/ +repository/s3/S3.php +theme/bootstrapbase/less/bootstrap/ +theme/bootstrapbase/javascript/html5shiv.js +theme/bootstrapbase/amd/src/bootstrap.js \ No newline at end of file diff --git a/.gitignore b/.gitignore index 71a7224e0ab33..1dab0f7a5c1f7 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,3 @@ composer.phar /lib/yuilib/*/*/*-coverage.js atlassian-ide-plugin.xml /node_modules/ -.eslintignore diff --git a/Gruntfile.js b/Gruntfile.js index a1d525e2224a7..b7283412e4a10 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'));