fix: add eslint-plugin-regexp and resolve linting errors#3673
fix: add eslint-plugin-regexp and resolve linting errors#3673BobbieGoede merged 2 commits intonextfrom
eslint-plugin-regexp and resolve linting errors#3673Conversation
WalkthroughThis update revises several regular expressions across the codebase for improved accuracy and simplicity, particularly in domain normalization, translation function detection, Vue SFC script extraction, and file extension matching. Additionally, it introduces the Changes
Sequence Diagram(s)sequenceDiagram
participant ESLint
participant RegexpPlugin
participant Developer
Developer->>ESLint: Run lint
ESLint->>RegexpPlugin: Apply regexp recommended rules
RegexpPlugin-->>ESLint: Return lint results
ESLint-->>Developer: Report lint findings
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
✨ 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
eslint.config.js(2 hunks)package.json(1 hunks)src/runtime/domain.ts(1 hunks)src/transform/i18n-function-injection.ts(2 hunks)src/transform/resource.ts(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: test (lts/*, windows-latest)
- GitHub Check: test (lts/*, ubuntu-latest)
🔇 Additional comments (6)
package.json (1)
127-127: LGTM! Correctly adds the eslint-plugin-regexp dependency.The addition of
eslint-plugin-regexpas a dev dependency aligns perfectly with the PR objectives and supports the ESLint configuration changes.eslint.config.js (2)
5-5: LGTM! Proper import of the regexp plugin.The import statement correctly brings in the entire
eslint-plugin-regexpplugin for use in the flat config.
45-45: LGTM! Correctly integrates the regexp plugin configuration.The
flat/recommendedconfig is properly added to enable the recommended regexp linting rules. The placement in the config array is appropriate.src/runtime/domain.ts (1)
21-21: LGTM! Correctly removes unnecessary capturing group.The regex simplification from
/(https?):\/\//to/https?:\/\//removes an unused capturing group while maintaining identical functionality. This is a good optimization that likely addresses an eslint-plugin-regexp rule.src/transform/i18n-function-injection.ts (2)
18-18: LGTM! Regex optimization maintains functionality.The reordering of the alternation from
/(t|rt|d|n|tm|te)/to/([tdn]|rt|tm|te)/groups single-character functions together, which is a performance optimization likely suggested by eslint-plugin-regexp. The functionality remains identical.
141-141: LGTM! Appropriate regex simplification.Removing the optional whitespace matching (
\s*) after<scriptand before</scriptmakes the regex more efficient. While this is technically stricter, it's appropriate since<script >or< /script>patterns are extremely uncommon in practice.
🔗 Linked issue
📚 Description
Summary by CodeRabbit
Chores
Bug Fixes
Style