build: Update linters

Change-Id: I713aafb891306fc21a776a7d4622c6a039798753
This commit is contained in:
Ed Sanders 2019-11-15 17:26:44 +00:00
parent 1461ff1c91
commit 80ddee3956
12 changed files with 795 additions and 480 deletions

View file

@ -2,14 +2,14 @@
"root": true,
"extends": [
"wikimedia/client",
"wikimedia/jquery"
"wikimedia/jquery",
"wikimedia/mediawiki"
],
"env": {
"commonjs": true
},
"globals": {
"OO": false,
"mw": false
"OO": "readonly"
},
"rules": {
"max-len": 0

View file

@ -11,12 +11,11 @@ module.exports = function ( grunt ) {
grunt.initConfig( {
eslint: {
options: {
reportUnusedDisableDirectives: true,
extensions: [ '.js', '.json' ],
cache: true
},
all: [
'**/*.js{,on}',
'**/*.{js,json}',
'!{tests/externals,docs}/**',
'!{vendor,node_modules}/**'
]
@ -27,8 +26,7 @@ module.exports = function ( grunt ) {
syntax: 'less'
},
all: [
'modules/**/*.css',
'modules/**/*.less'
'modules/**/*.{css,less}'
]
},
// SVG Optimization
@ -67,7 +65,10 @@ module.exports = function ( grunt ) {
} ]
}
},
banana: conf.MessagesDirs,
// eslint-disable-next-line no-restricted-properties
banana: Object.assign( {
options: { requireLowerCase: false }
}, conf.MessagesDirs ),
watch: {
files: [
'.{stylelintrc,eslintrc}.json',

View file

@ -37,7 +37,9 @@ function initDesktop() {
numMessages = $existingMessageLink.attr( 'data-counter-num' ),
badgeLabelAlerts = $existingAlertLink.attr( 'data-counter-text' ),
badgeLabelMessages = $existingMessageLink.attr( 'data-counter-text' ),
// eslint-disable-next-line no-jquery/no-class-state
hasUnseenAlerts = $existingAlertLink.hasClass( 'mw-echo-unseen-notifications' ),
// eslint-disable-next-line no-jquery/no-class-state
hasUnseenMessages = $existingMessageLink.hasClass( 'mw-echo-unseen-notifications' ),
// latestMessageNotifTime is the time of most recent notification that came when we called showNotificationSnippet last
// the function showNotificationSnippet returns the time of the latest notification and latestMessageNotifTime is updated

View file

@ -20,6 +20,13 @@
y: 'years',
yy: 'years'
};
// The following messages are used here:
// * notification-timestamp-ago-seconds
// * notification-timestamp-ago-minutes
// * notification-timestamp-ago-hours
// * notification-timestamp-ago-days
// * notification-timestamp-ago-months
// * notification-timestamp-ago-years
return mw.msg( 'notification-timestamp-ago-' + keymap[ key ], mw.language.convertNumber( number ) );
},
calendar: {

View file

@ -330,8 +330,8 @@
this.expanded ?
mw.msg( 'notification-link-text-collapse-all' ) :
// Messages that appear here are:
// notification-link-text-expand-alert-count
// notification-link-text-expand-notice-count
// * notification-link-text-expand-alert-count
// * notification-link-text-expand-notice-count
mw.msg(
'notification-link-text-expand-' +
( type === 'message' ? 'notice' : type ) +

View file

@ -65,8 +65,8 @@
numItems: this.numItems,
flags: buttonFlags,
// The following messages can be used here:
// tooltip-pt-notifications-alert
// tooltip-pt-notifications-notice
// * tooltip-pt-notifications-alert
// * tooltip-pt-notifications-notice
title: mw.msg( 'tooltip-pt-notifications-' + adjustedTypeString ),
href: config.href
} );
@ -119,8 +119,8 @@
$autoCloseIgnore: this.$element.add( this.$menuOverlay ),
head: true,
// The following messages can be used here:
// echo-notification-alert-text-only
// echo-notification-notice-text-only
// * echo-notification-alert-text-only
// * echo-notification-notice-text-only
label: mw.msg(
'echo-notification-' + adjustedTypeString +
'-text-only'

1213
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -10,14 +10,14 @@
"selenium-daily": "npm run selenium-test -- --mochaOpts.grep @daily"
},
"devDependencies": {
"eslint-config-wikimedia": "0.12.0",
"eslint-config-wikimedia": "0.15.0",
"grunt": "1.0.4",
"grunt-banana-checker": "0.6.0",
"grunt-banana-checker": "0.8.1",
"grunt-contrib-watch": "1.1.0",
"grunt-eslint": "21.0.0",
"grunt-stylelint": "0.11.1",
"grunt-eslint": "22.0.0",
"grunt-stylelint": "0.13.0",
"grunt-svgmin": "5.0.0",
"stylelint-config-wikimedia": "0.6.0",
"stylelint-config-wikimedia": "0.8.0",
"wdio-mediawiki": "0.4.0",
"wdio-mocha-framework": "0.6.4",
"wdio-spec-reporter": "0.1.4",

View file

@ -4,7 +4,9 @@
"../../.eslintrc.json"
],
"rules": {
"no-jquery/no-class-state": "off",
"no-jquery/no-parse-html-literal": "off",
"no-jquery/no-global-selector": "off"
"no-jquery/no-global-selector": "off",
"no-jquery/no-sizzle": "off"
}
}

View file

@ -1,4 +1,5 @@
{
"root": true,
"extends": [
"wikimedia/server"
],
@ -6,9 +7,6 @@
"mocha": true
},
"globals": {
"browser": false
},
"rules": {
"no-console": 0
"browser": "readonly"
}
}

View file

@ -49,7 +49,7 @@ describe( 'Echo', function () {
EchoPage.notices.click();
EchoPage.alertMessage.waitForVisible();
let regexp = /Welcome to .*, .*! We're glad you're here./;
const regexp = /Welcome to .*, .*! We're glad you're here./;
assert( regexp.test( EchoPage.alertMessage.getText() ) );
} );

View file

@ -20,7 +20,7 @@ describe( 'Mention test for Echo', function () {
EchoPage.alerts.click();
EchoPage.alertMessage.waitForVisible();
let regexp = /.* mentioned you on User:.*./;
const regexp = /.* mentioned you on User:.*./;
assert( regexp.test( EchoPage.alertMessage.getText() ) );
} );