Skip to content

Commit 12bd84b

Browse files
renovate[bot]github-actions[bot]
authored andcommitted
chore(deps): update typescript-go digest to 865ec14 (#259)
Coming soon: The Renovate bot (GitHub App) will be renamed to Mend. PRs from Renovate will soon appear from 'Mend'. Learn more [here](https://redirect.github.com/renovatebot/renovate/discussions/37842). This PR contains the following updates: | Package | Update | Change | |---|---|---| | typescript-go | digest | `1ca5a2d` -> `865ec14` | --- 📅 **Schedule**: Branch creation - "before 9am" in timezone Asia/Shanghai, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/oxc-project/tsgolint). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS45Ny4xMCIsInVwZGF0ZWRJblZlciI6IjQxLjk3LjEwIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: github-actions <github-actions[bot]@users.noreply.github.com>
1 parent 4929b0b commit 12bd84b

File tree

48 files changed

+1279
-282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1279
-282
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,6 @@ jobs:
8686
runs-on: ubuntu-latest
8787
steps:
8888
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
89-
- uses: crate-ci/typos@07d900b8fa1097806b8adb6391b0d3e0ac2fdea7 # v1.39.0
89+
- uses: crate-ci/typos@80c8a4945eec0f6d464eaf9e65ed98ef085283d1 # v1.38.1
9090
with:
9191
files: .

.github/workflows/dprint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
steps:
1818
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
1919

20-
- uses: taiki-e/install-action@81ee1d48d9194cdcab880cbdc7d36e87d39874cb # v2.62.45
20+
- uses: taiki-e/install-action@c5b1b6f479c32f356cc6f4ba672a47f63853b13b # v2.62.38
2121
with:
2222
tool: dprint
2323

cmd/tsgolint/headless.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ func runHeadless(args []string) int {
354354
rules[i] = linter.ConfiguredRule{
355355
Name: r.Name,
356356
Run: func(ctx rule.RuleContext) rule.RuleListeners {
357-
return r.Run(ctx, nil)
357+
return r.Run(ctx, headlessRule.Options)
358358
},
359359
}
360360
}

cmd/tsgolint/payload.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ type headlessConfig struct {
2929
}
3030

3131
type headlessRule struct {
32-
Name string `json:"name"`
32+
Name string `json:"name"`
33+
Options any `json:"options,omitempty"`
3334
}
3435

3536
func deserializePayload(data []byte) (*headlessPayload, error) {

dprint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"toml": {},
1111
"excludes": ["e2e/fixtures/**", "pnpm-lock.yaml", "internal/rules/**", "typescript-go/**"],
1212
"plugins": [
13-
"https://plugins.dprint.dev/typescript-0.95.12.wasm",
13+
"https://plugins.dprint.dev/typescript-0.95.11.wasm",
1414
"https://plugins.dprint.dev/json-0.21.0.wasm",
1515
"https://plugins.dprint.dev/markdown-0.20.0.wasm",
1616
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",

e2e/__snapshots__/snapshot.test.ts.snap

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,34 @@ exports[`TSGoLint E2E Snapshot Tests > should generate consistent diagnostics sn
716716
},
717717
"rule": "require-await",
718718
},
719+
{
720+
"file_path": "fixtures/basic/rules/no-floating-promises/void.ts",
721+
"fixes": [],
722+
"message": {
723+
"description": "This rule requires the \`strictNullChecks\` compiler option to be turned on to function correctly.",
724+
"id": "noStrictNullCheck",
725+
},
726+
"range": {
727+
"end": 0,
728+
"pos": 0,
729+
},
730+
"rule": "no-unnecessary-boolean-literal-compare",
731+
"suggestions": [],
732+
},
733+
{
734+
"file_path": "fixtures/basic/rules/no-floating-promises/void.ts",
735+
"fixes": [],
736+
"message": {
737+
"description": "Function has no 'await' expression.",
738+
"id": "missingAwait",
739+
},
740+
"range": {
741+
"end": 53,
742+
"pos": 0,
743+
},
744+
"rule": "require-await",
745+
"suggestions": [],
746+
},
719747
{
720748
"file_path": "fixtures/basic/rules/no-for-in-array/index.ts",
721749
"kind": 0,
@@ -4345,3 +4373,40 @@ exports[`TSGoLint E2E Snapshot Tests > should handle tsconfig diagnostics when T
43454373
},
43464374
]
43474375
`;
4376+
4377+
exports[`TSGoLint E2E Snapshot Tests > supports passing rule config 1`] = `
4378+
[
4379+
{
4380+
"file_path": "fixtures/basic/rules/no-floating-promises/void.ts",
4381+
"fixes": [],
4382+
"message": {
4383+
"description": "Promises must be awaited.",
4384+
"help": "The promise must end with a call to .catch, or end with a call to .then with a rejection handler.",
4385+
"id": "floating",
4386+
},
4387+
"range": {
4388+
"end": 76,
4389+
"pos": 54,
4390+
},
4391+
"rule": "no-floating-promises",
4392+
"suggestions": [
4393+
{
4394+
"fixes": [
4395+
{
4396+
"range": {
4397+
"end": 58,
4398+
"pos": 54,
4399+
},
4400+
"text": "await",
4401+
},
4402+
],
4403+
"message": {
4404+
"description": "Promises must be awaited.",
4405+
"help": "The promise must end with a call to .catch, or end with a call to .then with a rejection handler.",
4406+
"id": "floating",
4407+
},
4408+
},
4409+
],
4410+
},
4411+
]
4412+
`;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
async function returnsPromise() {
2+
return 'value';
3+
}
4+
void returnsPromise();

e2e/snapshot.test.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ async function getTestFiles(testPath: string): Promise<string[]> {
176176
return allFiles;
177177
}
178178

179+
function resolveTestFilePath(relativePath: string): string {
180+
return join(FIXTURES_DIR, relativePath);
181+
}
182+
179183
function generateConfig(files: string[], rules: readonly (typeof ALL_RULES)[number][] = ALL_RULES): string {
180184
// Headless payload format:
181185
// ```json
@@ -225,6 +229,43 @@ describe('TSGoLint E2E Snapshot Tests', () => {
225229
expect(diagnostics).toMatchSnapshot();
226230
});
227231

232+
it('supports passing rule config', async () => {
233+
const testFile = resolveTestFilePath('basic/rules/no-floating-promises/void.ts');
234+
const config = (ignoreVoid: boolean) => ({
235+
version: 2,
236+
configs: [
237+
{
238+
file_paths: [testFile],
239+
rules: [
240+
{
241+
name: 'no-floating-promises',
242+
options: { ignoreVoid },
243+
},
244+
],
245+
},
246+
],
247+
});
248+
249+
let output: Buffer;
250+
output = execFileSync(TSGOLINT_BIN, ['headless'], {
251+
input: JSON.stringify(config(false)),
252+
});
253+
254+
let diagnostics = parseHeadlessOutput(output);
255+
diagnostics = sortDiagnostics(diagnostics);
256+
257+
expect(diagnostics.length).toBeGreaterThan(0);
258+
expect(diagnostics).toMatchSnapshot();
259+
260+
// Re-run with ignoreVoid=true, should have no diagnostics
261+
output = execFileSync(TSGOLINT_BIN, ['headless'], {
262+
input: JSON.stringify(config(true)),
263+
});
264+
265+
diagnostics = parseHeadlessOutput(output);
266+
expect(diagnostics.length).toBe(0);
267+
});
268+
228269
it.runIf(process.platform === 'win32')(
229270
'should not panic with mixed forward/backslash paths from Rust (issue #143)',
230271
async () => {

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ require (
4848

4949
require (
5050
github.com/dlclark/regexp2 v1.11.5 // indirect
51-
github.com/go-json-experiment/json 4849db3c2f7e
52-
github.com/microsoft/typescript-go v0.0.0-20251101004942-6fb55b7eabb4 // indirect
51+
github.com/go-json-experiment/json v0.0.0-20251024212118-8a0206d3c796
52+
github.com/microsoft/typescript-go v0.0.0-20251030213704-4705d38bdc17 // indirect
5353
golang.org/x/text v0.30.0
5454
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
66
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
77
github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4=
88
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
9-
github.com/microsoft/typescript-go v0.0.0-20251101004942-6fb55b7eabb4 h1:BEinK5nx8JzdOlE7H62Kcn1qqmIj9JFjNVzPR0/YGMw=
10-
github.com/microsoft/typescript-go v0.0.0-20251101004942-6fb55b7eabb4/go.mod h1:/yWoZzcFKn2eQjB4E+kfEhQ/iGVrFKYswH1ZW+jWZu8=
9+
github.com/microsoft/typescript-go v0.0.0-20251030213704-4705d38bdc17 h1:9IyQ4uESEoxP9XuUljEDle3mXOMsizbetOy/khGKe3w=
10+
github.com/microsoft/typescript-go v0.0.0-20251030213704-4705d38bdc17/go.mod h1:/yWoZzcFKn2eQjB4E+kfEhQ/iGVrFKYswH1ZW+jWZu8=
1111
github.com/peter-evans/patience v0.3.0 h1:rX0JdJeepqdQl1Sk9c9uvorjYYzL2TfgLX1adqYm9cA=
1212
github.com/peter-evans/patience v0.3.0/go.mod h1:Kmxu5sY1NmBLFSStvXjX1wS9mIv7wMcP/ubucyMOAu0=
1313
github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=

0 commit comments

Comments
 (0)