eslint: Remove exception for computed-property-spacing

Change-Id: Ief22145c02379bdb3d37c96c5e1ef50f0ab519cf
This commit is contained in:
Ed Sanders 2018-11-27 12:29:39 +00:00
parent dc5077dbae
commit 6c53e320bf
7 changed files with 31 additions and 32 deletions

View file

@ -42,7 +42,6 @@
}
}],
"object-property-newline": "error",
"computed-property-spacing": 0,
"no-use-before-define": 0,
"no-underscore-dangle": 0
}

View file

@ -15,7 +15,7 @@
*/
function getAndroidVersion( userAgent ) {
var match = userAgent.toLowerCase().match( /android\s(\d\.]*)/ );
return match ? parseInt( match[1] ) : false;
return match ? parseInt( match[ 1 ] ) : false;
}
/**
@ -26,7 +26,7 @@
*/
function getChromeVersion( userAgent ) {
var match = userAgent.toLowerCase().match( /chrom(e|ium)\/(\d+)\./ );
return match ? parseInt( match[2] ) : false;
return match ? parseInt( match[ 2 ] ) : false;
}
/**

View file

@ -85,7 +85,7 @@
*/
function getDeviceLanguage() {
var lang = navigator && navigator.languages ?
navigator.languages[0] :
navigator.languages[ 0 ] :
navigator.language || navigator.userLanguage ||
navigator.browserLanguage || navigator.systemLanguage;

View file

@ -147,13 +147,13 @@
}
} );
// store it for later
allIssues[section] = issueSummaries;
allIssues[ section ] = issueSummaries;
if ( inline ) {
issueSummaries.forEach( function ( issueSummary, i ) {
var isGrouped = issueSummary.issue.grouped,
lastIssueIsGrouped = issueSummaries[ i - 1] &&
issueSummaries[ i - 1].issue.grouped;
lastIssueIsGrouped = issueSummaries[ i - 1 ] &&
issueSummaries[ i - 1 ].issue.grouped;
// only render the first grouped issue of each group
if ( isGrouped && !lastIssueIsGrouped ) {
createPageIssueBannerMultiple( issueSummary, mw.msg( 'skin-minerva-issue-learn-more' ), issueUrl, overlayManager );
@ -176,14 +176,14 @@
*/
function getIssues( section ) {
if ( section !== KEYWORD_ALL_SECTIONS ) {
return allIssues[section] || [];
return allIssues[ section ] || [];
}
// Note section.all may not exist, depending on the structure of the HTML page.
// It will only exist when Minerva has been run in desktop mode.
// If it's absent, we'll reduce all the other lists into one.
return allIssues.all || Object.keys( allIssues ).reduce(
function ( all, key ) {
return all.concat( allIssues[key] );
return all.concat( allIssues[ key ] );
},
[]
);
@ -200,7 +200,7 @@
return Object.keys( allIssues ).reduce( function ( acc, section ) {
if ( allIssues[ section ].length ) {
allIssues[ section ].forEach( function ( issue, i ) {
var lastIssue = allIssues[ section ][i - 1];
var lastIssue = allIssues[ section ][ i - 1 ];
// If the last issue belongs to a "Multiple issues" template,
// and so does the current one, don't add the current one.
if ( lastIssue && lastIssue.grouped && issue.grouped ) {

View file

@ -109,7 +109,7 @@
function parseSeverity( box ) {
var severity, identified;
identified = Object.keys( SEVERITY_REGEX ).some( function ( key ) {
var regex = SEVERITY_REGEX[key];
var regex = SEVERITY_REGEX[ key ];
severity = key;
return regex.test( box.className );
} );
@ -124,13 +124,13 @@
function parseType( box, severity ) {
var identified, identifiedType;
identified = Object.keys( TYPE_REGEX ).some( function ( type ) {
var regex = TYPE_REGEX[type];
var regex = TYPE_REGEX[ type ];
identifiedType = type;
return regex.test( box.className );
} );
return {
name: identified ? ICON_NAME.TYPE[identifiedType] : ICON_NAME.SEVERITY[severity],
severity: identified ? TYPE_SEVERITY[identifiedType] : severity
name: identified ? ICON_NAME.TYPE[ identifiedType ] : ICON_NAME.SEVERITY[ severity ],
severity: identified ? TYPE_SEVERITY[ identifiedType ] : severity
};
}
@ -151,7 +151,7 @@
var nameSeverity = parseType( box, severity );
// The icon with color variant as expected by ResourceLoader,
// {iconName}-{severityColorVariant}.
return nameSeverity.name + '-' + ICON_COLOR[nameSeverity.severity];
return nameSeverity.name + '-' + ICON_COLOR[ nameSeverity.severity ];
}
/**
@ -160,7 +160,7 @@
*/
function maxSeverity( severityLevels ) {
return severityLevels.reduce( function ( max, severity ) {
return SEVERITY_LEVEL[max] > SEVERITY_LEVEL[severity] ? max : severity;
return SEVERITY_LEVEL[ max ] > SEVERITY_LEVEL[ severity ] ? max : severity;
}, 'DEFAULT' );
}

View file

@ -49,7 +49,7 @@
// fragment
urlComponents = href.split( '#' );
if ( urlComponents.length > 1 ) {
href = '#' + urlComponents[1];
href = '#' + urlComponents[ 1 ];
}
result = drawer.showReference( href, page, $dest.text() );
// Previously showReference method returns nothing so we check its truthy

View file

@ -72,9 +72,9 @@
];
tests.forEach( function ( params, i ) {
var
className = params[0],
expect = params[1],
test = params[2],
className = params[ 0 ],
expect = params[ 1 ],
test = params[ 2 ],
box = newBox( className );
assert.strictEqual(
pageIssuesParser.test.parseSeverity( box ),
@ -97,13 +97,13 @@
];
tests.forEach( function ( params, i ) {
var
className = params[0],
severity = params[1],
className = params[ 0 ],
severity = params[ 1 ],
expect = {
name: params[2],
name: params[ 2 ],
severity: severity
},
test = params[3],
test = params[ 3 ],
box = newBox( className );
assert.propEqual(
pageIssuesParser.test.parseType( box, severity ),
@ -121,9 +121,9 @@
];
tests.forEach( function ( params, i ) {
var
parentClassName = params[0],
expect = params[1],
test = params[2],
parentClassName = params[ 0 ],
expect = params[ 1 ],
test = params[ 2 ],
parent,
box = newBox( '' );
if ( parentClassName !== undefined ) {
@ -154,9 +154,9 @@
];
tests.forEach( function ( params, i ) {
var
className = params[0],
severity = params[1],
expect = params[2],
className = params[ 0 ],
severity = params[ 1 ],
expect = params[ 2 ],
box = newBox( className );
assert.strictEqual(
pageIssuesParser.iconName( box, severity ),
@ -177,8 +177,8 @@
[ [ 'DEFAULT', 'HIGH', 'LOW', 'MEDIUM' ], 'HIGH' ]
];
tests.forEach( function ( params, i ) {
var severities = params[0],
expect = params[1];
var severities = params[ 0 ],
expect = params[ 1 ];
assert.strictEqual(
pageIssuesParser.maxSeverity( severities ),