Skip to content

Commit b2111a6

Browse files
committed
fix linter errors
in preparation for installing a CI linter
1 parent b63a368 commit b2111a6

File tree

10 files changed

+30
-16
lines changed

10 files changed

+30
-16
lines changed

.eslintignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.vscode
2+
*.json
3+
*.yml
4+
/*.docx
5+
/=*.*
6+
/=*/
7+
cookie.txt
8+
coverage
9+
dist
10+
gitignore/
11+
Morebits/
12+
node_modules
13+
publish_old.php
14+
publish.config.php
15+
RequestedArticleSifter
16+
sandbox*.*
17+
test*.*

.eslintrc.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
},
1717
"rules": {
1818
// default rules we don't like
19+
"compat/compat": "off",
1920
"es-x/no-class-fields": "off",
2021
"es-x/no-optional-catch-binding": "off",
2122
"es-x/no-regexp-lookbehind-assertions": "off",
@@ -28,6 +29,8 @@
2829
"jsdoc/require-returns": "off",
2930
"max-len": "off", // annoying
3031
"mediawiki/class-doc": "off",
32+
"no-alert": "off",
33+
"no-console": "off",
3134
"no-jquery/no-class-state": "off",
3235
"no-jquery/no-extend": "off", // autofix is buggy
3336
"no-jquery/no-global-selector": "off",
@@ -43,8 +46,8 @@
4346
"no-nested-ternary": "error",
4447

4548
// rules we should probably fix someday
46-
"camelcase": "warn",
47-
"eqeqeq": "warn",
48-
"no-console": "warn"
49+
"camelcase": "off",
50+
"eqeqeq": "off",
51+
"jsdoc/check-param-names": "off"
4952
}
5053
}

CiteHighlighter/table to bulleted list tool/script.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class Tool {
4141

4242
/** evaluate if a string is a positive integer */
4343
isPositiveInteger( n ) {
44+
// eslint-disable-next-line no-bitwise
4445
return n >>> 0 === parseFloat( n );
4546
}
4647
}

GANReviewTool/modules/GARCloserWikicodeGenerator.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ __TOC__`;
494494
let pos = insertPosition <= 0 ? 0 : insertPosition - 1;
495495
let i = 1;
496496
while ( pos != 0 ) {
497-
const char = talkPageWikicode.substr( pos, 1 );
497+
const char = talkPageWikicode.slice( pos, pos + 1 );
498498
if ( char == '\n' ) {
499499
if ( i != 1 && i != 2 ) { // skip first two \n, those are OK to keep
500500
// @ts-ignore
@@ -515,8 +515,8 @@ __TOC__`;
515515
}
516516

517517
const lengthOfRightHalf = talkPageWikicode.length - insertPosition;
518-
const leftHalf = talkPageWikicode.substr( 0, insertPosition );
519-
const rightHalf = talkPageWikicode.substr( insertPosition, lengthOfRightHalf );
518+
const leftHalf = talkPageWikicode.slice( 0, insertPosition );
519+
const rightHalf = talkPageWikicode.slice( insertPosition, insertPosition + lengthOfRightHalf );
520520

521521
if ( insertPosition == 0 ) {
522522
return wikicodeToAdd + '\n' + talkPageWikicode;
@@ -538,8 +538,8 @@ __TOC__`;
538538
}
539539

540540
deleteMiddleOfString( string, deleteStartPosition, deleteEndPosition ) {
541-
const part1 = string.substr( 0, deleteStartPosition );
542-
const part2 = string.substr( deleteEndPosition );
541+
const part1 = string.slice( 0, deleteStartPosition );
542+
const part2 = string.slice( deleteEndPosition );
543543
const final_str = part1 + part2;
544544
return final_str;
545545
}

QuickVandalBlock.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ $.when( mw.loader.using( [ 'mediawiki.api', 'mediawiki.util' ] ), $.ready ).then
7575
}
7676

7777
function block( username, duration, logReason, templateName, templateParams ) {
78-
// eslint-disable-next-line no-alert
7978
if ( confirm( 'Block ' + username + '?' ) ) {
8079
new mw.Api().postWithToken( 'csrf', {
8180
action: 'block',

SpeciesHelper/main.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ Got a bug report or feature request? Please let me know on my talk page.
1515
This page was assembled from 5 files using my publish.php script. I also have an offline test suite with around 175 unit tests.
1616
*/
1717

18-
/* eslint-disable no-alert */
19-
2018
const { SpeciesHelperFunctions } = require( './modules/SpeciesHelperFunctions.js' );
2119
const { SpeciesHelperData } = require( './modules/SpeciesHelperData.js' );
2220
const { ConvertToSpeciesBox } = require( './modules/ConvertToSpeciesBox.js' );

TemplateTaxonomyCreator.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ class TemplateTaxonomyCreator {
136136
}
137137

138138
promptThenAddWikicode( websiteId ) {
139-
/* eslint-disable no-alert */
140139
const englishRank = prompt( "Enter this taxa's rank. For example, genus, tribe, or subfamily." );
141140
const latinRank = this.englishToLatin( englishRank );
142141
const needsItalics = this.needsItalics( latinRank );

Titlecaseconverter.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// Forked from https://en.wikipedia.org/wiki/User:ZKang123/Titlecaseconverter.js
22

3-
/* eslint-disable no-alert, no-console */
4-
53
$( () => {
64
/**
75
* Convert titles to title case
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
import $ from 'jquery';
2+
/* eslint-disable-next-line no-jquery/variable-pattern, no-undef */
23
global.$ = $;

UserHighlighterSimple/tests/UserHighlighterSimple.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable quotes, block-spacing, brace-style, max-statements-per-line */
2-
31
import { UserHighlighterSimple } from '../modules/UserHighlighterSimple.js';
42

53
// Babel is required to use ES6 module syntax

0 commit comments

Comments
 (0)