Skip to content
This repository has been archived by the owner on Sep 10, 2023. It is now read-only.

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed May 29, 2023
1 parent 3460d86 commit eaf94e8
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -9,7 +9,7 @@
"watch": "cross-env NODE_ENV=development webpack --progress --watch",
"changelog": "npx conventional-changelog-cli -p angular -i CHANGELOG.md -s -r 0",
"deploy": "npm run build && npx gh-pages -d ./dist",
"lint": "rome check --apply-suggested src/**/*.ts src/*.ts",
"lint": "rome check --apply-unsafe --formatter-enabled true --organize-imports-enabled true src/**/*.ts src/*.ts",
"format": "rome format --write src/**/*.ts src/*.ts"
},
"author": "Axetroy",
Expand All @@ -25,7 +25,7 @@
"@types/webpack": "5.28.1",
"cross-env": "7.0.3",
"date-fns": "2.29.3",
"rome": "^11.0.0",
"rome": "^12.1.2",
"ts-loader": "9.4.1",
"ts-node": "10.9.1",
"tsconfig-paths-webpack-plugin": "4.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/app.ts
@@ -1,5 +1,5 @@
import { IProvider, IProviderConstructor } from "./provider";
import { debounceDecorator, getRedirect, isInView, Marker, throttleDecorator } from "./utils";
import { Marker, debounceDecorator, getRedirect, isInView, throttleDecorator } from "./utils";

type tester = () => boolean;

Expand Down
2 changes: 1 addition & 1 deletion src/sites/addons.mozilla.org.ts
@@ -1,5 +1,5 @@
import { IProvider } from "@/provider";
import { matchLinkFromUrl, antiRedirect } from "@/utils";
import { antiRedirect, matchLinkFromUrl } from "@/utils";

export class MozillaProvider implements IProvider {
public test = /outgoing\.prod\.mozaws\.net\/v\d\/\w+\/(.*)/;
Expand Down
2 changes: 1 addition & 1 deletion src/sites/play.google.com.ts
@@ -1,5 +1,5 @@
import { IProvider } from "@/provider";
import { antiRedirect, Marker } from "@/utils";
import { Marker, antiRedirect } from "@/utils";
export class GooglePlayProvider implements IProvider {
public test(aElement: HTMLAnchorElement) {
if (/google\.com\/url\?q=(.*)/.test(aElement.href)) {
Expand Down
2 changes: 1 addition & 1 deletion src/sites/tieba.baidu.com.ts
Expand Up @@ -6,7 +6,7 @@ export class TiebaProvider implements IProvider {
if (!this.test.test(aElement.href)) {
return;
}
let url: string = "";
let url = "";
const text: string = aElement.innerText || aElement.textContent || "";
try {
if (/https?:\/\//.test(text)) {
Expand Down
2 changes: 1 addition & 1 deletion src/sites/video.baidu.com.ts
@@ -1,6 +1,6 @@
import http from "gm-http";
import { IProvider } from "@/provider";
import { antiRedirect } from "@/utils";
import http from "gm-http";

export class BaiduVideoProvider implements IProvider {
public test = /v\.baidu\.com\/link\?url=/;
Expand Down
6 changes: 3 additions & 3 deletions src/sites/www.baidu.com.ts
@@ -1,6 +1,6 @@
import http from "gm-http";
import { IProvider } from "@/provider";
import { getRedirect, increaseRedirect, decreaseRedirect, antiRedirect } from "@/utils";
import { antiRedirect, decreaseRedirect, getRedirect, increaseRedirect } from "@/utils";
import http from "gm-http";
import pRetry from "p-retry";

export class BaiduProvider implements IProvider {
Expand All @@ -20,7 +20,7 @@ export class BaiduProvider implements IProvider {
}
}

private async handlerOneElement(aElement: HTMLAnchorElement): Promise<any> {
private async handlerOneElement(aElement: HTMLAnchorElement): Promise<unknown> {
try {
const res = await http.request({
url: aElement.href,
Expand Down
6 changes: 3 additions & 3 deletions src/sites/www.dogedoge.com.ts
@@ -1,6 +1,6 @@
import http from "gm-http";
import { IProvider } from "@/provider";
import { getRedirect, increaseRedirect, decreaseRedirect, antiRedirect } from "@/utils";
import { antiRedirect, decreaseRedirect, getRedirect, increaseRedirect } from "@/utils";
import http from "gm-http";

export class DogeDogeProvider implements IProvider {
public test = /www\.dogedoge\.com\/rd\/.{1,}/;
Expand All @@ -17,7 +17,7 @@ export class DogeDogeProvider implements IProvider {
}
}

private async handlerOneElement(aElement: HTMLAnchorElement): Promise<any> {
private async handlerOneElement(aElement: HTMLAnchorElement): Promise<unknown> {
try {
const res: Response$ = await http.request({
url: aElement.href,
Expand Down
2 changes: 1 addition & 1 deletion src/sites/www.google.com.ts
@@ -1,5 +1,5 @@
import { IProvider } from "@/provider";
import { antiRedirect } from "../utils";
import { IProvider } from "@/provider";

export class GoogleProvider implements IProvider {
public test = true;
Expand Down
4 changes: 2 additions & 2 deletions src/sites/www.sogou.com.ts
@@ -1,6 +1,6 @@
import http from "gm-http";
import { IProvider } from "@/provider";
import { queryParser, getText, getRedirect, increaseRedirect, decreaseRedirect, antiRedirect } from "@/utils";
import { antiRedirect, decreaseRedirect, getRedirect, getText, increaseRedirect, queryParser } from "@/utils";
import http from "gm-http";

export class SoGouProvider implements IProvider {
public test = /www\.sogou\.com\/link\?url=/;
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Expand Up @@ -20,7 +20,7 @@ export function matchLinkFromUrl(aElement: HTMLAnchorElement, tester: RegExp): s
return "";
}

let url: string = "";
let url = "";
try {
url = decodeURIComponent(matcher[1]);
} catch (e) {
Expand Down Expand Up @@ -58,7 +58,7 @@ class Query {
public toString(): string {
const arr: string[] = [];
for (const key in this.object) {
if (this.object.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(this.object, key)) {
const value = this.object[key];
arr.push(`${key}=${value}`);
}
Expand Down

0 comments on commit eaf94e8

Please sign in to comment.