mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +00:00
Merge "eslint: Lint Gruntile.js using server rules"
This commit is contained in:
commit
7b75d3775c
|
@ -1,15 +1,7 @@
|
|||
{
|
||||
"root": true,
|
||||
"extends": [
|
||||
"wikimedia/client-es5",
|
||||
"wikimedia/jquery",
|
||||
"wikimedia/mediawiki",
|
||||
"wikimedia/server",
|
||||
"wikimedia/jsduck"
|
||||
],
|
||||
"env": {
|
||||
"commonjs": true
|
||||
},
|
||||
"rules": {
|
||||
"max-len": "off"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* eslint-env node, es6 */
|
||||
'use strict';
|
||||
|
||||
module.exports = function ( grunt ) {
|
||||
var conf = grunt.file.readJSON( 'extension.json' );
|
||||
const conf = grunt.file.readJSON( 'extension.json' );
|
||||
|
||||
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
||||
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
||||
|
@ -28,7 +29,6 @@ module.exports = function ( grunt ) {
|
|||
'modules/**/*.{css,less}'
|
||||
]
|
||||
},
|
||||
// eslint-disable-next-line es/no-object-assign, compat/compat
|
||||
banana: Object.assign( {
|
||||
options: { requireLowerCase: false }
|
||||
}, conf.MessagesDirs ),
|
||||
|
|
15
modules/.eslintrc.json
Normal file
15
modules/.eslintrc.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"root": true,
|
||||
"extends": [
|
||||
"wikimedia/client-es5",
|
||||
"wikimedia/jquery",
|
||||
"wikimedia/mediawiki",
|
||||
"wikimedia/jsduck"
|
||||
],
|
||||
"env": {
|
||||
"commonjs": true
|
||||
},
|
||||
"rules": {
|
||||
"max-len": "off"
|
||||
}
|
||||
}
|
|
@ -2,19 +2,19 @@
|
|||
/**
|
||||
* A container that manages all models that are involved in creating
|
||||
* the notification list. There are currently two types of models:
|
||||
* * mw.echo.dm.SortedList - This currently includes the local model
|
||||
* - mw.echo.dm.SortedList - This currently includes the local model
|
||||
* or any model that has individual messages.
|
||||
* * mw.echo.dm.CrossWikiNotificationItem - This is a model for the
|
||||
* - mw.echo.dm.CrossWikiNotificationItem - This is a model for the
|
||||
* cross wiki notification, which acts as an item but itself contains
|
||||
* a list.
|
||||
*
|
||||
* All notification models that are managed by the manager must implement the
|
||||
* following methods:
|
||||
* * getName - This should retrieve the model's name for the manager to fetch
|
||||
* * isGroup - This should be true for xwiki model and local bundles
|
||||
* * hasUnseen - This should iterate in the model's items and check whether
|
||||
* - getName - This should retrieve the model's name for the manager to fetch
|
||||
* - isGroup - This should be true for xwiki model and local bundles
|
||||
* - hasUnseen - This should iterate in the model's items and check whether
|
||||
* there are any unseen notifications within them.
|
||||
* * getCount - Get a total count of available notifications currently in the model
|
||||
* - getCount - Get a total count of available notifications currently in the model
|
||||
*
|
||||
* @class
|
||||
* @mixins OO.EventEmitter
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{
|
||||
"root": true,
|
||||
"extends": [
|
||||
"../../modules/.eslintrc.json",
|
||||
"wikimedia/qunit"
|
||||
],
|
||||
"rules": {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
badge.$el.find( '.zero' ).length === 0;
|
||||
|
||||
badge.setCount( 0 );
|
||||
assert.ok( initialClassExpectationsMet, 'No icon and no zero class' );
|
||||
assert.true( initialClassExpectationsMet, 'No icon and no zero class' );
|
||||
assert.strictEqual( badge.$el.find( '.zero' ).length, 1, 'A zero class is present on the badge' );
|
||||
badge.setCount( 105 );
|
||||
assert.strictEqual( badge.options.notificationCountRaw, 100, 'Number is capped to 100.' );
|
||||
|
|
Loading…
Reference in a new issue