mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-24 18:58:42 +00:00
Merge "build/: Enforce no-var"
This commit is contained in:
commit
421b64e204
|
@ -8,6 +8,7 @@
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"max-len": "off",
|
"max-len": "off",
|
||||||
"mediawiki/valid-package-file-require": "off"
|
"mediawiki/valid-package-file-require": "off",
|
||||||
|
"no-var": "error"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,25 +2,22 @@
|
||||||
* Merge jsduck configuration files with a downstream one
|
* Merge jsduck configuration files with a downstream one
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* eslint-env node, es6 */
|
|
||||||
module.exports = function ( grunt ) {
|
module.exports = function ( grunt ) {
|
||||||
var _ = grunt.util._;
|
const _ = grunt.util._;
|
||||||
|
|
||||||
grunt.registerMultiTask( 'jsduckcatconfig', function () {
|
grunt.registerMultiTask( 'jsduckcatconfig', function () {
|
||||||
var targetFile = this.data.target,
|
const targetFile = this.data.target,
|
||||||
from = this.data.from,
|
from = this.data.from,
|
||||||
output = [];
|
output = [];
|
||||||
|
|
||||||
from.forEach( function ( src ) {
|
from.forEach( function ( src ) {
|
||||||
var srcCategories;
|
|
||||||
|
|
||||||
if ( typeof src === 'string' ) {
|
if ( typeof src === 'string' ) {
|
||||||
src = {
|
src = {
|
||||||
file: src
|
file: src
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
srcCategories = grunt.file.readJSON( src.file );
|
const srcCategories = grunt.file.readJSON( src.file );
|
||||||
|
|
||||||
if ( !src.include && !src.aggregate ) {
|
if ( !src.include && !src.aggregate ) {
|
||||||
// Default to a straight inclusion
|
// Default to a straight inclusion
|
||||||
|
@ -30,14 +27,13 @@ module.exports = function ( grunt ) {
|
||||||
|
|
||||||
if ( src.aggregate ) {
|
if ( src.aggregate ) {
|
||||||
_.forIn( src.aggregate, function ( targetCat, targetCatName ) {
|
_.forIn( src.aggregate, function ( targetCat, targetCatName ) {
|
||||||
var targetGroups = [];
|
const targetGroups = [];
|
||||||
// For each of the target category groups...
|
// For each of the target category groups...
|
||||||
targetCat.forEach( function ( targetGroupName ) {
|
targetCat.forEach( function ( targetGroupName ) {
|
||||||
// ... find the category in the aggregate source
|
// ... find the category in the aggregate source
|
||||||
srcCategories.forEach( function ( aggrCat ) {
|
srcCategories.forEach( function ( aggrCat ) {
|
||||||
var targetGroup;
|
|
||||||
if ( aggrCat.name === targetGroupName ) {
|
if ( aggrCat.name === targetGroupName ) {
|
||||||
targetGroup = {
|
const targetGroup = {
|
||||||
name: targetGroupName,
|
name: targetGroupName,
|
||||||
classes: []
|
classes: []
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue