mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Chore: make ESLint and TypeScript happy
This commit is contained in:
@@ -139,10 +139,6 @@ export class ResponseError<T extends UndiciResponseData | Response> extends Erro
|
||||
const statusCode = 'statusCode' in res ? res.statusCode : res.status;
|
||||
super('HTTP ' + statusCode + ' ' + args.map(_ => inspect(_)).join(' '));
|
||||
|
||||
if ('captureStackTrace' in Error) {
|
||||
Error.captureStackTrace(this, ResponseError);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line sukka/unicorn/custom-error-definition -- deliberatly use previous name
|
||||
this.name = this.constructor.name;
|
||||
this.res = res;
|
||||
|
||||
@@ -25,7 +25,7 @@ export class FileOutput {
|
||||
|
||||
protected domainKeywords = new Set<string>();
|
||||
|
||||
private whitelistKeywords = new Set<string>();
|
||||
private readonly whitelistKeywords = new Set<string>();
|
||||
|
||||
protected userAgent = new Set<string>();
|
||||
protected processName = new Set<string>();
|
||||
|
||||
@@ -35,7 +35,7 @@ export class SingboxSource extends BaseWriteStrategy {
|
||||
|
||||
static readonly jsonToLines = (json: unknown): string[] => stringify(json).split('\n');
|
||||
|
||||
private singbox: SingboxHeadlessRule = {
|
||||
private readonly singbox: SingboxHeadlessRule = {
|
||||
domain: [MARKER_DOMAIN],
|
||||
domain_suffix: [MARKER_DOMAIN]
|
||||
};
|
||||
|
||||
@@ -148,7 +148,7 @@ export class SurgeMitmSgmodule extends BaseWriteStrategy {
|
||||
readonly fileExtension = 'sgmodule';
|
||||
readonly type = '';
|
||||
|
||||
private rules = new Set<string>();
|
||||
private readonly rules = new Set<string>();
|
||||
|
||||
protected get result() {
|
||||
if (this.rules.size === 0) {
|
||||
|
||||
Reference in New Issue
Block a user