Skip to content

Commit

Permalink
style(eslint): lint tsx (DIYgod#15098)
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyRL authored Apr 4, 2024
1 parent d5daf23 commit 0893deb
Show file tree
Hide file tree
Showing 492 changed files with 527 additions and 574 deletions.
4 changes: 2 additions & 2 deletions .puppeteerrc.cjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const { join } = require('path');
const path = require('path');

/**
* @type {import("puppeteer").Configuration}
*/
module.exports = {
// Changes the cache location for Puppeteer.
cacheDirectory: join(__dirname, 'node_modules', '.cache', 'puppeteer'),
cacheDirectory: path.join(__dirname, 'node_modules', '.cache', 'puppeteer'),
};
4 changes: 0 additions & 4 deletions lib/middleware/template.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { rss3Ums, json, RSS, Atom } from '@/utils/render';
import * as path from 'node:path';
import { config } from '@/config';
import { collapseWhitespace, convertDateToISO8601 } from '@/utils/common-utils';
import type { MiddlewareHandler } from 'hono';
import { Data } from '@/types';

import { getCurrentPath } from '@/utils/helpers';
const __dirname = getCurrentPath(import.meta.url);

// Set RSS <ttl> (minute) according to the availability of cache
// * available: max(config.cache.routeExpire / 60, 1)
// * unavailable: 1
Expand Down
2 changes: 1 addition & 1 deletion lib/registry.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Namespace, Route } from '@/types';
import { directoryImport } from 'directory-import';
import { Hono, type Handler } from 'hono';
import * as path from 'node:path';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { serveStatic } from '@hono/node-server/serve-static';

Expand Down
2 changes: 1 addition & 1 deletion lib/routes/005/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { load } from 'cheerio';
import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const handler = async (ctx) => {
const { category = 'zx' } = ctx.req.param();
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/12306/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url);
import cache from '@/utils/cache';
import got from '@/utils/got';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';
import { config } from '@/config';

const rootUrl = 'https://kyfw.12306.cn';
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/141jav/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const route: Route = {
path: '/{.*}?',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/141ppv/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const route: Route = {
path: '/{.*}?',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/163/ds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url);
import got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

const root_url = 'https://inf.ds.163.com';

Expand Down
2 changes: 1 addition & 1 deletion lib/routes/163/exclusive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { load } from 'cheerio';
import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

const ids = {
'': {
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/163/music/artist-songs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url);

import got from '@/utils/got';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const route: Route = {
path: '/music/artist/songs/:id',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/163/music/artist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url);

import got from '@/utils/got';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const route: Route = {
path: '/music/artist/:id',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/163/music/djradio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url);
import got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const route: Route = {
path: '/music/djradio/:id',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/163/music/playlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url);
import got from '@/utils/got';
import { config } from '@/config';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const route: Route = {
path: '/music/playlist/:id',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/163/music/userevents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Route } from '@/types';
import { getCurrentPath } from '@/utils/helpers';
const __dirname = getCurrentPath(import.meta.url);

import * as path from 'node:path';
import path from 'node:path';
import got from '@/utils/got';
import { art } from '@/utils/render';
const renderDescription = (info) => art(path.join(__dirname, '../templates/music/userevents.art'), info);
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/163/music/userplaylist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url);

import got from '@/utils/got';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const route: Route = {
path: '/music/user/playlist/:uid',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/163/music/userplayrecords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url);
import got from '@/utils/got';
import { config } from '@/config';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

const headers = {
cookie: config.ncm.cookies,
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/163/open/vip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const route: Route = {
path: '/open/vip',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/163/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url);
import got from '@/utils/got';
import { load } from 'cheerio';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

const parseDyArticle = (item, tryGet) =>
tryGet(item.link, async () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/18comic/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';
import { config } from '@/config';

const defaultDomain = 'jmcomic1.me';
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/1point3acres/offer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url);
import got from '@/utils/got';
import { art } from '@/utils/render';
import { parseDate } from '@/utils/parse-date';
import * as path from 'node:path';
import path from 'node:path';

export const route: Route = {
path: '/offer/:year?/:major?/:school?',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/1point3acres/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url);
import got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';
import bbcode from 'bbcodejs';

const rootUrl = 'https://instant.1point3acres.com';
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/1x/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url);
import got from '@/utils/got';
import { load } from 'cheerio';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const handler = async (ctx) => {
const { category = 'latest/awarded' } = ctx.req.param();
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/2048/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { load } from 'cheerio';
import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const route: Route = {
path: '/:id?',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/3kns/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import { load } from 'cheerio';
import { Context } from 'hono';
import * as path from 'node:path';
import path from 'node:path';
const __dirname = getCurrentPath(import.meta.url);

export const route: Route = {
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/4gamers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getCurrentPath } from '@/utils/helpers';
const __dirname = getCurrentPath(import.meta.url);

import got from '@/utils/got';
import * as path from 'node:path';
import path from 'node:path';
import { art } from '@/utils/render';
import { parseDate } from '@/utils/parse-date';

Expand Down
2 changes: 1 addition & 1 deletion lib/routes/4ksj/forum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { load } from 'cheerio';
import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';
import iconv from 'iconv-lite';

export const route: Route = {
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/500px/tribe-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url);
import cache from '@/utils/cache';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

import { baseUrl, getTribeDetail, getTribeSets } from './utils';

Expand Down
2 changes: 1 addition & 1 deletion lib/routes/500px/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url);
import cache from '@/utils/cache';
import { art } from '@/utils/render';
import { parseDate } from '@/utils/parse-date';
import * as path from 'node:path';
import path from 'node:path';
import { baseUrl, getUserInfoFromUsername, getUserInfoFromId, getUserWorks } from './utils';

export const route: Route = {
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/56kog/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import iconv from 'iconv-lite';
import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

const rootUrl = 'https://www.56kog.com';

Expand Down
2 changes: 1 addition & 1 deletion lib/routes/591/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Route } from '@/types';
import { getCurrentPath } from '@/utils/helpers';
const __dirname = getCurrentPath(import.meta.url);

import * as path from 'node:path';
import path from 'node:path';

import { CookieJar } from 'tough-cookie';
import { load } from 'cheerio';
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/78dm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { load } from 'cheerio';
import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const route: Route = {
path: '*',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/7mmtv/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const route: Route = {
path: '/:language?/:category?/:type?',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/8264/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import iconv from 'iconv-lite';
import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const route: Route = {
path: '/list/:id?',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/91porn/author.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';
import { domainValidation } from './utils';

export const route: Route = {
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/91porn/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';
import { domainValidation } from './utils';

export const route: Route = {
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/95mm/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

const rootUrl = 'https://www.95mm.vip';

Expand Down
2 changes: 1 addition & 1 deletion lib/routes/abc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const route: Route = {
path: '/:category{.+}?',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/acs/journal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import cache from '@/utils/cache';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';
import { config } from '@/config';
import puppeteer from '@/utils/puppeteer';

Expand Down
2 changes: 1 addition & 1 deletion lib/routes/aeaweb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const route: Route = {
path: '/:id',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/aeon/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import cache from '@/utils/cache';
import { load } from 'cheerio';
import got from '@/utils/got';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

const getData = async (ctx, list) => {
const items = await Promise.all(
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/aicaijing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url);
import got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import * as path from 'node:path';
import path from 'node:path';

export const route: Route = {
path: '/:category?/:id?',
Expand Down
3 changes: 2 additions & 1 deletion lib/routes/aip/journal-pupp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { config } from '@/config';
import { isValidHost } from '@/utils/valid-host';
import puppeteer from '@/utils/puppeteer';

export default async (ctx) => {
const handler = async (ctx) => {
const pub = ctx.req.param('pub');
const jrn = ctx.req.param('jrn');
const host = `https://pubs.aip.org`;
Expand Down Expand Up @@ -58,3 +58,4 @@ export default async (ctx) => {
allowEmpty: true,
};
};
export default handler;
2 changes: 1 addition & 1 deletion lib/routes/aip/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getCurrentPath } from '@/utils/helpers';
const __dirname = getCurrentPath(import.meta.url);

import * as path from 'node:path';
import path from 'node:path';
import { art } from '@/utils/render';

const puppeteerGet = async (url, browser) => {
Expand Down
Loading

0 comments on commit 0893deb

Please sign in to comment.