Skip to content

Commit 6977330

Browse files
authored
chore: add go vet & go fmt (#142)
1 parent db8f72b commit 6977330

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,20 @@ jobs:
2323
uses: actions/checkout@v4
2424
with:
2525
submodules: true
26+
- name: Setup Node
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '24'
2630

2731
- name: Setup Go
2832
uses: ./.github/actions/setup-go
2933
with:
3034
go-version: ${{ matrix.go-version }}
3135
cache-name: test-go
36+
- name: go vet
37+
run: npm run lint:go
38+
- name: go fmt
39+
run: npm run format:go
3240
- name: Unit Test
3341
run: |
3442
go test -parallel 4 ./internal/...

internal/api/api.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ type HandshakeResponse struct {
5454

5555
// LintRequest represents a lint request from JS to Go
5656
type LintRequest struct {
57-
Files []string `json:"files,omitempty"`
58-
Config string `json:"config,omitempty"` // Path to rslint.json config file
59-
Format string `json:"format,omitempty"`
60-
WorkingDirectory string `json:"workingDirectory,omitempty"`
57+
Files []string `json:"files,omitempty"`
58+
Config string `json:"config,omitempty"` // Path to rslint.json config file
59+
Format string `json:"format,omitempty"`
60+
WorkingDirectory string `json:"workingDirectory,omitempty"`
6161
// Supports both string level and array [level, options] format
62-
RuleOptions map[string]interface{} `json:"ruleOptions,omitempty"`
63-
FileContents map[string]string `json:"fileContents,omitempty"` // Map of file paths to their contents for VFS
62+
RuleOptions map[string]interface{} `json:"ruleOptions,omitempty"`
63+
FileContents map[string]string `json:"fileContents,omitempty"` // Map of file paths to their contents for VFS
6464
}
6565

6666
// LintResponse represents a lint response from Go to JS

internal/rules/no_base_to_string/no_base_to_string.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ var NoBaseToStringRule = rule.Rule{
275275
// // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum
276276
// const variable = scope.set.get('String');
277277
// return !variable?.defs.length;
278-
return true
279278
}
280279
return false
281280
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
"test:go": "go test ./internal/...",
2626
"typecheck": "pnpm tsc -b tsconfig.json",
2727
"lint": "rslint",
28+
"lint:go": "go vet ./cmd/... ./internal/...",
29+
"format:go": "go fmt ./cmd/... ./internal/...",
2830
"prepare": "husky"
2931
},
3032
"devDependencies": {

0 commit comments

Comments
 (0)