Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions helpers/validator.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import xss, { type IFilterXSSOptions } from "xss";

// Found at https://emailregex.com/
/* eslint-disable */
const EMAIL_REGEX = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
export const isEmail = (email: string): boolean => {
// Found at https://emailregex.com/
/* eslint-disable */
const regex =
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
/* eslint-enable */
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

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

The /* eslint-enable */ comment is in the wrong location. Since /* eslint-disable */ is now at line 4 (module scope), the corresponding /* eslint-enable */ should be at line 5 (after the EMAIL_REGEX constant definition), not inside the isEmail function.

Suggested fix:

// Found at https://emailregex.com/
/* eslint-disable */
const EMAIL_REGEX = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
/* eslint-enable */
export const isEmail = (email: string): boolean => {
  return EMAIL_REGEX.test(email);
};

Copilot uses AI. Check for mistakes.
return regex.test(email);
return EMAIL_REGEX.test(email);
};

export const spanWhitelist = {
Expand Down
Loading