Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Basic Lint Rules #70

Merged
merged 8 commits into from
Nov 27, 2024
Merged

Add Basic Lint Rules #70

merged 8 commits into from
Nov 27, 2024

Conversation

graphemecluster
Copy link
Member

Adds minimal ESLint config with mostly stylistic rules to ensure code quality especially of incoming PRs.
I didn't employ a formatter for more flexibility with the snippets.

Additionally, derivers are now tested against all 音韻地位 to make sure they don't fail in any of them.

@graphemecluster graphemecluster requested review from untunt and syimyuzya and removed request for untunt and syimyuzya November 23, 2024 02:51
@graphemecluster
Copy link
Member Author

原則:只採納如 no-unreachable、no-unused-vars 之類運行時不會發現到的 rules,其他諸如 no-const-assign、no-invalid-regexp 之類運行時會發生錯誤的,以及如 array-bracket-newline、line-comment-position 等過份損害代碼自由度的則除外

@graphemecluster
Copy link
Member Author

本來想加一些 https://github.com/sindresorhus/eslint-plugin-unicorn 的 rules,但最後還是覺得太偏離 formatting,便棄用了

mid_tang.js Show resolved Hide resolved
.github/workflows/build.yml Show resolved Hide resolved
@graphemecluster
Copy link
Member Author

https://github.com/nk2028/tshet-uinh-examples/pull/63/files#r1855159531
我原本包含了 brace-style 這條 rule,但考慮到

else if (聲母 === 's' && 韻母.startsWith('y')) { 聲母 = 'sh'; 韻母 = 韻母.slice(1); } // 小 syou -> shou
else if (聲母 === 'z' && 韻母.startsWith('y')) { 聲母 = 'j'; 韻母 = 韻母.slice(1); } // 繞 zyou -> jou
else if (聲母 === 't' && 韻母.startsWith('y')) { 聲母 = 'ch'; 韻母 = 韻母.slice(1); } // 兆 tyou -> chou
這樣的情況,便沒有採納了

@graphemecluster graphemecluster requested review from syimyuzya and untunt and removed request for untunt and syimyuzya November 26, 2024 21:29
# Publish
- name: Install coscmd
# Publish to NPM
- if: github.event_name == 'release'
Copy link
Member

Choose a reason for hiding this comment

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

這兩個用於發佈的 steps,寫成 jobs 會不會更好些?(雖然需要重新 checkout 和 build,但是在 Actions 頁面下就可以一眼看到它是僅測試了還是同時做了發佈的事

Copy link
Member Author

Choose a reason for hiding this comment

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

加了 job name~

@graphemecluster graphemecluster merged commit 525275d into main Nov 27, 2024
1 check passed
This was referenced Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants