Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae committed Mar 21, 2024
1 parent 7028895 commit b9550fb
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions DetectG4G5.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@

class DetectG4G5 {
async execute() {
if ( ! this.shouldRunOnThisPage() ) return;

if ( ! this.shouldRunOnThisPage() ) {
return;
}

let title = mw.config.get('wgPageName'); // includes namespace, underscores instead of spaces
let pageID = mw.config.get('wgArticleId');

Expand Down Expand Up @@ -59,8 +61,8 @@ class DetectG4G5 {
}

/**
* @param {number} pageID The page ID number. A positive number with no commas.
*/
* @param {number} pageID The page ID number. A positive number with no commas.
*/
async isReviewed(pageID) {
let api = new mw.Api();
let response = await api.get( {
Expand Down Expand Up @@ -139,15 +141,21 @@ class DetectG4G5 {
shouldRunOnThisPage() {
// don't run when not viewing articles
let action = mw.config.get('wgAction');
if ( action !== 'view' ) return false;

if ( action !== 'view' ) {
return false;
}

// don't run when viewing diffs
let isDiff = mw.config.get('wgDiffNewId');
if ( isDiff ) return false;

if ( isDiff ) {
return false;
}

let isDeletedPage = ( ! mw.config.get('wgCurRevisionId') );
if ( isDeletedPage ) return false;

if ( isDeletedPage ) {
return false;
}

// Only run in mainspace
let namespace = mw.config.get('wgNamespaceNumber');
let title = mw.config.get('wgPageName'); // includes namespace, underscores instead of spaces
Expand Down

0 comments on commit b9550fb

Please sign in to comment.