Skip to content

Commit

Permalink
linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
spencermountain committed Feb 2, 2025
1 parent 092261a commit 549fd3c
Show file tree
Hide file tree
Showing 32 changed files with 50 additions and 19 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

20 changes: 20 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// eslint.config.js
export default [
{
rules: {
'no-console': 2,
'no-bitwise': 2

}
},
{
ignores: [
"**/node_modules/",
"node_modules/",
"**/builds/",
"*.test.js",
"**/scratch.js",
"**/rollup.config.js",
],
}
];
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions plugins/api/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import commonjs from '@rollup/plugin-commonjs'
import { terser } from 'rollup-plugin-terser'
import sizeCheck from 'rollup-plugin-filesize-check'
Expand Down
1 change: 1 addition & 0 deletions plugins/api/src/getRandom.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import makeHeaders from './_headers.js'
import { defaults, toUrlParams } from './_fns.js'

Expand Down
1 change: 1 addition & 0 deletions plugins/api/src/getRandomCategory.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import makeHeaders from './_headers.js'
import { defaults, toUrlParams } from './_fns.js'

Expand Down
1 change: 1 addition & 0 deletions plugins/classify/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import commonjs from '@rollup/plugin-commonjs'
import { terser } from 'rollup-plugin-terser'
import sizeCheck from 'rollup-plugin-filesize-check'
Expand Down
1 change: 1 addition & 0 deletions plugins/classify/schema/_print.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import schema from './index.js'
/** add spaces at the end */
const indent = function (str = '', width) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/classify/tests/fetch-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-unused-vars */
/* eslint-disable no-console */
// import test from 'tape'
import wtf from './_lib.js'

Expand Down
2 changes: 1 addition & 1 deletion plugins/classify/tests/i18n.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { fileURLToPath } from 'url'
import i18n from '../../i18n/src/index.js'
wtf.extend(i18n)

const dir = path.dirname(fileURLToPath(import.meta.url)) // eslint-disable-line
const dir = path.dirname(fileURLToPath(import.meta.url))

test('i18n-classify-test', async function (t) {
let arr = [
Expand Down
1 change: 1 addition & 0 deletions plugins/debug/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import commonjs from '@rollup/plugin-commonjs'
import { terser } from 'rollup-plugin-terser'

Expand Down
2 changes: 2 additions & 0 deletions plugins/disambig/scratch.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-console */

import wtf from '../../src/index.js'
import plg from './src/index.js'
wtf.extend(plg)
Expand Down
1 change: 1 addition & 0 deletions plugins/image/src/api/fetch.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import unfetch from 'isomorphic-unfetch'
import makeUrl from '../../../../src/_fetch/makeUrl.js'
import makeHeaders from '../../../../src/_fetch/_headers.js'
Expand Down
1 change: 1 addition & 0 deletions plugins/image/src/api/img-exists.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import unfetch from 'isomorphic-unfetch'

// test if the image url exists or not
Expand Down
1 change: 1 addition & 0 deletions plugins/sports/src/mlb/gameLog/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import parseGame from './parseGame.js'
import addWinner from './winner.js'

Expand Down
2 changes: 1 addition & 1 deletion plugins/sports/src/mlb/gameLog/parseGame.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const dashSplit = /(|-||–)/ // eslint-disable-line
const dashSplit = /(|-||–)/

const parseTeam = function (txt) {
if (!txt) {
Expand Down
1 change: 1 addition & 0 deletions plugins/sports/src/mlb/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import teams from './teams.js'
import parse from './parse.js'

Expand Down
1 change: 1 addition & 0 deletions plugins/sports/src/nhl/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import teams from './teams.js'
import parse from './parse.js'

Expand Down
1 change: 1 addition & 0 deletions plugins/sports/tests/mlb/games.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import test from 'tape'
import wtf from '../_lib.js'

Expand Down
1 change: 1 addition & 0 deletions plugins/sports/tests/mlb/parse.ignore.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import test from 'tape'
import wtf from '../_lib.js'

Expand Down
1 change: 1 addition & 0 deletions plugins/sports/tests/mlb/stress-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import test from 'tape'
import wtf from '../_lib'
import teams from '../src/teams'
Expand Down
1 change: 1 addition & 0 deletions plugins/sports/tests/nhl/stress-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import test from 'tape'
import wtf from '../_lib.js'
import teams from '../../src/nhl/teams.js'
Expand Down
1 change: 1 addition & 0 deletions plugins/wikitext/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import commonjs from '@rollup/plugin-commonjs'
import { terser } from 'rollup-plugin-terser'
import sizeCheck from 'rollup-plugin-filesize-check'
Expand Down
2 changes: 1 addition & 1 deletion plugins/wikitext/tests/stress.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fs from 'fs'
import path from 'path'
import { fileURLToPath } from 'url'

const dir = path.dirname(fileURLToPath(import.meta.url)) // eslint-disable-line
const dir = path.dirname(fileURLToPath(import.meta.url))

function from_file(page) {
let file = '../../../tests/cache/' + page + '.txt'
Expand Down
1 change: 1 addition & 0 deletions src/01-document/Document.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import sectionMap from './_sectionMap.js'
import toJSON from './toJson.js'
import isDisambig from './isDisambig.js'
Expand Down
3 changes: 0 additions & 3 deletions src/01-document/isStub.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@ const isStub = function (doc) {
let name = t.template || ''
// try i18n templates like 'stubo'
if (allStubs.has(name)) {
// console.log(name)
return true
}
// english forms
if (name === 'stub' || name.endsWith('-stub')) {
// console.log(name)
return true
}
// look for i18n in last-word, like {{foo-stubo}}
let words = name.split(/[- ]/)
if (words.length > 1) {
let word = words[words.length - 1]
if (allStubs.has(word)) {
// console.log(name)
return true
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/_fetch/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-console */
import unfetch from 'isomorphic-unfetch'

import parseUrl from './parseUrl.js'
import makeUrl from './makeUrl.js'
import getResult from './getResult.js'
Expand Down
2 changes: 1 addition & 1 deletion src/_fetch/parseUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @returns {{domain: string, title: string}} The domain and title of a url
*/
const parseUrl = function (url) {
let parsed = new URL(url) // eslint-disable-line
let parsed = new URL(url)
let title = parsed.pathname.replace(/^\/(wiki\/)?/, '')
title = decodeURIComponent(title)
return {
Expand Down
1 change: 1 addition & 0 deletions src/_lib/fetch.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import unfetch from 'isomorphic-unfetch'

/**
Expand Down
1 change: 0 additions & 1 deletion src/link/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const internal_links = function (links, str) {
}
//kill off just these just-anchor links [[#history]]
// if (link.match(/^#/i)) {
// console.log(s)
// return s
// }
//remove anchors from end [[toronto#history]]
Expand Down
2 changes: 1 addition & 1 deletion src/table/parse/_findRows.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const findRows = function (lines) {
line = line.substring(1)
}
//look for '||' inline row-splitter
line = line.split(/(?:\|\||!!)/) //eslint-disable-line
line = line.split(/(?:\|\||!!)/)
// add leading ! back, because we later read it in header parsing functions
if (startChar === '!') {
line[0] = startChar + line[0]
Expand Down
3 changes: 1 addition & 2 deletions src/template/custom/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import aliases from './aliases.js'
import textTmpl from './text-only/index.js'
import dataTmpl from './data-only/index.js'
Expand All @@ -12,5 +13,3 @@ Object.keys(aliases).forEach((k) => {
templates[k] = templates[aliases[k]]
})
export default templates

// console.log(Object.keys(templates).length)

0 comments on commit 549fd3c

Please sign in to comment.