Skip to content

Conversation

hardfist
Copy link
Contributor

this is used to simplify debug tsgo ast

@Copilot Copilot AI review requested due to automatic review settings August 22, 2025 07:57
Copy link

netlify bot commented Aug 22, 2025

Deploy Preview for rslint canceled.

Name Link
🔨 Latest commit 77fd061
🔍 Latest deploy log https://app.netlify.com/projects/rslint/deploys/68a822f605ffe80008e1ae4c

@hardfist hardfist marked this pull request as draft August 22, 2025 07:57
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds browser-based WASM support for running Rslint in web environments, specifically targeting TypeScript AST debugging capabilities. The implementation creates a browser playground that compiles the Go-based linter to WebAssembly and provides a JavaScript interface for in-browser execution.

  • Adds a new @rslint/browser package with WASM compilation and JavaScript bundling
  • Implements browser-specific execution mode with file system virtualization
  • Updates build constraints to properly handle WASM target compilation

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/vscode-extension/package.json Changes default binary source from "local" to "built-in"
packages/rslint-browser/package.json Defines new browser package with WASM build scripts and dependencies
packages/rslint-browser/src/index.mjs Main browser entry point using WASI and virtual file system
packages/rslint-browser/index.html Simple HTML page to load the bundled JavaScript
packages/rslint-browser/.gitignore Excludes generated WASM binary from version control
cmd/rslint/signal_wasm.go WASM-specific signal handling implementation
cmd/rslint/signal_unix.go Updates build constraints to be more specific about Unix platforms
cmd/rslint/main.go Adds browser mode argument handling and logging
cmd/rslint/browser.go Browser-specific execution logic for TypeScript program creation
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

return 1
} else {
for _, file := range program.GetSourceFiles() {
if(file.FileName() == "/input.ts") {
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary parentheses around the if condition. Go style prefers if file.FileName() == "/input.ts" without parentheses.

Suggested change
if(file.FileName() == "/input.ts") {
if file.FileName() == "/input.ts" {

Copilot uses AI. Check for mistakes.


rootDir := "/"
tsconfigPath := "/tsconfig.json"
fs := bundled.WrapFS(osvfs.FS());
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary semicolon at the end of the line. Go statements don't require semicolons.

Suggested change
fs := bundled.WrapFS(osvfs.FS());
fs := bundled.WrapFS(osvfs.FS())

Copilot uses AI. Check for mistakes.

} else {
for _, file := range program.GetSourceFiles() {
if(file.FileName() == "/input.ts") {
log.Printf("file: %v\n,%v", file.Text(),file.Node)
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the format string syntax. There's an extra comma in the newline sequence. It should be \"file: %v\\n%v\" instead of \"file: %v\\n,%v\".

Suggested change
log.Printf("file: %v\n,%v", file.Text(),file.Node)
log.Printf("file: %v\n%v", file.Text(),file.Node)

Copilot uses AI. Check for mistakes.

@hardfist hardfist closed this Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant