@huangjunsen/encode-fe-lint 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +0 -0
  3. package/lib/actions/init.d.ts +3 -0
  4. package/lib/actions/init.js +223 -0
  5. package/lib/actions/scan.d.ts +3 -0
  6. package/lib/actions/scan.js +137 -0
  7. package/lib/actions/update.d.ts +2 -0
  8. package/lib/actions/update.js +112 -0
  9. package/lib/cli.d.ts +2 -0
  10. package/lib/cli.js +230 -0
  11. package/lib/config/_editorconfig.ejs +13 -0
  12. package/lib/config/_eslintignore.ejs +9 -0
  13. package/lib/config/_eslintrc.js.ejs +3 -0
  14. package/lib/config/_markdownlint.json.ejs +1 -0
  15. package/lib/config/_markdownlintignore.ejs +5 -0
  16. package/lib/config/_prettierrc.js.ejs +8 -0
  17. package/lib/config/_stylelintignore.ejs +5 -0
  18. package/lib/config/_stylelintrc.js.ejs +5 -0
  19. package/lib/config/_vscode/extensions.json.ejs +7 -0
  20. package/lib/config/_vscode/settings.json.ejs +54 -0
  21. package/lib/config/commitlint.config.js.ejs +3 -0
  22. package/lib/config/encode-fe-lint.config.js.ejs +6 -0
  23. package/lib/index.d.ts +5 -0
  24. package/lib/index.js +93 -0
  25. package/lib/lints/eslint/doEslint.d.ts +6 -0
  26. package/lib/lints/eslint/doEslint.js +80 -0
  27. package/lib/lints/eslint/formatESLintResults.d.ts +3 -0
  28. package/lib/lints/eslint/formatESLintResults.js +39 -0
  29. package/lib/lints/eslint/getESLintConfig.d.ts +3 -0
  30. package/lib/lints/eslint/getESLintConfig.js +67 -0
  31. package/lib/lints/eslint/getESLintConfigType.d.ts +2 -0
  32. package/lib/lints/eslint/getESLintConfigType.js +26 -0
  33. package/lib/lints/eslint/index.d.ts +3 -0
  34. package/lib/lints/eslint/index.js +19 -0
  35. package/lib/lints/index.d.ts +4 -0
  36. package/lib/lints/index.js +20 -0
  37. package/lib/lints/markdownlint/doMarkdownlint.d.ts +6 -0
  38. package/lib/lints/markdownlint/doMarkdownlint.js +119 -0
  39. package/lib/lints/markdownlint/formatMarkdownlintResults.d.ts +3 -0
  40. package/lib/lints/markdownlint/formatMarkdownlintResults.js +39 -0
  41. package/lib/lints/markdownlint/getMarkdownlintConfig.d.ts +7 -0
  42. package/lib/lints/markdownlint/getMarkdownlintConfig.js +31 -0
  43. package/lib/lints/markdownlint/index.d.ts +3 -0
  44. package/lib/lints/markdownlint/index.js +19 -0
  45. package/lib/lints/prettier/doPrettier.d.ts +4 -0
  46. package/lib/lints/prettier/doPrettier.js +106 -0
  47. package/lib/lints/prettier/index.d.ts +1 -0
  48. package/lib/lints/prettier/index.js +17 -0
  49. package/lib/lints/stylelint/doStylelint.d.ts +5 -0
  50. package/lib/lints/stylelint/doStylelint.js +86 -0
  51. package/lib/lints/stylelint/formatStylelintResults.d.ts +3 -0
  52. package/lib/lints/stylelint/formatStylelintResults.js +39 -0
  53. package/lib/lints/stylelint/getStylelintConfig.d.ts +3 -0
  54. package/lib/lints/stylelint/getStylelintConfig.js +36 -0
  55. package/lib/lints/stylelint/getStylelintDocUrl.d.ts +1 -0
  56. package/lib/lints/stylelint/getStylelintDocUrl.js +13 -0
  57. package/lib/lints/stylelint/index.d.ts +3 -0
  58. package/lib/lints/stylelint/index.js +19 -0
  59. package/lib/types/index.d.ts +73 -0
  60. package/lib/types/index.js +2 -0
  61. package/lib/utils/conflict-resolve.d.ts +3 -0
  62. package/lib/utils/conflict-resolve.js +175 -0
  63. package/lib/utils/constants.d.ts +18 -0
  64. package/lib/utils/constants.js +133 -0
  65. package/lib/utils/generate-template.d.ts +2 -0
  66. package/lib/utils/generate-template.js +99 -0
  67. package/lib/utils/git.d.ts +3 -0
  68. package/lib/utils/git.js +105 -0
  69. package/lib/utils/init.d.ts +3 -0
  70. package/lib/utils/init.js +223 -0
  71. package/lib/utils/log.d.ts +8 -0
  72. package/lib/utils/log.js +25 -0
  73. package/lib/utils/npm-type.d.ts +2 -0
  74. package/lib/utils/npm-type.js +10 -0
  75. package/lib/utils/print-report.d.ts +3 -0
  76. package/lib/utils/print-report.js +109 -0
  77. package/lib/utils/update.d.ts +2 -0
  78. package/lib/utils/update.js +112 -0
  79. package/package.json +97 -0
package/package.json ADDED
@@ -0,0 +1,97 @@
1
+ {
2
+ "name": "@huangjunsen/encode-fe-lint",
3
+ "version": "1.0.0",
4
+ "description": "前端编码规范工程化标准脚手架",
5
+ "bin": "./lib/cli.js",
6
+ "main": "./lib/index.js",
7
+ "files": [
8
+ "lib/"
9
+ ],
10
+ "engines": {
11
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
12
+ },
13
+ "keywords": [
14
+ "encode",
15
+ "lint",
16
+ "cli"
17
+ ],
18
+ "devDependencies": {
19
+ "@types/command-exists": "^1.2.3",
20
+ "@types/cross-spawn": "^6.0.6",
21
+ "@types/ejs": "^3.1.5",
22
+ "@types/eslint": "^8.56.10",
23
+ "@types/fs-extra": "^9.0.13",
24
+ "@types/glob": "^7.2.0",
25
+ "@types/lodash": "^4.17.0",
26
+ "@types/node": "^20.12.7",
27
+ "@types/prettier": "^2.7.3",
28
+ "@types/stylelint": "^14.0.0",
29
+ "@types/text-table": "^0.2.5",
30
+ "copyfiles": "^2.4.1",
31
+ "jest": "^27.5.1",
32
+ "nyc": "^15.1.0",
33
+ "typescript": "^4.9.5"
34
+ },
35
+ "dependencies": {
36
+ "@babel/core": "^7.24.4",
37
+ "@babel/eslint-parser": "^7.24.1",
38
+ "@babel/preset-react": "^7.24.1",
39
+ "@commitlint/cli": "^16.3.0",
40
+ "@huangjunsen/commitlint-config": "^1.0.0",
41
+ "@huangjunsen/eslint-config": "^1.0.0",
42
+ "@huangjunsen/markdownlint-config": "^1.0.0",
43
+ "@huangjunsen/stylelint-config": "^1.0.0",
44
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
45
+ "@typescript-eslint/parser": "^5.62.0",
46
+ "chalk": "^4.1.2",
47
+ "command-exists": "^1.2.9",
48
+ "commander": "^6.2.1",
49
+ "cross-spawn": "^7.0.3",
50
+ "ejs": "^3.1.10",
51
+ "eslint": "^8.57.0",
52
+ "eslint-config-egg": "^10.0.0",
53
+ "eslint-config-prettier": "^8.10.0",
54
+ "eslint-import-resolver-typescript": "^2.7.1",
55
+ "eslint-plugin-import": "^2.29.1",
56
+ "eslint-plugin-jsx-a11y": "^6.8.0",
57
+ "eslint-plugin-prettier": "^4.2.1",
58
+ "eslint-plugin-react": "^7.34.1",
59
+ "eslint-plugin-react-hooks": "^4.6.0",
60
+ "eslint-plugin-vue": "^7.20.0",
61
+ "execa": "^5.1.1",
62
+ "fast-glob": "^3.3.2",
63
+ "fs-extra": "^9.1.0",
64
+ "glob": "^7.2.3",
65
+ "husky": "^3.1.0",
66
+ "inquirer": "^7.3.3",
67
+ "is-docker": "^2.2.1",
68
+ "lodash": "^4.17.21",
69
+ "markdownlint": "^0.25.1",
70
+ "markdownlint-rule-helpers": "^0.13.0",
71
+ "ora": "^5.4.1",
72
+ "prettier": "^2.8.8",
73
+ "strip-ansi": "^6.0.1",
74
+ "stylelint": "^14.16.1",
75
+ "stylelint-scss": "^4.7.0",
76
+ "terminal-link": "^2.1.1",
77
+ "text-table": "^0.2.0",
78
+ "vue-eslint-parser": "^7.11.0"
79
+ },
80
+ "author": "Huangjunsen <951434130@qq.com>",
81
+ "homepage": "https://github.com/Huang-junsen/js-encode-fe-spec#readme",
82
+ "license": "ISC",
83
+ "repository": {
84
+ "type": "git",
85
+ "url": "git+https://github.com/Huang-junsen/js-encode-fe-spec.git"
86
+ },
87
+ "bugs": {
88
+ "url": "https://github.com/Huang-junsen/js-encode-fe-spec/issues"
89
+ },
90
+ "scripts": {
91
+ "dev": "npm run copyfiles && tsc -w",
92
+ "build": "rm -rf lib && npm run copyfiles && tsc",
93
+ "copyfiles": "copyfiles -a -u 1 \"src/config/**\" lib",
94
+ "test": "npm run build && jest",
95
+ "coverage": "nyc jest --silent --forceExit"
96
+ }
97
+ }