Skip to content

Commit

Permalink
Chore: 정규식 수정 및 eslint 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoonyesol committed Jul 6, 2024
1 parent dd56760 commit 9929f00
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ module.exports = {
'import/extensions': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'warn',
'vitest/valid-title': 'off',
'react/jsx-props-no-spreading': 'off',
'jsx-a11y/label-has-associated-control': [
2,
{
labelAttributes: ['htmlFor'],
},
],

This comment has been minimized.

Copy link
@Yoonyesol

Yoonyesol Jul 6, 2024

Author Contributor

label 태그의 htmlFor과 textarea 태그의 id값을 연결해 주었음에도 eslint 에러가 발생해 해당 기능에 대한 처리를 해주었습니다.
참고한 레퍼런스: https://leo-xee.github.io/Error/eslint-label/

},
ignorePatterns: [
'dist',
Expand Down
2 changes: 1 addition & 1 deletion src/constants/regex.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const EMAIL_REGEX = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i;
export const EMAIL_REGEX = /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}(?:\.[a-z]{2,})?$/i;

This comment has been minimized.

Copy link
@Yoonyesol

Yoonyesol Jul 6, 2024

Author Contributor

/i 플래그는 대소문자를 구분하지 않도록 하는 플래그입니다. 이메일 주소의 사용자 이름 부분과 도메인 부분 둘 모두 대소문자 구분 없이 입력 받습니다.

export const PASSWORD_REGEX = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,16}$/;
export const PHONE_REGEX = /^01([0|1|6|7|8|9])-?([0-9]{3,4})-?([0-9]{4})$/;
6 changes: 4 additions & 2 deletions src/pages/user/SignUpPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,15 @@ export default function SignUpPage() {
{/* 자기소개 */}
<div className="flex flex-col">
<div className="flex flex-row justify-between">
<h1 className="font-bold">자기소개</h1>
<label htmlFor="bio" className="font-bold">
자기소개
</label>
<p>optional</p>
</div>
<textarea
{...register('bio')}
placeholder="ex) 안녕하세요. 홍길동입니다."
id="bio"
placeholder="ex) 안녕하세요. 홍길동입니다."
className="h-90 flex-grow resize-none rounded-lg border border-input p-8 text-sm outline-none placeholder:text-emphasis"
/>
</div>
Expand Down

0 comments on commit 9929f00

Please sign in to comment.