ant-design / ant-design-pro

👨🏻‍💻👩🏻‍💻 Use Ant Design like a Pro!
https://pro.ant.design
MIT License
36.35k stars 8.14k forks source link

git commit 报错【‼ lint-staged generated an argument string of 8789 characters, and commands might not run correctly on your platform.】 #5610

Closed LbhFront-end closed 4 years ago

LbhFront-end commented 4 years ago

🧐 问题描述

系统:window7 antd-pro:v4.0

git commit 报错

‼  lint-staged generated an argument string of 8789 characters, and commands might not run correctly on your platform.
It is recommended to use functions as linters and split your command based on the number of staged files. For more info, please visit:
https://github.com/okonet/lint-staged#using-js-functions-to-customize-linter-commands
Stashing changes... [started]
Stashing changes... [skipped]
→ No partially staged files found...
Running tasks... [started]
Running tasks for **/*.less [started]
Running tasks for **/*.{js,jsx,tsx,ts,less,md,json} [started]
Running tasks for **/*.{js,jsx} [started]
Running tasks for **/*.{js,ts,tsx} [started]
stylelint --syntax less [started]
prettier --write [started]
npm run lint-staged:js [started]
npm run lint-staged:js [started]
prettier --write [failed]
→
Running tasks for **/*.{js,jsx,tsx,ts,less,md,json} [failed]
→
npm run lint-staged:js [failed]
→
Running tasks for **/*.{js,ts,tsx} [failed]
→
stylelint --syntax less [completed]
Running tasks for **/*.less [completed]
npm run lint-staged:js [completed]
Running tasks for **/*.{js,jsx} [completed]
Running tasks... [failed]

× prettier --write found some errors. Please fix them and try committing again.

������̫����

× npm run lint-staged:js found some errors. Please fix them and try committing again.

������̫����
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ant-design-pro@4.0.0 lint-staged: `lint-staged`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ant-design-pro@4.0.0 lint-staged script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-11-16T03_18_36_935Z-debug.log
husky > pre-commit hook failed (add --no-verify to bypass)

package.json

{
  "name": "ant-design-pro",
  "version": "4.0.0",
  "private": true,
  "description": "An out-of-box UI solution for enterprise applications",
  "scripts": {
    "analyze": "cross-env ANALYZE=1 umi build",
    "build": "umi build",
    "ui": "umi ui",
    "deploy": "cross-env ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION=site npm run site && npm run gh-pages",
    "docker-hub:build": "docker build  -f Dockerfile.hub -t  ant-design-pro ./",
    "docker-prod:build": "docker-compose -f ./docker/docker-compose.yml build",
    "docker-prod:dev": "docker-compose -f ./docker/docker-compose.yml up",
    "docker:build": "docker-compose -f ./docker/docker-compose.dev.yml build",
    "docker:dev": "docker-compose -f ./docker/docker-compose.dev.yml up",
    "docker:push": "npm run docker-hub:build && npm run docker:tag && docker push antdesign/ant-design-pro",
    "docker:tag": "docker tag ant-design-pro antdesign/ant-design-pro",
    "fetch:blocks": "pro fetch-blocks && npm run prettier",
    "format-imports": "cross-env import-sort --write '**/*.{js,jsx,ts,tsx}'",
    "functions:build": "netlify-lambda build ./lambda",
    "functions:run": "cross-env NODE_ENV=dev netlify-lambda serve ./lambda",
    "gh-pages": "cp CNAME ./dist/ && gh-pages -d dist",
    "i18n-remove": "pro i18n-remove --locale=zh-CN --write",
    "lint": "npm run lint:js && npm run lint:style && npm run lint:prettier",
    "lint-staged": "lint-staged",
    "lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx ",
    "lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src && npm run lint:style",
    "lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
    "lint:prettier": "check-prettier lint",
    "lint:style": "stylelint --fix \"src/**/*.less\" --syntax less",
    "prettier": "prettier -c --write \"**/*\"",
    "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
    "site": "npm run fetch:blocks && npm run build && npm run functions:build",
    "start": "umi dev",
    "start:no-mock": "cross-env MOCK=none umi dev",
    "start:no-ui": "cross-env UMI_UI=none umi dev",
    "test": "umi test",
    "test:all": "node ./tests/run-tests.js",
    "test:component": "umi test ./src/components",
    "svg": "node svg-generator.js"
  },
  "husky": {
    "hooks": {
      "pre-commit": "npm run lint-staged",
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  },
  "lint-staged": {
    "**/*.less": "stylelint --syntax less",
    "**/*.{js,jsx,tsx,ts,less,md,json}": [
      "prettier --write",
      "git add"
    ],
    "**/*.{js,jsx}": "npm run lint-staged:js",
    "**/*.{js,ts,tsx}": "npm run lint-staged:js"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 10"
  ],
  "dependencies": {
    "@ant-design/colors": "^3.1.0",
    "@ant-design/pro-layout": "^4.5.16",
    "@antv/data-set": "^0.10.2",
    "antd": "^3.23.6",
    "classnames": "^2.2.6",
    "dva": "^2.4.1",
    "lodash": "^4.17.11",
    "moment": "^2.24.0",
    "omit.js": "^1.0.2",
    "path-to-regexp": "^3.1.0",
    "pont-engine": "^0.3.4",
    "qs": "^6.9.0",
    "react": "^16.8.6",
    "react-copy-to-clipboard": "^5.0.1",
    "react-document-title": "^2.0.3",
    "react-dom": "^16.8.6",
    "redux": "^4.0.1",
    "slash2": "^2.0.0",
    "umi": "^2.9.6",
    "umi-plugin-pro-block": "^1.3.4",
    "umi-plugin-react": "^1.10.1",
    "umi-request": "^1.2.7",
    "webpack-theme-color-replacer": "^1.2.15",
    "typescript-react-svg-icon-generator": "^1.1.9"
  },
  "devDependencies": {
    "@ant-design/pro-cli": "^1.0.13",
    "@commitlint/cli": "^8.1.0",
    "@commitlint/config-conventional": "^8.1.0",
    "@types/classnames": "^2.2.7",
    "@types/express": "^4.17.0",
    "@types/history": "^4.7.2",
    "@types/jest": "^24.0.13",
    "@types/lodash": "^4.14.144",
    "@types/qs": "^6.5.3",
    "@types/react": "^16.8.19",
    "@types/react-document-title": "^2.0.3",
    "@types/react-dom": "^16.8.4",
    "@umijs/fabric": "^1.2.0",
    "chalk": "^2.4.2",
    "check-prettier": "^1.0.3",
    "conventional-changelog": "^3.1.10",
    "conventional-changelog-cli": "^2.0.23",
    "cross-env": "^6.0.0",
    "cross-port-killer": "^1.1.1",
    "enzyme": "^3.9.0",
    "eslint": "5.16.0",
    "eslint-plugin-react-hooks": "^2.2.0",
    "express": "^4.17.1",
    "gh-pages": "^2.0.1",
    "husky": "^3.0.3",
    "import-sort-cli": "^6.0.0",
    "import-sort-parser-babylon": "^6.0.0",
    "import-sort-parser-typescript": "^6.0.0",
    "import-sort-style-module": "^6.0.0",
    "jest-puppeteer": "^4.2.0",
    "lint-staged": "8.2.1",
    "mockjs": "^1.0.1-beta3",
    "netlify-lambda": "^1.4.13",
    "node-fetch": "^2.6.0",
    "prettier": "^1.17.1",
    "pro-download": "1.0.1",
    "serverless-http": "^2.0.2",
    "stylelint": "^10.1.0",
    "umi-plugin-ga": "^1.1.3",
    "umi-plugin-pro": "^1.0.2",
    "umi-types": "^0.5.0"
  },
  "optionalDependencies": {
    "puppeteer": "^1.17.0"
  },
  "config": {
    "commitizen": {
      "path": "cz-customizable"
    }
  },
  "engines": {
    "node": ">=10.0.0"
  },
  "checkFiles": [
    "src/**/*.js*",
    "src/**/*.ts*",
    "src/**/*.less",
    "config/**/*.js*",
    "scripts/**/*.js"
  ],
  "create-umi": {
    "ignoreScript": [
      "docker*",
      "functions*",
      "site",
      "generateMock"
    ],
    "ignoreDependencies": [
      "netlify*",
      "serverless"
    ],
    "ignore": [
      ".dockerignore",
      ".git",
      ".gitpod.yml",
      "CODE_OF_CONDUCT.md",
      "Dockerfile",
      "Dockerfile.*",
      "lambda",
      "LICENSE",
      "netlify.toml",
      "README.*.md",
      "azure-pipelines.yml",
      "docker",
      "CNAME",
      "create-umi"
    ]
  }
}
LbhFront-end commented 4 years ago

上面的问题 好像是版本的问题,lint-staged v9 window会有这个问题。然后又出现了别的问题

F:\GitLab
p-front-v2\config\router.config.ts
0:0  warning  File ignored because of a matching ignore pattern. Use "--no-ignore" to override

F:\GitLab
p-front-v2\config\plugin.config.ts
0:0  warning  File ignored because of a matching ignore pattern. Use "--no-ignore" to override

F:\GitLab
p-front-v2\config\defaultSettings.ts
0:0  warning  File ignored because of a matching ignore pattern. Use "--no-ignore" to override

F:\GitLab
p-front-v2\config\config.ts
0:0  warning  File ignored because of a matching ignore pattern. Use "--no-ignore" to override

F:\GitLab
p-front-v2\.stylelintrc.js
0:0  warning  File ignored by default.  Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override

F:\GitLab
p-front-v2\.prettierrc.js
0:0  warning  File ignored by default.  Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override

F:\GitLab
p-front-v2\.eslintrc.js
0:0  warning  File ignored by default.  Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override

.eslintignore

/scripts
/config
/src/services
/src/components/NpIcon
.history

/config 文件是在 eslintignore 默认配置的,好像不会生效。是因为什么问题覆盖了这个忽略吗