Skip to content

Add package scripts and cli library, enable integration testing #536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: resolve ESLint @typescript-eslint/require-await errors
- Add parserOptions.project to enable type-aware linting
- Disable @typescript-eslint/require-await rule for markdown files
- Remove unnecessary async keywords from functions without await

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
  • Loading branch information
jaggederest and claude committed Jun 18, 2025
commit a2d2bc8eedba16b3759c1a5d224b4da282d752db
8 changes: 6 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
Expand All @@ -17,7 +18,10 @@
"overrides": [
{
"files": ["*.md"],
"parser": "markdown-eslint-parser"
"parser": "markdown-eslint-parser",
"rules": {
"@typescript-eslint/require-await": "off"
}
}
],
"rules": {
Expand Down
4 changes: 2 additions & 2 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ export async function createHttpAgent(): Promise<ProxyAgent> {
* configuration. The token may be undefined if some other form of
* authentication is being used.
*/
export async function makeCoderSdk(
export function makeCoderSdk(
baseUrl: string,
token: string | undefined,
storage: Storage,
): Promise<Api> {
): Api {
const restClient = new Api();
restClient.setHost(baseUrl);
if (token) {
Expand Down
2 changes: 1 addition & 1 deletion src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class CertificateError extends Error {
}

// allowInsecure updates the value of the "coder.insecure" property.
async allowInsecure(): Promise<void> {
allowInsecure(): void {
vscode.workspace
.getConfiguration()
.update("coder.insecure", true, vscode.ConfigurationTarget.Global);
Expand Down
8 changes: 4 additions & 4 deletions src/util.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, it, expect } from "vitest";
import { countSubstring, parseRemoteAuthority, toSafeHost } from "./util";

it("ignore unrelated authorities", async () => {
it("ignore unrelated authorities", () => {
const tests = [
"vscode://ssh-remote+some-unrelated-host.com",
"vscode://ssh-remote+coder-vscode",
Expand All @@ -15,7 +15,7 @@ it("ignore unrelated authorities", async () => {
}
});

it("should error on invalid authorities", async () => {
it("should error on invalid authorities", () => {
const tests = [
"vscode://ssh-remote+coder-vscode--foo",
"vscode://ssh-remote+coder-vscode--",
Expand All @@ -27,7 +27,7 @@ it("should error on invalid authorities", async () => {
}
});

it("should parse authority", async () => {
it("should parse authority", () => {
expect(
parseRemoteAuthority("vscode://ssh-remote+coder-vscode--foo--bar"),
).toStrictEqual({
Expand Down Expand Up @@ -81,7 +81,7 @@ it("should parse authority", async () => {
});
});

it("escapes url host", async () => {
it("escapes url host", () => {
expect(toSafeHost("https://foobar:8080")).toBe("foobar");
expect(toSafeHost("https://ほげ")).toBe("xn--18j4d");
expect(toSafeHost("https://test.😉.invalid")).toBe("test.xn--n28h.invalid");
Expand Down
2 changes: 1 addition & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const RemoteSSHLogPortRegex =
*
* Returns null if no port is found.
*/
export async function findPort(text: string): Promise<number | null> {
export function findPort(text: string): number | null {
const matches = text.match(RemoteSSHLogPortRegex);
if (!matches) {
return null;
Expand Down
4 changes: 2 additions & 2 deletions src/workspacesProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class WorkspaceProvider

// Create tree items for each workspace
const workspaceTreeItems = await Promise.all(
resp.workspaces.map(async (workspace) => {
resp.workspaces.map((workspace) => {
const workspaceTreeItem = new WorkspaceTreeItem(
workspace,
this.getWorkspacesQuery === WorkspaceQuery.All,
Expand Down Expand Up @@ -235,7 +235,7 @@ export class WorkspaceProvider
this._onDidChangeTreeData.fire(item);
}

async getTreeItem(element: vscode.TreeItem): Promise<vscode.TreeItem> {
getTreeItem(element: vscode.TreeItem): vscode.TreeItem {
return element;
}

Expand Down
Loading