如何将 lint-stage 与 Husky 集成?

问题描述

我的 package.json(缩短版)

  "scripts": {
    "dev": "next dev","build": "next build","start": "next start","tsc": "tsc","type-check": "tsc --project tsconfig.json --pretty --noEmit","lint": "eslint --ext js,jsx,ts,tsx --fix"
  },"dependencies": {
    "@types/node": "^14.14.25","@types/react": "^17.0.1","eslint-plugin-jsx-a11y": "^6.4.1","eslint-plugin-react-hooks": "^4.2.0","next": "^10.0.6","react": "^17.0.1","react-dom": "^17.0.1","typescript": "^4.1.4"
  },"husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },"lint-staged": {
    "*.{js,tsx}": "eslint --cache --fix"
  }

我用 npm(不是 yarn)安装了所有东西。当我添加文件并提交时

git commit -m "test"
[main ca9db77] test
 1 file changed,4 insertions(+)
 create mode 100644 pages/test.tsx

没有棉绒分期,因此看不到哈士奇。 如何解决这个问题?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)