Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .eslintrc.json

This file was deleted.

3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-env node */
'use strict';

module.exports = function ( grunt ) {
const conf = grunt.file.readJSON( 'extension.json' );

Expand Down
26 changes: 26 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use strict';

const { defineConfig, globalIgnores } = require( 'eslint/config' );
const wikimedia = require( 'eslint-config-wikimedia/flat' );

module.exports = defineConfig( [
globalIgnores( [
'coverage/',
'vendor/'
] ),

// These run in Node and have their own config below
{
ignores: [ 'Gruntfile.js', 'eslint.config.js' ],
extends: [ wikimedia( 'client/es6', 'mediawiki', 'jquery' ) ],
rules: {
'no-jquery/no-parse-html-literal': 'warn',
'no-jquery/no-global-selector': 'warn',
'no-jquery/no-class-state': 'warn'
}
},
{
files: [ 'Gruntfile.js', 'eslint.config.js' ],
extends: [ wikimedia( 'server' ) ]
}
] );
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@
},
"devDependencies": {
"api-testing": "^1.4.2",
"eslint-config-wikimedia": "0.20.0",
"eslint": "9.39.5",
"eslint-config-wikimedia": "0.33.1",
"grunt": "1.4.0",
"grunt-banana-checker": "0.9.0",
"grunt-eslint": "23.0.0",
"grunt-eslint": "26.0.0",
"grunt-stylelint": "0.16.0",
"stylelint-config-wikimedia": "0.11.1"
},
"eslintIgnore": [
"coverage",
"vendor"
]
}
}
13 changes: 6 additions & 7 deletions resources/ext.wikibase.rdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* JavaScript for WikibaseRDF
*/

$( function () {
$( () => {
'use strict';

function moveSection() {
Expand Down Expand Up @@ -56,7 +56,7 @@ $( function () {
$anchor: $anchor
} );

$hideMessage.on( 'click', function ( event ) {
$hideMessage.on( 'click', ( event ) => {
event.preventDefault();
$messageAnchor.data( 'wbtooltip' ).degrade( true );
$( window ).off( '.wikibase-rdf-property-warning' );
Expand All @@ -72,7 +72,7 @@ $( function () {

$( window ).one(
'scroll.wikibase-rdf-property-warning touchmove.wikibase-rdf-property-warning resize.wikibase-rdf-property-warning',
function () {
() => {
const tooltip = $messageAnchor.data( 'wbtooltip' );
if ( tooltip ) {
$messageAnchor.data( 'wbtooltip' ).hide();
Expand Down Expand Up @@ -155,7 +155,7 @@ $( function () {

findRow( trigger ).addClass( 'wikibase-rdf-row-editing-saving' );

$( '.wikibase-rdf-rows .wikibase-rdf-row' ).each( function ( index, row ) {
$( '.wikibase-rdf-rows .wikibase-rdf-row' ).each( ( index, row ) => {
const mapping = { predicate: '', object: '' };

const $row = $( row );
Expand Down Expand Up @@ -187,7 +187,7 @@ $( function () {
{ mappings: mappings },
{ authorization: 'token' }
)
.done( function () {
.then( () => {
hideError();
const isSave = $( trigger ).hasClass( 'wikibase-rdf-action-save' );
const isRemove = $( trigger ).hasClass( 'wikibase-rdf-action-remove' );
Expand All @@ -197,8 +197,7 @@ $( function () {
onSuccessfulRemove( trigger );
}
enableActions();
} )
.fail( function ( data, response ) {
}, ( data, response ) => {
const userLang = mw.config.get( 'wgUserLanguage' );
const siteLang = mw.config.get( 'wgContentLanguage' );
if ( Object.prototype.hasOwnProperty.call( response.xhr.responseJSON, 'messageTranslations' ) ) {
Expand Down
Loading