Skip to content

Commit

Permalink
feat: textlint (#971 #926) (#985)
Browse files Browse the repository at this point in the history
* chore: textlint basic environment settings

textlint 관련 기본 환경 설정 진행.

textlintrc.js -> textlintrc: .eslintrc 및 .prettierrc와의 통일성을 위해, .js 확장자를 사용하지 않는 json 형식의 파일로 변경.
package.json에 textlint 및 textlint-filter-rule-comments 추가.
yarn.lock 파일은 package.json 파일에 따라 자동으로 변경됨.

* feat: basic implementation of translateGlossary.js

translateGlossary.js 기본 틀/구조 구현. (아직 디테일한 버그들은 잡지 못한 상태.)
이외, legacy 파일들 삭제. (legacy 파일에서 필요한 부분은 따로 정리하여 보관 중.)

* chore: textlint testing environment settings

textlint testing 관련 환경 설정 진행.

package에 mocha 및 textlint-tester 추가.

* test: new tests about strip.js

./textlint/utils/strip.js에 포함된 모든 함수에 대한 테스트 작성.

* test: new tests about is.js

./textlint/utils/is.js에 포함된 모든 함수에 대한 테스트 작성.

* test: new tests about errMsg.js

./textlint/utils/errMsg.js에 포함된 모든 함수에 대한 테스트 작성.

* feat: new rule translateGlossary.js

translateGlossary 규칙 구현 완료.

* fix: incorrect regex in translateGlossary.js

잘못된 정규표현식 표현 수정.

* test: new tests about translateGlossary.js

./textlint/rules/translateGlossary.js에 대한 테스트 작성.

* rename: textlint/data/tests -> textlint/data/utils

디렉토리 이름 변경.

* fix: correct path handling for textlint/tests/utils

모듈 불러오기 경로가 잘못되어, 수정 진행.

* refactor: change the structure of textlint/data/rules/translateGlossary.js

확장성을 위해 데이터 구조 변경.

* refactor: change the structure of textlint/data/rules/translateGlossary.js

확장성을 위해 데이터 구조 변경.

* feat: add genTranslateGlossaryDocs.js

translate-glossary.md 문서를 자동 생성해주는 generator 도입.
생성된 문서는 repository에 올라갈 필요가 없으므로, .gitignore에 해당 부분 추가.
textlint/README.md는 우선 삭제. 추후에 wiki 디렉토리에 추가 예정.

* rename: textlint/README.md -> wiki/textlint/what-is-textlint.md

파일 이름 및 디렉토리 변경 진행.

* feat: new scripts for textlint

textlint와 관련된 test, docs, lint scripts 추가.

---------

Co-authored-by: Haegul Pyun <[email protected]>
  • Loading branch information
lumirlumir and hg-pyun committed Jul 13, 2024
1 parent 8368cd6 commit 27f7a48
Show file tree
Hide file tree
Showing 24 changed files with 2,344 additions and 233 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ public/fonts/**/Optimistic_*.woff2

# rss
public/rss.xml

# textlint
wiki/textlint/translate-glossary.md
5 changes: 5 additions & 0 deletions .textlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"filters": {
"comments": true
}
}
6 changes: 0 additions & 6 deletions .textlintrc.js

This file was deleted.

9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
"start": "next start",
"postinstall": "patch-package && (is-ci || husky install .husky)",
"check-all": "npm-run-all prettier lint:fix tsc rss",
"rss": "node scripts/generateRss.js"
"rss": "node scripts/generateRss.js",
"textlint-test": "yarn mocha ./textlint/tests/utils && yarn mocha ./textlint/tests/rules",
"textlint-docs": "node ./textlint/generators/genTranslateGlossaryDocs.js",
"textlint-lint": "yarn textlint ./src/content --rulesdir ./textlint/rules -f pretty-error"
},
"dependencies": {
"@codesandbox/sandpack-react": "2.13.5",
Expand Down Expand Up @@ -76,6 +79,7 @@
"lint-staged": ">=10",
"mdast-util-to-string": "^1.1.0",
"metro-cache": "0.72.2",
"mocha": "^10.6.0",
"npm-run-all": "^4.1.5",
"patch-package": "^6.2.2",
"postcss": "^8.4.5",
Expand All @@ -93,6 +97,9 @@
"retext-smartypants": "^4.0.0",
"rss": "^1.2.2",
"tailwindcss": "^3.4.1",
"textlint": "^14.0.4",
"textlint-filter-rule-comments": "^1.2.2",
"textlint-tester": "^14.0.4",
"typescript": "^4.0.2",
"unist-util-visit": "^2.0.3",
"webpack-bundle-analyzer": "^4.5.0"
Expand Down
Loading

0 comments on commit 27f7a48

Please sign in to comment.