Skip to content

基于项目的格式化配置

我现在必须要学习基于项目的格式化配置了。

基于 eslint 的技术选型

  • @antfu/eslint-config
  • simple-git-hooks

基于 prettier 的技术选型

直接 github 全局搜索 "*": "prettier" 文本,

在 package.json 内:

json
{
	"simple-git-hooks": {
		"pre-commit": "pnpm exec lint-staged --concurrent false"
	},
	"lint-staged": {
		"*": ["prettier --write --cache --ignore-unknown"]
	}
}

基本结束学习

现在(2025-3-30)除了 simple-git-hooks 和 lint-staged 这两款 git 钩子工具没有学习以外,其他的 eslint 和 prettier 基本上学的差不多了。

贡献者

The avatar of contributor named as ruan-cat ruan-cat

页面历史