-
Notifications
You must be signed in to change notification settings - Fork 8k
chore(build/compiler): Enable a bunch of strict TS compiler options. #6138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ion options. This matches the configuration internally in Google.
…ion options. This mostly matches the configuration internally in Google.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @richieforeman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request significantly enhances the type safety and code quality of the project by enabling a comprehensive set of strict TypeScript compiler options. This change aligns the project's TypeScript configuration more closely with Google's internal standards and introduces new utility functions for exhaustive type checking, ensuring more robust and predictable code behavior.
Highlights
- Enabling Stricter TypeScript Compiler Options: The tsconfig.json has been updated to activate several strict TypeScript flags, including noImplicitAny, noImplicitOverride, noImplicitReturns, noImplicitThis, noUnusedLocals, strictBindCallApply, strictFunctionTypes, strictNullChecks, and strictPropertyInitialization. This enforces more rigorous type checking across the codebase.
- Introducing Exhaustive Check Utilities: New assumeExhaustive and checkExhaustive utility functions have been added to packages/cli/src/utils/checks.ts. These functions are designed to help developers ensure that all possible cases in discriminated unions or switch statements are explicitly handled, preventing runtime errors due to unhandled states.
- Codebase Refactoring for Strict Compliance: Numerous files have been modified to adhere to the newly enforced strict TypeScript rules. This includes adding the override keyword to methods that override base class implementations, removing unused variables, and adjusting code to satisfy stricter type inference and usage requirements.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request is a great step towards improving code quality by enabling stricter TypeScript compiler options. The changes made to satisfy these new rules, such as adding override
keywords and cleaning up unused code, are well-executed. The new assumeExhaustive
utility is a good addition for type safety. My only suggestion is to refine the tsconfig.json
configuration to remove some redundant options that are already covered by the "strict": true
setting, which will make the configuration cleaner and easier to maintain.
Code Coverage Summary
CLI Package - Full Text Report
Core Package - Full Text Report
For detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Some minor comments then approved. Thanks for making our lints a bit stricter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…ct TS compiler options. (google-gemini#6138)
This merge integrates the following upstream commits from gemini-cli: SUCCESSFULLY CHERRY-PICKED AND INTEGRATED: - 22109db: chore(ci): add global linter (google-gemini#6111) - d219f90: Switch from useInput to useKeypress (google-gemini#6056) - 3a87712: Launch VS Code IDE Integration (google-gemini#6063) - 8d6eb8c: feat: add --approval-mode parameter (google-gemini#6024) - 9d023be: Upgrade integration tests to use Vitest (google-gemini#6021) - 661ee0a: chore(ci): Ensure e2e workflow security (google-gemini#6098) - 431a312: Show OpenTelemetry SDK in debug mode only (google-gemini#6096) - 0e8bbfb: chore: update bash to follow shellcheck (google-gemini#6102) - 214800c: chore(ci): Ensure ci workflow security (google-gemini#6109) - d3fda9d: Zed integration schema upgrade (google-gemini#5536) - f81ccd8: Add usage documentation for IDE integration (google-gemini#6154) - 74a13fb: Document certificate issue workaround (google-gemini#6157) - 9c7fb87: Add terminal setup for Shift+Enter/Ctrl+Enter (google-gemini#3289) - b61a63a: Move errorParsing.ts to core (google-gemini#6159) - 38876b7: Add support for trustedFolders.json config (google-gemini#6073) - 904f462: feat(core): Continue declarative tool migration (google-gemini#6114) - c0c0e9b: feat(core): Migrate read_many_files, shell, web_fetch (google-gemini#6167) - 8fae227: fix: Prevent duplicate tools after server refresh (google-gemini#5850) - a90aeb3: chore(build/compiler): Enable strict TS compiler options (google-gemini#6138) Preserved llxprt features throughout: - Multi-provider support (OpenAI, Anthropic, Google, Qwen) - USE_PROVIDER authentication type - @vybestack/llxprt-code-core package naming - Extended IDE integration features - llxprt branding and configuration - Custom authentication flows All commits were manually cherry-picked and conflicts resolved to maintain llxprt's architecture while incorporating upstream improvements.
TLDR
Dive Deeper
Reviewer Test Plan
N/A. Compiler only change.
Testing Matrix
N/A. Compiler only change.
Linked issues / bugs
N/A