Skip to content

Conversation

@kalvenschraut
Copy link
Contributor

@kalvenschraut kalvenschraut commented Dec 3, 2025

disclaimer this PR's code was generated entirely using opencode and claude opus 4.5. It has taken a lot of prompting on my end to get it into this state which I believe is a working on. I am not entirely sure how I would be able to test this on my ts codebase. I assume something with pnpm link would be possible?

I had it try look into reasons why my tests were so much slower and it found 1b11bfc to be one of the main reasons since the host in this repo has caching while ts go doesnt to my understanding.

I plan to review this over next week and test it out before I mark this as fully ready for external review but want to get some initial feedback if this was even the right direction / major glaring issues with the AI code.

Pretty excited about the speed increases from this as it is a major pain point in my company's code base and this rule and at least one other prefer nullish coalescing would be ones I wanted added asap so decided to try do it with opencode in my free time

closes #199

@graphite-app
Copy link

graphite-app bot commented Dec 3, 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.

@kalvenschraut kalvenschraut marked this pull request as draft December 3, 2025 10:27
@kalvenschraut kalvenschraut changed the title Feature/prefer optional chaining feat: prefer-optional-chaining Dec 3, 2025
"prefer_optional_chain_options": {
"type": "object",
"properties": {
"allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing": {

Choose a reason for hiding this comment

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

Probably should just skip adding this option, in light of #425

Choose a reason for hiding this comment

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

Technically this isn't a deprecated config option so there's maybe an argument for keeping it, but 🤷‍♂️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea I guess if its not deprecated then I guess should keep otherwise people who migrate may be confused where it is at IMO

func CreateCompilerHost(cwd string, fs vfs.FS) compiler.CompilerHost {
defaultLibraryPath := bundled.LibPath()
return compiler.NewCompilerHost(cwd, fs, defaultLibraryPath, nil, nil)
return NewCompilerHost(cwd, fs, defaultLibraryPath, nil, nil)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here was the change that helped speed up my test cases a lot IDK if this has any side effects other than AI seeing that typescript go didnt do any caching while our own host did

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.

[prefer-optional-chain](https://typescript-eslint.io/rules/prefer-optional-chain)

2 participants