Skip to content

Commit

Permalink
MDL-52127 grunt: add .eslingingore file, keep task
Browse files Browse the repository at this point in the history
Eloy prefers we keep the ignorefiles grunt task
  • Loading branch information
danpoltawski committed Jun 15, 2016
1 parent b18478b commit f873122
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 19 deletions.
57 changes: 57 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ composer.phar
/lib/yuilib/*/*/*-coverage.js
atlassian-ide-plugin.xml
/node_modules/
.eslintignore
20 changes: 2 additions & 18 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -129,15 +113,13 @@ 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'}
}
},
// Check YUI module source files.
yui: {
src: ['**/yui/src/**/*.js', '!*/**/yui/src/*/meta/*.js'],
filter: isMoodleFile
}
},
uglify: {
Expand Down Expand Up @@ -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'));
Expand Down

0 comments on commit f873122

Please sign in to comment.