Skip to content

Conversation

nnnnoel
Copy link

@nnnnoel nnnnoel commented Sep 9, 2025

Closes #195

Copy link

graphite-app bot commented Sep 9, 2025

How to use the Graphite Merge Queue

Add the label 0-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@camc314
Copy link
Contributor

camc314 commented Sep 11, 2025

@nnnnoel feel free to just patch the typescript-go submodule rather than having to wait for typescript-go changes

Ref: microsoft/typescript-go#1707

example patch: https://github.com/oxc-project/tsgolint/blob/10689510989fcec60c895ff3d1871822501bc442/patches/0001-Parallel-readDirectory-visitor.patch#L0-L1

@nnnnoel
Copy link
Author

nnnnoel commented Sep 12, 2025

@camc314 I applied patch and added test cases for implemented rule

@auvred
Copy link
Collaborator

auvred commented Sep 12, 2025

FYI: gen_shims allows reexporting private struct fieds using ExtraFields:

"ExtraFields": {
"Type": [
"alias",
"flags",
"symbol",
"objectFlags"
],

type extra_Type struct {
flags checker.TypeFlags
objectFlags checker.ObjectFlags
id checker.TypeId
symbol *ast.Symbol
alias *checker.TypeAlias
checker *checker.Checker
data checker.TypeData
}
func Type_alias(v *checker.Type) *checker.TypeAlias {
return ((*extra_Type)(unsafe.Pointer(v))).alias
}
func Type_flags(v *checker.Type) checker.TypeFlags {
return ((*extra_Type)(unsafe.Pointer(v))).flags
}
func Type_symbol(v *checker.Type) *ast.Symbol {
return ((*extra_Type)(unsafe.Pointer(v))).symbol
}
func Type_objectFlags(v *checker.Type) checker.ObjectFlags {
return ((*extra_Type)(unsafe.Pointer(v))).objectFlags
}

@nnnnoel
Copy link
Author

nnnnoel commented Sep 12, 2025

@auvred Thanks, I changed to consistent way to access private struct

@camc314
Copy link
Contributor

camc314 commented Sep 16, 2025

I tried some test cases from typescript-eslint and they report errors when they shouldn't? How did you port the test cases across?

--- FAIL: TestStrictBooleanExpressionsRule (10.86s)
    --- FAIL: TestStrictBooleanExpressionsRule/valid-0 (0.05s)
        /Users/cameron/github/oxc-project/tsgolint/internal/rules/strict_boolean_expressions/rule_tester.go:115: Expected valid test case not to contain errors. Code:
            declare const foo: boolean & { __BRAND: 'Foo' };
            if (foo) {
            }
        /Users/cameron/github/oxc-project/tsgolint/internal/rules/strict_boolean_expressions/rule_tester.go:117: error 1 - (53-56) Unexpected mixed type in conditional. The constituent types do not have a best common type.

https://github.com/typescript-eslint/typescript-eslint/blob/0a0a085229523cc6510f3ffb011d7fd93d83045a/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts#L469-L473

@nnnnoel
Copy link
Author

nnnnoel commented Sep 16, 2025

Oh, I just requested to Claude code port file to golang, looks not fine.
I'll try to fix it ASAP.

@nnnnoel nnnnoel marked this pull request as draft September 16, 2025 16:13
@Boshen Boshen mentioned this pull request Sep 18, 2025
@nnnnoel nnnnoel force-pushed the feat/strict-boolean-expressions branch from bebb1af to 0d1245c Compare September 29, 2025 00:57
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.

[strict-boolean-expressions](https://typescript-eslint.io/rules/strict-boolean-expressions)
4 participants