feat: port 3 @typescript-eslint prefer rules#462
Conversation
Summary of ChangesHello @fansenze, 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 ports three new rules from Highlights
Changelog
Activity
Using Gemini Code AssistThe 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 by creating a comment using either
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 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
|
There was a problem hiding this comment.
Code Review
This pull request ports three new @typescript-eslint rules: prefer-literal-enum-member, prefer-namespace-keyword, and prefer-string-starts-ends-with. It also includes a bug fix for IPC message length encoding. The implementations for prefer-namespace-keyword and prefer-string-starts-ends-with are well done. However, I've found a correctness issue in prefer-literal-enum-member where it incorrectly allows non-literal values for enum members, contrary to the original rule's behavior. I've also suggested a minor refactoring in the IPC bug fix for better clarity. Overall, good work on porting these complex rules.
internal/plugins/typescript/rules/prefer_literal_enum_member/prefer_literal_enum_member.go
Show resolved
Hide resolved
d743b37 to
f5fbe9b
Compare
- prefer-literal-enum-member - prefer-namespace-keyword - prefer-string-starts-ends-with
Require using TaskCreate/TaskUpdate for progress tracking throughout the porting workflow, preventing task loss during context compression.
f5fbe9b to
ec513a6
Compare
Summary
Port the following
@typescript-eslintrules:allowBitwiseExpressionsoption.namespaceinstead ofmodulekeyword. Auto-fixable.String#startsWith/endsWithinstead of manual string comparison patterns (s[0],charAt,indexOf,lastIndexOf,match,slice,substring,RegExp.test). Auto-fixable withallowSingleElementEqualityoption.Also fixes an IPC message length encoding bug in
packages/rslint/src/node.ts— was using JS string length (UTF-16 code units) instead of UTF-8 byte length, causing protocol corruption with non-ASCII characters.Additionally, improves the
port-ruleskill by adding persistent task tracking viaTaskCreate/TaskUpdate, preventing progress loss during context compression.Related Links
Checklist