Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Gorniaky committed Oct 20, 2024
1 parent 0aefd56 commit d6c4c00
Show file tree
Hide file tree
Showing 61 changed files with 152 additions and 148 deletions.
2 changes: 2 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default [
{
rules: {
"@typescript-eslint/consistent-type-imports": ["warn", { fixStyle: "inline-type-imports" }],
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-declaration-merging": "off",
"@typescript-eslint/no-unused-vars": ["warn", {
Expand All @@ -26,6 +27,7 @@ export default [
"comma-dangle": ["warn", "always-multiline"],
"func-style": ["warn", "declaration"],
indent: ["warn", 2, { SwitchCase: 1 }],
"no-case-declarations": "off",
"no-duplicate-imports": ["warn", { includeExports: true }],
"no-empty": "off",
"no-unused-private-class-members": "warn",
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1243,9 +1243,10 @@
"vscode:prepublish": "yarn run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "yarn run compile && yarn run lint",
"lint": "eslint src",
"test": "vscode-test"
"lint": "eslint src --fix",
"pretest": "yarn run compile && yarn run test:lint",
"test": "vscode-test",
"test:lint": "eslint src"
},
"dependencies": {
"@vscode/l10n": "^0.0.18",
Expand Down
2 changes: 1 addition & 1 deletion src/@types/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { BaseApiApp, RESTApiBaseResult } from "discloud.app";
import { AppType } from "../@enum";
import { type AppType } from "../@enum";

export interface RESTGetApiVscode extends RESTApiBaseResult {
user: ApiVscodeUser
Expand Down
2 changes: 1 addition & 1 deletion src/@types/providers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PathLike } from "fs";
import { type PathLike } from "fs";

export interface ProviderOptions {
path: PathLike
Expand Down
10 changes: 5 additions & 5 deletions src/@types/structures.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CancellationToken, ExtensionContext, LogOutputChannel, Progress, ProgressOptions, TreeItem } from "vscode";
import AppTreeItem from "../structures/AppTreeItem";
import TeamAppTreeItem from "../structures/TeamAppTreeItem";
import VSUser from "../structures/VSUser";
import { RateLimitData } from "./rest";
import { type CancellationToken, type ExtensionContext, type LogOutputChannel, type Progress, type ProgressOptions, type TreeItem } from "vscode";
import type AppTreeItem from "../structures/AppTreeItem";
import type TeamAppTreeItem from "../structures/TeamAppTreeItem";
import type VSUser from "../structures/VSUser";
import { type RateLimitData } from "./rest";

export interface CommandData {
allowTokenless?: boolean;
Expand Down
6 changes: 3 additions & 3 deletions src/commands/apps/backup.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { t } from "@vscode/l10n";
import { RESTGetApiAppBackupResult, Routes } from "discloud.app";
import { type RESTGetApiAppBackupResult, Routes } from "discloud.app";
import { existsSync, mkdirSync } from "fs";
import { writeFile } from "fs/promises";
import { join } from "path";
import { ProgressLocation, window } from "vscode";
import { TaskData } from "../../@types";
import { type TaskData } from "../../@types";
import extension from "../../extension";
import AppTreeItem from "../../structures/AppTreeItem";
import type AppTreeItem from "../../structures/AppTreeItem";
import Command from "../../structures/Command";
import { requester } from "../../util";

Expand Down
6 changes: 3 additions & 3 deletions src/commands/apps/commit.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { t } from "@vscode/l10n";
import { RESTPutApiAppCommitResult, Routes, resolveFile } from "discloud.app";
import { type RESTPutApiAppCommitResult, Routes, resolveFile } from "discloud.app";
import { join } from "path";
import { ProgressLocation, workspace } from "vscode";
import { TaskData } from "../../@types";
import { type TaskData } from "../../@types";
import extension from "../../extension";
import AppTreeItem from "../../structures/AppTreeItem";
import type AppTreeItem from "../../structures/AppTreeItem";
import Command from "../../structures/Command";
import { FileSystem, requester, Zip } from "../../util";

Expand Down
6 changes: 3 additions & 3 deletions src/commands/apps/copy.id.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { t } from "@vscode/l10n";
import { env, window } from "vscode";
import { TaskData } from "../../@types";
import AppTreeItem from "../../structures/AppTreeItem";
import { type TaskData } from "../../@types";
import type AppTreeItem from "../../structures/AppTreeItem";
import Command from "../../structures/Command";
import TeamAppTreeItem from "../../structures/TeamAppTreeItem";
import type TeamAppTreeItem from "../../structures/TeamAppTreeItem";

export default class extends Command {
constructor() {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/apps/delete.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { t } from "@vscode/l10n";
import { RESTDeleteApiAppDeleteResult, Routes } from "discloud.app";
import { type RESTDeleteApiAppDeleteResult, Routes } from "discloud.app";
import { ProgressLocation } from "vscode";
import { TaskData } from "../../@types";
import { type TaskData } from "../../@types";
import extension from "../../extension";
import AppTreeItem from "../../structures/AppTreeItem";
import type AppTreeItem from "../../structures/AppTreeItem";
import Command from "../../structures/Command";
import { requester } from "../../util";

Expand Down
6 changes: 3 additions & 3 deletions src/commands/apps/import.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { t } from "@vscode/l10n";
import * as AdmZip from "adm-zip";
import { RESTGetApiAppBackupResult, Routes } from "discloud.app";
import { type RESTGetApiAppBackupResult, Routes } from "discloud.app";
import { existsSync, mkdirSync, unlinkSync } from "fs";
import { writeFile } from "fs/promises";
import { join } from "path";
import { ProgressLocation, Uri, commands, window } from "vscode";
import { TaskData } from "../../@types";
import { type TaskData } from "../../@types";
import extension from "../../extension";
import AppTreeItem from "../../structures/AppTreeItem";
import type AppTreeItem from "../../structures/AppTreeItem";
import Command from "../../structures/Command";
import { requester } from "../../util";

Expand Down
6 changes: 3 additions & 3 deletions src/commands/apps/logs.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { t } from "@vscode/l10n";
import { RESTGetApiAppLogResult, Routes } from "discloud.app";
import { type RESTGetApiAppLogResult, Routes } from "discloud.app";
import { ProgressLocation } from "vscode";
import { TaskData } from "../../@types";
import AppTreeItem from "../../structures/AppTreeItem";
import { type TaskData } from "../../@types";
import type AppTreeItem from "../../structures/AppTreeItem";
import Command from "../../structures/Command";
import { requester } from "../../util";

Expand Down
8 changes: 4 additions & 4 deletions src/commands/apps/mods/add.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { t } from "@vscode/l10n";
import { ModPermissionsFlags, RESTPostApiAppTeamResult, Routes } from "discloud.app";
import { ProgressLocation, QuickPickItem, window } from "vscode";
import { TaskData } from "../../../@types";
import AppTreeItem from "../../../structures/AppTreeItem";
import { ModPermissionsFlags, type RESTPostApiAppTeamResult, Routes } from "discloud.app";
import { ProgressLocation, type QuickPickItem, window } from "vscode";
import { type TaskData } from "../../../@types";
import type AppTreeItem from "../../../structures/AppTreeItem";
import Command from "../../../structures/Command";
import { requester } from "../../../util";

Expand Down
8 changes: 4 additions & 4 deletions src/commands/apps/mods/edit.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { t } from "@vscode/l10n";
import { ModPermissionsFlags, RESTPutApiAppTeamResult, Routes } from "discloud.app";
import { ProgressLocation, QuickPickItem, window } from "vscode";
import { TaskData } from "../../../@types";
import AppTreeItem from "../../../structures/AppTreeItem";
import { ModPermissionsFlags, type RESTPutApiAppTeamResult, Routes } from "discloud.app";
import { ProgressLocation, type QuickPickItem, window } from "vscode";
import { type TaskData } from "../../../@types";
import type AppTreeItem from "../../../structures/AppTreeItem";
import Command from "../../../structures/Command";
import { requester } from "../../../util";

Expand Down
6 changes: 3 additions & 3 deletions src/commands/apps/mods/rem.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { t } from "@vscode/l10n";
import { RESTDeleteApiAppTeamResult, Routes } from "discloud.app";
import { type RESTDeleteApiAppTeamResult, Routes } from "discloud.app";
import { ProgressLocation } from "vscode";
import { TaskData } from "../../../@types";
import AppTreeItem from "../../../structures/AppTreeItem";
import { type TaskData } from "../../../@types";
import type AppTreeItem from "../../../structures/AppTreeItem";
import Command from "../../../structures/Command";
import { requester } from "../../../util";

Expand Down
6 changes: 3 additions & 3 deletions src/commands/apps/profile/avatar.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { t } from "@vscode/l10n";
import { BaseApiApp, DiscloudConfig, RESTApiBaseResult, Routes } from "discloud.app";
import { type BaseApiApp, DiscloudConfig, type RESTApiBaseResult, Routes } from "discloud.app";
import { window } from "vscode";
import { TaskData } from "../../../@types";
import { type TaskData } from "../../../@types";
import extension from "../../../extension";
import AppTreeItem from "../../../structures/AppTreeItem";
import type AppTreeItem from "../../../structures/AppTreeItem";
import Command from "../../../structures/Command";
import { requester } from "../../../util";

Expand Down
6 changes: 3 additions & 3 deletions src/commands/apps/profile/name.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { t } from "@vscode/l10n";
import { BaseApiApp, DiscloudConfig, RESTApiBaseResult, Routes } from "discloud.app";
import { type BaseApiApp, DiscloudConfig, type RESTApiBaseResult, Routes } from "discloud.app";
import { window } from "vscode";
import { TaskData } from "../../../@types";
import { type TaskData } from "../../../@types";
import extension from "../../../extension";
import AppTreeItem from "../../../structures/AppTreeItem";
import type AppTreeItem from "../../../structures/AppTreeItem";
import Command from "../../../structures/Command";
import { requester } from "../../../util";

Expand Down
6 changes: 3 additions & 3 deletions src/commands/apps/ram.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { t } from "@vscode/l10n";
import { RESTPutApiAppRamResult, Routes } from "discloud.app";
import { type RESTPutApiAppRamResult, Routes } from "discloud.app";
import { ProgressLocation, window } from "vscode";
import { AppType } from "../../@enum";
import { TaskData } from "../../@types";
import { type TaskData } from "../../@types";
import extension from "../../extension";
import AppTreeItem from "../../structures/AppTreeItem";
import type AppTreeItem from "../../structures/AppTreeItem";
import Command from "../../structures/Command";
import { requester } from "../../util";

Expand Down
6 changes: 3 additions & 3 deletions src/commands/apps/restart.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { t } from "@vscode/l10n";
import { RESTPutApiAppRestartResult, Routes } from "discloud.app";
import { type RESTPutApiAppRestartResult, Routes } from "discloud.app";
import { ProgressLocation } from "vscode";
import { TaskData } from "../../@types";
import { type TaskData } from "../../@types";
import extension from "../../extension";
import AppTreeItem from "../../structures/AppTreeItem";
import type AppTreeItem from "../../structures/AppTreeItem";
import Command from "../../structures/Command";
import { requester } from "../../util";

Expand Down
6 changes: 3 additions & 3 deletions src/commands/apps/start.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { t } from "@vscode/l10n";
import { RESTPutApiAppStartResult, Routes } from "discloud.app";
import { type RESTPutApiAppStartResult, Routes } from "discloud.app";
import { ProgressLocation } from "vscode";
import { TaskData } from "../../@types";
import { type TaskData } from "../../@types";
import extension from "../../extension";
import AppTreeItem from "../../structures/AppTreeItem";
import type AppTreeItem from "../../structures/AppTreeItem";
import Command from "../../structures/Command";
import { requester } from "../../util";

Expand Down
6 changes: 3 additions & 3 deletions src/commands/apps/stop.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { t } from "@vscode/l10n";
import { RESTPutApiAppStartResult, Routes } from "discloud.app";
import { type RESTPutApiAppStartResult, Routes } from "discloud.app";
import { ProgressLocation } from "vscode";
import { TaskData } from "../../@types";
import { type TaskData } from "../../@types";
import extension from "../../extension";
import AppTreeItem from "../../structures/AppTreeItem";
import type AppTreeItem from "../../structures/AppTreeItem";
import Command from "../../structures/Command";
import { requester } from "../../util";

Expand Down
6 changes: 3 additions & 3 deletions src/commands/apps/terminal.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Uri, window } from "vscode";
import { TaskData } from "../../@types";
import { type Uri, window } from "vscode";
import { type TaskData } from "../../@types";
import extension from "../../extension";
import AppTreeItem from "../../structures/AppTreeItem";
import type AppTreeItem from "../../structures/AppTreeItem";
import Command from "../../structures/Command";

export default class extends Command {
Expand Down
9 changes: 5 additions & 4 deletions src/commands/commit.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { t } from "@vscode/l10n";
import { RESTPutApiAppCommitResult, Routes, resolveFile } from "discloud.app";
import { type RESTPutApiAppCommitResult, Routes, resolveFile } from "discloud.app";
import { join } from "path";
import { ProgressLocation, workspace } from "vscode";
import { TaskData } from "../@types";
import { type TaskData } from "../@types";
import extension from "../extension";
import Command from "../structures/Command";
import { FileSystem, Zip, requester } from "../util";
Expand Down Expand Up @@ -82,8 +82,9 @@ export default class extends Command {
if ("status" in res) {
this.showApiMessage(res);

picked.isApp ?
await extension.appTree.fetch() :
if (picked.isApp)
await extension.appTree.fetch();
else
await extension.teamAppTree.fetch();

if (res.logs) this.logger(picked.id, res.logs);
Expand Down
4 changes: 2 additions & 2 deletions src/commands/logs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { t } from "@vscode/l10n";
import { DiscloudConfig, RESTGetApiAppLogResult, Routes } from "discloud.app";
import { DiscloudConfig, type RESTGetApiAppLogResult, Routes } from "discloud.app";
import { ProgressLocation, window } from "vscode";
import { TaskData } from "../@types";
import { type TaskData } from "../@types";
import extension from "../extension";
import Command from "../structures/Command";
import { requester } from "../util";
Expand Down
6 changes: 3 additions & 3 deletions src/commands/team/backup.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { t } from "@vscode/l10n";
import { RESTGetApiAppBackupResult, Routes } from "discloud.app";
import { type RESTGetApiAppBackupResult, Routes } from "discloud.app";
import { existsSync, mkdirSync } from "fs";
import { writeFile } from "fs/promises";
import { join } from "path";
import { ProgressLocation, window } from "vscode";
import { TaskData } from "../../@types";
import { type TaskData } from "../../@types";
import extension from "../../extension";
import Command from "../../structures/Command";
import TeamAppTreeItem from "../../structures/TeamAppTreeItem";
import type TeamAppTreeItem from "../../structures/TeamAppTreeItem";
import { requester } from "../../util";

export default class extends Command {
Expand Down
10 changes: 5 additions & 5 deletions src/commands/team/commit.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { t } from "@vscode/l10n";
import { RESTPutApiAppCommitResult, Routes, resolveFile } from "discloud.app";
import { type RESTPutApiAppCommitResult, Routes, resolveFile } from "discloud.app";
import { join } from "path";
import { ProgressLocation, workspace } from "vscode";
import { TaskData } from "../../@types";
import { type TaskData } from "../../@types";
import extension from "../../extension";
import Command from "../../structures/Command";
import TeamAppTreeItem from "../../structures/TeamAppTreeItem";
import type TeamAppTreeItem from "../../structures/TeamAppTreeItem";
import { FileSystem, Zip, requester } from "../../util";

export default class extends Command {
Expand Down Expand Up @@ -52,7 +52,7 @@ export default class extends Command {
zipper = new Zip(savePath);
zipper.appendUriList(found);
await zipper.finalize();
} catch (error: any) {
} catch {
zipper?.destroy();
return;
}
Expand All @@ -61,7 +61,7 @@ export default class extends Command {
try {
form.append("file", await resolveFile(savePath, zipName));
if (!extension.isDebug) zipper.destroy();
} catch (error: any) {
} catch {
zipper.destroy();
return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/commands/team/copy.id.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { t } from "@vscode/l10n";
import { env, window } from "vscode";
import { TaskData } from "../../@types";
import AppTreeItem from "../../structures/AppTreeItem";
import { type TaskData } from "../../@types";
import type AppTreeItem from "../../structures/AppTreeItem";
import Command from "../../structures/Command";
import TeamAppTreeItem from "../../structures/TeamAppTreeItem";
import type TeamAppTreeItem from "../../structures/TeamAppTreeItem";

export default class extends Command {
constructor() {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/team/import.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { t } from "@vscode/l10n";
import * as AdmZip from "adm-zip";
import { RESTGetApiAppBackupResult, Routes } from "discloud.app";
import { type RESTGetApiAppBackupResult, Routes } from "discloud.app";
import { existsSync, mkdirSync, unlinkSync } from "fs";
import { writeFile } from "fs/promises";
import { join } from "path";
import { ProgressLocation, Uri, commands, window } from "vscode";
import { TaskData } from "../../@types";
import { type TaskData } from "../../@types";
import extension from "../../extension";
import Command from "../../structures/Command";
import TeamAppTreeItem from "../../structures/TeamAppTreeItem";
import type TeamAppTreeItem from "../../structures/TeamAppTreeItem";
import { requester } from "../../util";

export default class extends Command {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/team/logs.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { t } from "@vscode/l10n";
import { RESTGetApiAppLogResult, Routes } from "discloud.app";
import { type RESTGetApiAppLogResult, Routes } from "discloud.app";
import { ProgressLocation } from "vscode";
import { TaskData } from "../../@types";
import { type TaskData } from "../../@types";
import Command from "../../structures/Command";
import TeamAppTreeItem from "../../structures/TeamAppTreeItem";
import type TeamAppTreeItem from "../../structures/TeamAppTreeItem";
import { requester } from "../../util";

export default class extends Command {
Expand Down
Loading

0 comments on commit d6c4c00

Please sign in to comment.