Skip to content

Fix ESLint errors: remove unnecessary escape characters in phone regex#281

Merged
hotlong merged 3 commits intocopilot/implement-object-and-field-schemasfrom
copilot/debug-issues-in-action-run
Jan 30, 2026
Merged

Fix ESLint errors: remove unnecessary escape characters in phone regex#281
hotlong merged 3 commits intocopilot/implement-object-and-field-schemasfrom
copilot/debug-issues-in-action-run

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 30, 2026

CI failing due to no-useless-escape lint errors in phone validation regex at validation-engine.ts:174.

Changes

  • Fixed regex: Characters +() don't require escaping within character class

    - const phoneRegex = /^[\d\s\-\+\(\)]+$/;
    + const phoneRegex = /^[\d\s\-+()]+$/;
  • Added test coverage: Phone validation now tested with common formats (123-456-7890, +1 (234) 567-8900, 1234567890)

Note

The regex remains intentionally permissive (allows any combination of digits, spaces, -+()) - this is pre-existing behavior, not modified by this PR.

Original prompt

引用: https://github.com/objectstack-ai/objectui/actions/runs/21514292684/job/61988711119#step:8:1


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Jan 30, 2026 11:49am
objectui-components Ready Ready Preview, Comment Jan 30, 2026 11:49am
objectui-crm-app Error Error Jan 30, 2026 11:49am

Request Review

Copilot AI and others added 2 commits January 30, 2026 11:41
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues in action run for objectui Fix ESLint errors: remove unnecessary escape characters in phone regex Jan 30, 2026
Copilot AI requested a review from hotlong January 30, 2026 11:45
@hotlong hotlong marked this pull request as ready for review January 30, 2026 12:46
Copilot AI review requested due to automatic review settings January 30, 2026 12:46
@hotlong hotlong merged commit f61c8ca into copilot/implement-object-and-field-schemas Jan 30, 2026
8 of 9 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes ESLint no-useless-escape errors in the phone validation regex and adds test coverage for phone number validation.

Changes:

  • Fixed phone validation regex by removing unnecessary escape characters for +, (, and ) within the character class
  • Added comprehensive test cases for phone validation covering multiple valid formats and an invalid case

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/core/src/validation/validation-engine.ts Removed unnecessary escape characters from phone validation regex
packages/core/src/validation/tests/validation-engine.test.ts Added test coverage for phone validation with valid and invalid test cases

@github-actions
Copy link
Copy Markdown
Contributor

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants