Upgrade elint-config-wikimedia (drop eslint-plugin-qunit)

The following upgrade was made:

eslint-config-wikimedia | 0.8.1 | 0.9.0

The upgrade of eslint-config-wikimedia removes the need of
eslint-plugin-qunit as a peerDependency because it is now a hard
dependency [1] so it was removed in our package.json.

It appears the biggest change in the upgrade was the use of separate
profiles [2]. Given this, our root .eslintrc.json was updated to extend
from 'wikimedia/client'.

Several test files were flagged by the upgraded linter and were fixed in
this patch. Additionally, our build file was flagged for having too many
statements on one line. This rule was turned off in .eslintrc.es5.json

[1] https://github.com/wikimedia/eslint-config-wikimedia/blob/master/package.json#L48
[2] https://github.com/wikimedia/eslint-config-wikimedia/blob/master/CHANGELOG.md#090--2018-11-19

Bug: T209314
Change-Id: I29db72e77f04a327bc9c2b558c6d53849287bb80
This commit is contained in:
Nick Ray 2018-12-12 20:09:26 -07:00 committed by Nicholas Ray
parent 1594374fe2
commit c64497e5df
6 changed files with 19 additions and 9 deletions

View file

@ -49,6 +49,7 @@
"new-parens": 0,
"no-fallthrough": 0,
"no-implicit-coercion": 0,
"no-catch-shadow": 0
"no-catch-shadow": 0,
"max-statements-per-line": 0
}
}

View file

@ -1,6 +1,6 @@
{
"root": true,
"extends": "wikimedia",
"extends": "wikimedia/client",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": "6"

View file

@ -25,8 +25,7 @@
"babel-loader": "8.0.4",
"bundlesize": "0.17.0",
"clean-webpack-plugin": "1.0.0",
"eslint-config-wikimedia": "0.8.1",
"eslint-plugin-qunit": "3.3.1",
"eslint-config-wikimedia": "0.9.0",
"grunt": "1.0.3",
"grunt-banana-checker": "0.6.0",
"grunt-contrib-watch": "1.1.0",

View file

@ -14,8 +14,12 @@ const mw = mediaWiki,
*/
FETCH_RESOLUTION = { RESOLVE: 0, REJECT: 1 };
function identity( x ) { return x; }
function constant( x ) { return () => x; }
function identity( x ) {
return x;
}
function constant( x ) {
return () => x;
}
/*
* Integration tests for actions and state of the preview part of the system.

View file

@ -4,7 +4,9 @@ import { createStubUser } from './stubs';
QUnit.module( 'ext.popups.preview.settingsBehavior', {
beforeEach() {
function newFromText( title ) {
return { getUrl() { return `url/${ title }`; } };
return {
getUrl() { return `url/${ title }`; }
};
}
mediaWiki.Title = { newFromText };

View file

@ -2,8 +2,12 @@ import createSettingsDialogRenderer from '../../../src/ui/settingsDialogRenderer
QUnit.module( 'ext.popups/settingsDialogRenderer', {
beforeEach() {
function render() { return $( '<div>' ); }
function getTemplate() { return { render }; }
function render() {
return $( '<div>' );
}
function getTemplate() {
return { render };
}
mediaWiki.html = { escape: ( str ) => str };
mediaWiki.template = { get: getTemplate };