Skip to content

Commit

Permalink
chore: prettier를 default formatter로 추가하고 저장시 사용합니다 (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonghyeon Ko authored Apr 15, 2024
1 parent 6c327b4 commit d998d29
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ workflows:
- check-peer:
filters:
branches:
ignore: main
ignore: main
6 changes: 1 addition & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ module.exports = {
ecmaFeatures: { jsx: true },
},

extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['@typescript-eslint'],
rules: {
'no-implicit-coercion': 'error',
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
20
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5"
}
}
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"eslint.workingDirectories": [{ "mode": "auto" }],
"jest.outputConfig": {
"revealOn": "run",
"revealWithFocus": "test-results",
Expand Down
1 change: 0 additions & 1 deletion README-en_us.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const sentence2 = josa(word2, '이/가') + ' 맛있습니다.';
console.log(sentence2); // '바나나가 맛있습니다.'
```


## Contributing

We welcome contribution from everyone in the community. Read below for detailed contribution guide.
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const sentence2 = josa(word2, '이/가') + ' 맛있습니다.';
console.log(sentence2); // '바나나가 맛있습니다.'
```


## 기여하기

es-hangul 라이브러리에 기여하고 싶다고 생각하셨다면 아래 문서를 참고해주세요.
Expand Down
6 changes: 3 additions & 3 deletions docs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ const withNextra = require('nextra')({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx',
defaultShowCopyCode: true,
})
});

/** @type {import('next').NextConfig} */
module.exports = withNextra({
reactStrictMode: true
})
reactStrictMode: true,
});
1 change: 0 additions & 1 deletion docs/src/pages/docs/api/disassembleHangul.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: disassembleHangul
---


# disassembleHangul

한글 문자열을 글자별로 초성/중성/종성 단위로 완전히 분리하여, 하나의 문자열로 만듭니다.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/docs/introduction.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 소개

한글을 다루는 제품을 개발할 때, 초성 검색, 정확한 조사 붙이기와 같은 작업을 수행해야 할 경우가 많습니다. 그 외로 초성, 중성, 종성 등의 한글을 분리하거나 결합해야 하는 경우도 있죠. `es-hangul` 은 이렇게 비즈니스에서 반복적으로 발생하는 한글 관련한 기능을 쉽고 빠르게 구현할 수 있도록 돕습니다.
한글을 다루는 제품을 개발할 때, 초성 검색, 정확한 조사 붙이기와 같은 작업을 수행해야 할 경우가 많습니다. 그 외로 초성, 중성, 종성 등의 한글을 분리하거나 결합해야 하는 경우도 있죠. `es-hangul` 은 이렇게 비즈니스에서 반복적으로 발생하는 한글 관련한 기능을 쉽고 빠르게 구현할 수 있도록 돕습니다.

<br />

Expand Down Expand Up @@ -29,6 +29,7 @@ console.log(result); // true
```

### 한글 문자열 분해

주어진 한글 문자열을 초성, 중성, 종성으로 분해하여 배열 형태로 반환하는 기능입니다. 이를 통해 문자열을 더 세밀하게 분석하거나 수정할 수 있습니다.

```tsx
Expand All @@ -54,4 +55,3 @@ const word2 = '바나나';
const sentence2 = josa(word2, '이/가') + ' 맛있습니다.';
console.log(sentence2); // '바나나가 맛있습니다.'
```

13 changes: 6 additions & 7 deletions docs/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import type { Config } from "tailwindcss";
import type { Config } from 'tailwindcss';

const config: Config = {
content: [
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
'./src/pages/**/*.{js,ts,jsx,tsx,mdx}',
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
],
theme: {
extend: {
backgroundImage: {
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
"gradient-conic":
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
'gradient-conic': 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
},
},
},
Expand Down
1 change: 1 addition & 0 deletions src/chosungIncludes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ describe('chosungIncludes', () => {
it('should return true when "ㅍㄹㅌ" is entered for searching "프론트엔드"', () => {
expect(chosungIncludes('프론트엔드', 'ㅍㄹㅌ')).toBe(true);
});

it('should return true when "ㅍㄹㅌ" is entered for searching "00프론트엔드"', () => {
expect(chosungIncludes('00프론트엔드', 'ㅍㄹㅌ')).toBe(true);
});
Expand Down
62 changes: 32 additions & 30 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,33 +99,35 @@ export const HANGUL_CHARACTERS_BY_MIDDLE_INDEX = Object.values(DISASSEMBLED_VOWE
/**
* 종성으로 올 수 있는 한글 글자
*/
export const HANGUL_CHARACTERS_BY_LAST_INDEX = ([
'',
'ㄱ',
'ㄲ',
'ㄳ',
'ㄴ',
'ㄵ',
'ㄶ',
'ㄷ',
'ㄹ',
'ㄺ',
'ㄻ',
'ㄼ',
'ㄽ',
'ㄾ',
'ㄿ',
'ㅀ',
'ㅁ',
'ㅂ',
'ㅄ',
'ㅅ',
'ㅆ',
'ㅇ',
'ㅈ',
'ㅊ',
'ㅋ',
'ㅌ',
'ㅍ',
'ㅎ',
] as const).map(consonant => DISASSEMBLED_CONSONANTS_BY_CONSONANT[consonant]);
export const HANGUL_CHARACTERS_BY_LAST_INDEX = (
[
'',
'ㄱ',
'ㄲ',
'ㄳ',
'ㄴ',
'ㄵ',
'ㄶ',
'ㄷ',
'ㄹ',
'ㄺ',
'ㄻ',
'ㄼ',
'ㄽ',
'ㄾ',
'ㄿ',
'ㅀ',
'ㅁ',
'ㅂ',
'ㅄ',
'ㅅ',
'ㅆ',
'ㅇ',
'ㅈ',
'ㅊ',
'ㅋ',
'ㅌ',
'ㅍ',
'ㅎ',
] as const
).map(consonant => DISASSEMBLED_CONSONANTS_BY_CONSONANT[consonant]);
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ export * from './disassemble';
export * from './hangulIncludes';
export * from './josa';
export * from './utils';

0 comments on commit d998d29

Please sign in to comment.