refactor(web) add eslint (#222)

* fix(tsconfig.json): changed skipLibCheck to false.
refactor(eslint): moved configuration from package.json to .eslintrc.js and added a typescript plugin for future use

* feat: wip eslint and types

* feat: fix identation

* feat: get rid of last any types
This commit is contained in:
stacksmash76 2022-05-17 06:44:07 +02:00 committed by GitHub
parent 7f06a4c707
commit cb8f280e86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 6797 additions and 6541 deletions

View file

@ -1,11 +1,21 @@
type DownloadClientType =
'QBITTORRENT' |
'DELUGE_V1' |
'DELUGE_V2' |
'RADARR' |
'SONARR' |
'LIDARR' |
'WHISPARR';
"QBITTORRENT" |
"DELUGE_V1" |
"DELUGE_V2" |
"RADARR" |
"SONARR" |
"LIDARR" |
"WHISPARR";
// export enum DownloadClientTypeEnum {
// QBITTORRENT = "QBITTORRENT",
// DELUGE_V1 = "DELUGE_V1",
// DELUGE_V2 = "DELUGE_V2",
// RADARR = "RADARR",
// SONARR = "SONARR",
// LIDARR = "LIDARR",
// WHISPARR = "WHISPARR"
// }
interface DownloadClientRules {
enabled: boolean;
@ -27,7 +37,6 @@ interface DownloadClientSettings {
}
interface DownloadClient {
id?: number;
id: number;
name: string;
type: DownloadClientType;

View file

@ -1,23 +1,23 @@
interface Feed {
id: number;
indexer: string;
name: string;
type: string;
enabled: boolean;
url: string;
interval: number;
api_key: string;
created_at: Date;
updated_at: Date;
id: number;
indexer: string;
name: string;
type: string;
enabled: boolean;
url: string;
interval: number;
api_key: string;
created_at: Date;
updated_at: Date;
}
interface FeedCreate {
indexer: string;
name: string;
type: string;
enabled: boolean;
url: string;
interval: number;
api_key: string;
indexer_id: number;
indexer: string;
name: string;
type: string;
enabled: boolean;
url: string;
interval: number;
api_key: string;
indexer_id: number;
}

View file

@ -83,4 +83,4 @@ interface Action {
client_id?: number;
}
type ActionType = 'TEST' | 'EXEC' | 'WATCH_FOLDER' | 'WEBHOOK' | DownloadClientType;
type ActionType = "TEST" | "EXEC" | "WATCH_FOLDER" | "WEBHOOK" | DownloadClientType;

View file

@ -1,3 +1,3 @@
interface APP {
baseUrl: string;
baseUrl: string;
}

View file

@ -8,7 +8,7 @@ interface Indexer {
}
interface IndexerDefinition {
id?: number;
id: number;
name: string;
identifier: string;
implementation: string;

View file

@ -1,29 +1,29 @@
interface IrcNetwork {
id: number;
name: string;
enabled: boolean;
server: string;
port: number;
tls: boolean;
pass: string;
invite_command: string;
nickserv?: NickServ; // optional
channels: IrcChannel[];
connected: boolean;
connected_since: Time;
id: number;
name: string;
enabled: boolean;
server: string;
port: number;
tls: boolean;
pass: string;
invite_command: string;
nickserv?: NickServ; // optional
channels: IrcChannel[];
connected: boolean;
connected_since: string;
}
interface IrcNetworkCreate {
name: string;
enabled: boolean;
server: string;
port: number;
tls: boolean;
pass: string;
invite_command: string;
nickserv?: NickServ; // optional
channels: IrcChannel[];
connected: boolean;
name: string;
enabled: boolean;
server: string;
port: number;
tls: boolean;
pass: string;
invite_command: string;
nickserv?: NickServ; // optional
channels: IrcChannel[];
connected: boolean;
}
interface IrcChannel {
@ -61,12 +61,12 @@ interface NickServ {
}
interface Config {
host: string;
port: number;
log_level: string;
log_path: string;
base_url: string;
version: string;
commit: string;
date: string;
host: string;
port: number;
log_level: string;
log_path: string;
base_url: string;
version: string;
commit: string;
date: string;
}

View file

@ -1,10 +1,10 @@
type NotificationType = 'DISCORD';
type NotificationType = "DISCORD";
interface Notification {
id: number;
name: string;
enabled: boolean;
type: NotificationType;
events: string[];
webhook: string;
id: number;
name: string;
enabled: boolean;
type: NotificationType;
events: string[];
webhook: string;
}

View file

@ -1,38 +1,38 @@
interface Release {
id: number;
filter_status: string;
rejections: string[];
indexer: string;
filter: string;
protocol: string;
title: string;
size: number;
raw: string;
timestamp: Date
action_status: ReleaseActionStatus[]
id: number;
filter_status: string;
rejections: string[];
indexer: string;
filter: string;
protocol: string;
title: string;
size: number;
raw: string;
timestamp: Date
action_status: ReleaseActionStatus[]
}
interface ReleaseActionStatus {
id: number;
status: string;
action: string;
type: string;
rejections: string[];
timestamp: string
id: number;
status: string;
action: string;
type: string;
rejections: string[];
timestamp: string
}
interface ReleaseFindResponse {
data: Release[];
next_cursor: number;
count: number;
data: Release[];
next_cursor: number;
count: number;
}
interface ReleaseStats {
total_count: number;
filtered_count: number;
filter_rejected_count: number;
push_approved_count: number;
push_rejected_count: number;
total_count: number;
filtered_count: number;
filter_rejected_count: number;
push_approved_count: number;
push_rejected_count: number;
}
interface ReleaseFilter {