feat: add enforceType option to control type annotation auto-fix behavior#445
feat: add enforceType option to control type annotation auto-fix behavior#445
Conversation
🦋 Changeset detectedLatest commit: 44022ab The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
📝 WalkthroughWalkthroughAdds a new Changes
Sequence DiagramsequenceDiagram
participant User
participant Rule as check-sql.rule
participant Utils as check-sql.utils
participant ESLint
User->>Rule: Run lint with enforceType config
Rule->>Rule: Detect missing/incorrect type annotation
Rule->>Utils: reportMissingTypeAnnotations(..., enforceType)
alt enforceType == "fix"
Utils->>Utils: build fixFn
Utils->>ESLint: report(..., fix: fixFn)
ESLint->>User: Apply auto-fix
else enforceType == "suggest"
Utils->>Utils: build fixFn
Utils->>ESLint: report(..., suggestions: [{desc, fix: fixFn}])
ESLint->>User: Show suggestion (manual accept)
end
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~23 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile OverviewGreptile SummaryThis PR adds a new Key Changes
Issue Found
Confidence Score: 4/5
Important Files Changed
|
| tag: TSESTree.TaggedTemplateExpression; | ||
| baseNode: TSESTree.BaseNode; | ||
| actual: string; | ||
| enforceType?: EnforceTypeOption; |
There was a problem hiding this comment.
parameter should be optional (add ?) to match reportIncorrectTypeAnnotations signature and allow undefined to be passed from connection.enforceType
| enforceType?: EnforceTypeOption; | |
| enforceType?: EnforceTypeOption; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/eslint-plugin/src/rules/check-sql.utils.ts
Line: 193:193
Comment:
parameter should be optional (add `?`) to match `reportIncorrectTypeAnnotations` signature and allow `undefined` to be passed from `connection.enforceType`
```suggestion
enforceType?: EnforceTypeOption;
```
How can I resolve this? If you propose a fix, please make it concise.
Summary by CodeRabbit
enforceTypeoption to the ESLint plugin (default: "fix"; supports "fix" or "suggest") to control whether type-annotation issues are auto-fixed or offered as IDE suggestions. Rule now exposes suggestion behavior when configured to "suggest".✏️ Tip: You can customize this high-level summary in your review settings.