almighty-tool 0.0.1

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 (115) hide show
  1. package/.babelrc +17 -0
  2. package/.editorconfig +13 -0
  3. package/.eslintignore +7 -0
  4. package/.eslintrc.js +5 -0
  5. package/.nvmrc +1 -0
  6. package/.prettierrc.js +1 -0
  7. package/.yarnrc +12 -0
  8. package/CHANGELOG.md +7 -0
  9. package/README.md +11 -0
  10. package/jest.config.js +1 -0
  11. package/lib/api/interfaces/api/base.api.d.ts +48 -0
  12. package/lib/api/interfaces/api/base.api.js +3 -0
  13. package/lib/api/interfaces/api/base.api.js.map +1 -0
  14. package/lib/api/interfaces/models/basic.model.d.ts +4 -0
  15. package/lib/api/interfaces/models/basic.model.js +3 -0
  16. package/lib/api/interfaces/models/basic.model.js.map +1 -0
  17. package/lib/api/interfaces/models/pagination.model.d.ts +26 -0
  18. package/lib/api/interfaces/models/pagination.model.js +3 -0
  19. package/lib/api/interfaces/models/pagination.model.js.map +1 -0
  20. package/lib/api/interfaces/types.d.ts +7 -0
  21. package/lib/api/interfaces/types.js +3 -0
  22. package/lib/api/interfaces/types.js.map +1 -0
  23. package/lib/api/models/basic.model.d.ts +7 -0
  24. package/lib/api/models/basic.model.js +25 -0
  25. package/lib/api/models/basic.model.js.map +1 -0
  26. package/lib/api/models/pagination.model.d.ts +35 -0
  27. package/lib/api/models/pagination.model.js +113 -0
  28. package/lib/api/models/pagination.model.js.map +1 -0
  29. package/lib/common/enum-object.d.ts +48 -0
  30. package/lib/common/enum-object.js +84 -0
  31. package/lib/common/enum-object.js.map +1 -0
  32. package/lib/common/general.d.ts +28 -0
  33. package/lib/common/general.js +173 -0
  34. package/lib/common/general.js.map +1 -0
  35. package/lib/common/validator.d.ts +20 -0
  36. package/lib/common/validator.js +30 -0
  37. package/lib/common/validator.js.map +1 -0
  38. package/lib/dayjs/locales/zh-cn.d.ts +40 -0
  39. package/lib/dayjs/locales/zh-cn.js +73 -0
  40. package/lib/dayjs/locales/zh-cn.js.map +1 -0
  41. package/lib/formats/date.format.d.ts +30 -0
  42. package/lib/formats/date.format.js +78 -0
  43. package/lib/formats/date.format.js.map +1 -0
  44. package/lib/interfaces/common/general.d.ts +186 -0
  45. package/lib/interfaces/common/general.js +28 -0
  46. package/lib/interfaces/common/general.js.map +1 -0
  47. package/lib/interfaces/utils/basic-util.d.ts +22 -0
  48. package/lib/interfaces/utils/basic-util.js +3 -0
  49. package/lib/interfaces/utils/basic-util.js.map +1 -0
  50. package/lib/interfaces/utils/date-util.d.ts +12 -0
  51. package/lib/interfaces/utils/date-util.js +3 -0
  52. package/lib/interfaces/utils/date-util.js.map +1 -0
  53. package/lib/interfaces/utils/format-util.d.ts +7 -0
  54. package/lib/interfaces/utils/format-util.js +3 -0
  55. package/lib/interfaces/utils/format-util.js.map +1 -0
  56. package/lib/locales/en/index.d.ts +19 -0
  57. package/lib/locales/en/index.js +21 -0
  58. package/lib/locales/en/index.js.map +1 -0
  59. package/lib/locales/index.d.ts +0 -0
  60. package/lib/locales/index.js +2 -0
  61. package/lib/locales/index.js.map +1 -0
  62. package/lib/locales/zh-cn/index.d.ts +33 -0
  63. package/lib/locales/zh-cn/index.js +35 -0
  64. package/lib/locales/zh-cn/index.js.map +1 -0
  65. package/lib/utils/accurate.util.d.ts +28 -0
  66. package/lib/utils/accurate.util.js +123 -0
  67. package/lib/utils/accurate.util.js.map +1 -0
  68. package/lib/utils/basic.util.d.ts +83 -0
  69. package/lib/utils/basic.util.js +286 -0
  70. package/lib/utils/basic.util.js.map +1 -0
  71. package/lib/utils/crypto.util.d.ts +65 -0
  72. package/lib/utils/crypto.util.js +151 -0
  73. package/lib/utils/crypto.util.js.map +1 -0
  74. package/lib/utils/date.util.d.ts +52 -0
  75. package/lib/utils/date.util.js +211 -0
  76. package/lib/utils/date.util.js.map +1 -0
  77. package/lib/utils/format.util.d.ts +49 -0
  78. package/lib/utils/format.util.js +98 -0
  79. package/lib/utils/format.util.js.map +1 -0
  80. package/lib/utils/locale.util.d.ts +20 -0
  81. package/lib/utils/locale.util.js +206 -0
  82. package/lib/utils/locale.util.js.map +1 -0
  83. package/lib/utils/number.util.d.ts +21 -0
  84. package/lib/utils/number.util.js +33 -0
  85. package/lib/utils/number.util.js.map +1 -0
  86. package/package.json +102 -0
  87. package/templates/eslints/eggjs.project.js +15 -0
  88. package/templates/eslints/element-ui.project.js +4 -0
  89. package/templates/eslints/recommended.js +26 -0
  90. package/templates/eslints/rules/recommended.js +26 -0
  91. package/templates/eslints/rules/vue.js +12 -0
  92. package/templates/eslints/server.project.js +18 -0
  93. package/templates/eslints/uni-app-v8.project.js +43 -0
  94. package/templates/eslints/uni-app.project.js +45 -0
  95. package/templates/eslints/vue.project.js +39 -0
  96. package/templates/jest/element-ui.project.js +1 -0
  97. package/templates/jest/recommended.js +19 -0
  98. package/templates/jest/vue.project.js +44 -0
  99. package/templates/postcss/recommended.js +4 -0
  100. package/templates/postcss/uni-app.js +11 -0
  101. package/templates/prettiers/recommended.js +26 -0
  102. package/templates/stylelint/recommended.js +42 -0
  103. package/templates/stylelint/rules/recommended.js +22 -0
  104. package/templates/stylelint/uni-app.project.js +11 -0
  105. package/templates/tsconfigs/eggjs.json +31 -0
  106. package/templates/tsconfigs/element-ui.json +3 -0
  107. package/templates/tsconfigs/lib.json +15 -0
  108. package/templates/tsconfigs/quasar.json +25 -0
  109. package/templates/tsconfigs/recommended.json +43 -0
  110. package/templates/tsconfigs/server.json +23 -0
  111. package/templates/tsconfigs/uni-app.json +39 -0
  112. package/templates/tsconfigs/vue.json +45 -0
  113. package/templates/tslints/recommended.json +13 -0
  114. package/tsconfig.json +9 -0
  115. package/types/index.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.util.js","sourceRoot":"","sources":["../../src/utils/number.util.ts"],"names":[],"mappings":";;;AAAA,+DAAuB;AAkBvB,IAAM,UAAU,GAAG;IACjB,eAAe;IACf,WAAW,EAAX,UAAY,KAAsB,EAAE,OAAgC;QAAhC,wBAAA,EAAA,YAAgC;QAClE,IAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACpD,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC;aAC/D,MAAM,CAAC,UAAC,IAAI;YACX,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,IAAI,CAAC,EAAE,CAAC,CAAC;IACd,CAAC;IAED,cAAc;IACd,UAAU,EAAV,UAAW,KAAsB,EAAE,OAAgC;;QAAhC,wBAAA,EAAA,YAAgC;QACjE,UAAU;QACV,IAAM,eAAe,GAAG,OAAO,CAAC,eAAe,KAAK,KAAK,CAAC;QAC1D,IAAM,aAAa,GAAG,MAAA,OAAO,CAAC,aAAa,mCAAI,CAAC,CAAC;QACjD,IAAM,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtD,IAAM,SAAS,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,gBAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;QAEpH,OAAO;YACL,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG;YACpB,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;SACnC,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,kBAAe,UAAU,CAAC"}
package/package.json ADDED
@@ -0,0 +1,102 @@
1
+ {
2
+ "name": "almighty-tool",
3
+ "version": "0.0.1",
4
+ "description": "Tuitui Lib",
5
+ "author": "happy",
6
+ "private": false,
7
+ "license": "MIT",
8
+ "_moduleAliases": {
9
+ "@root": "."
10
+ },
11
+ "scripts": {
12
+ "eslint": "eslint --ext .js,.ts,.vue --ignore-path .eslintignore .",
13
+ "eslint:fix": "yarn eslint --fix",
14
+ "stylelint": "stylelint \"{src,source}/**/*.{css,scss,sass}\" --allow-empty-input",
15
+ "stylelint:fix": "yarn stylelint --fix",
16
+ "lint": "yarn run eslint && yarn run stylelint",
17
+ "lint:fix": "yarn run eslint:fix && yarn run stylelint:fix",
18
+ "tsc": "./node_modules/.bin/tsc -p tsconfig.json",
19
+ "check": "npm run test && npm run eslint",
20
+ "test": "jest --clearCache && jest --runInBand --detectOpenHandles"
21
+ },
22
+ "gitHooks": {
23
+ "pre-commit": "lint-staged"
24
+ },
25
+ "lint-staged": {
26
+ "*.{js,ts,vue}": [
27
+ "eslint --fix"
28
+ ],
29
+ "*.{css,scss}": [
30
+ "stylelint --fix"
31
+ ]
32
+ },
33
+ "typings": "types/index.d.ts",
34
+ "dependencies": {
35
+ "async-validator": "^4.2.5",
36
+ "babel-eslint": "^10.0.1",
37
+ "babel-loader": "^8.2.3",
38
+ "babel-plugin-import": "^1.13.6",
39
+ "cookie": "^0.5.0",
40
+ "core-js": "^3.29.0",
41
+ "dayjs": "^1.11.7",
42
+ "deepmerge": "^4.3.0",
43
+ "ets": "^1.0.3",
44
+ "i18next": "^22.4.10",
45
+ "is-what": "^4.1.8",
46
+ "lodash": "^4.17.21",
47
+ "mockdate": "^3.0.5",
48
+ "module-alias": "^2.2.2",
49
+ "nock": "^13.3.0",
50
+ "nodemon": "^2.0.20",
51
+ "power-assert": "^1.6.1",
52
+ "prettier": "^2.8.4",
53
+ "qs": "^6.11.0",
54
+ "tslib": "^2.4.0",
55
+ "typescript": "~4.5.5",
56
+ "uuid": "^9.0.0",
57
+ "yorkie": "^2.0.0"
58
+ },
59
+ "devDependencies": {
60
+ "@babel/plugin-syntax-typescript": "^7.20.0",
61
+ "@babel/preset-env": "^7.20.2",
62
+ "@babel/preset-typescript": "^7.21.0",
63
+ "@types/debug": "^4.1.8",
64
+ "@types/html5plus": "1.0.2",
65
+ "@types/jest": "29.4.0",
66
+ "@types/lodash": "4.14.191",
67
+ "@types/node": "18.14.2",
68
+ "@types/power-assert": "1.5.8",
69
+ "@types/qs": "6.9.7",
70
+ "@types/uuid": "9.0.1",
71
+ "@types/webpack-env": "1.18.0",
72
+ "@typescript-eslint/eslint-plugin": "5.54.0",
73
+ "@typescript-eslint/parser": "5.54.0",
74
+ "babel-jest": "^29.4.3",
75
+ "eslint": "8.19.0",
76
+ "eslint-config-prettier": "8.5.0",
77
+ "eslint-config-standard": "17.0.0",
78
+ "eslint-friendly-formatter": "4.0.1",
79
+ "eslint-loader": "4.0.2",
80
+ "eslint-plugin-html": "6.2.0",
81
+ "eslint-plugin-import": "2.25.4",
82
+ "eslint-plugin-jest": "26.5.3",
83
+ "eslint-plugin-n": "15.2.4",
84
+ "eslint-plugin-node": "11.1.0",
85
+ "eslint-plugin-nuxt": ">=3.1.0",
86
+ "eslint-plugin-prettier": "4.2.1",
87
+ "eslint-plugin-promise": "6.0.0",
88
+ "eslint-plugin-standard": "5.0.0",
89
+ "eslint-plugin-vue": "9.1.1",
90
+ "eslint-plugin-vue-scoped-css": "2.2.0",
91
+ "jest": "^29.4.3",
92
+ "lint-staged": "^13.1.2",
93
+ "stylelint": "^14.9.1",
94
+ "stylelint-config-rational-order": "^0.1.2",
95
+ "stylelint-config-standard": "^26.0.0",
96
+ "stylelint-config-standard-scss": "^4.0.0",
97
+ "stylelint-order": "^5.0.0",
98
+ "stylelint-scss": "^4.2.0",
99
+ "ts-jest": "^29.0.5",
100
+ "webpack-env": "^0.8.0"
101
+ }
102
+ }
@@ -0,0 +1,15 @@
1
+ module.exports = {
2
+ root: true,
3
+ parserOptions: {
4
+ project: '../tsconfigs/eggjs.json',
5
+ },
6
+ extends: [
7
+ 'eslint-config-egg/typescript',
8
+ 'eslint:recommended',
9
+ 'standard',
10
+ 'plugin:@typescript-eslint/recommended',
11
+ 'plugin:prettier/recommended',
12
+ 'prettier',
13
+ ],
14
+ rules: require('./rules/recommended'),
15
+ };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * tuitui eslint推荐element-ui.project
3
+ */
4
+ module.exports = require('./vue.project');
@@ -0,0 +1,26 @@
1
+ /**
2
+ * tuitui eslint推荐
3
+ */
4
+ module.exports = {
5
+ root: true,
6
+ parserOptions: {
7
+ parser: '@typescript-eslint/parser',
8
+ sourceType: 'module',
9
+ ecmaVersion: 2020,
10
+ ecmaFeatures: {
11
+ legacyDecorators: true,
12
+ },
13
+ },
14
+
15
+ env: {
16
+ node: true,
17
+ browser: true,
18
+ jest: true,
19
+ },
20
+
21
+ extends: ['eslint:recommended', 'standard', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
22
+
23
+ plugins: ['import', 'jest', 'node', 'promise', 'prettier', 'standard', 'html'],
24
+
25
+ rules: require('./rules/recommended'),
26
+ };
@@ -0,0 +1,26 @@
1
+ module.exports = {
2
+ semi: ['error', 'always'],
3
+ 'arrow-parens': ['error', 'always'],
4
+ 'comma-dangle': ['error', 'always-multiline'],
5
+ 'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 1, maxEOF: 1 }],
6
+ 'no-undef': 'off',
7
+ 'no-use-before-define': 'off',
8
+ '@typescript-eslint/interface-name-prefix': 'off',
9
+ '@typescript-eslint/explicit-function-return-type': 'off',
10
+ '@typescript-eslint/no-explicit-any': 'off',
11
+ '@typescript-eslint/no-empty-function': 'off',
12
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
13
+ '@typescript-eslint/no-namespace': 'off',
14
+ '@typescript-eslint/ban-types': 'off',
15
+ 'space-before-function-paren': 'off',
16
+ '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
17
+ '@typescript-eslint/no-this-alias': [
18
+ 'error',
19
+ {
20
+ // Allow `const { props, state } = this`; false by default
21
+ allowDestructuring: true,
22
+ // Allow `const self = this`; `[]` by default
23
+ allowedNames: ['self'],
24
+ },
25
+ ],
26
+ };
@@ -0,0 +1,12 @@
1
+ module.exports = {
2
+ ...require('./recommended'),
3
+ 'vue-scoped-css/no-unused-selector': 'off',
4
+ 'vue-scoped-css/enforce-style-type': 'off',
5
+ 'vue/max-attributes-per-line': 'off',
6
+ 'vue/singleline-html-element-content-newline': 'off',
7
+ 'vue/no-multiple-template-root': 'off',
8
+ 'vue/no-unused-vars': 'off',
9
+ 'vue/html-self-closing': 'off',
10
+ 'vue/no-template-key': 'off',
11
+ 'vue/no-v-for-template-key': 'off',
12
+ };
@@ -0,0 +1,18 @@
1
+ module.exports = {
2
+ parser: '@typescript-eslint/parser',
3
+ parserOptions: {
4
+ project: 'tsconfig.json',
5
+ sourceType: 'module',
6
+ },
7
+ plugins: ['@typescript-eslint/eslint-plugin'],
8
+ extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
9
+ root: true,
10
+ env: {
11
+ node: true,
12
+ jest: true,
13
+ },
14
+ ignorePatterns: ['.eslintrc.js'],
15
+ rules: {
16
+ ...require('./rules/recommended'),
17
+ },
18
+ };
@@ -0,0 +1,43 @@
1
+ /**
2
+ * tuitui eslint推荐for uni-app
3
+ */
4
+ module.exports = {
5
+ root: true,
6
+ parserOptions: {
7
+ parser: '@typescript-eslint/parser',
8
+ sourceType: 'module',
9
+ ecmaVersion: 2020,
10
+ ecmaFeatures: {
11
+ legacyDecorators: true,
12
+ },
13
+ },
14
+
15
+ globals: {
16
+ uni: true,
17
+ },
18
+
19
+ env: {
20
+ node: true,
21
+ browser: true,
22
+ jest: true,
23
+ },
24
+
25
+ plugins: ['import', 'jest', 'node', 'prettier', 'promise', 'standard', 'vue', 'html'],
26
+
27
+ extends: [
28
+ 'eslint:recommended',
29
+ 'standard',
30
+ 'plugin:vue/essential',
31
+ '@vue/standard',
32
+ '@vue/typescript',
33
+ 'plugin:@typescript-eslint/recommended',
34
+ 'plugin:vue/strongly-recommended',
35
+ 'plugin:vue-scoped-css/recommended',
36
+ 'plugin:prettier/recommended',
37
+ 'prettier',
38
+ ],
39
+
40
+ rules: {
41
+ ...require('./rules/vue'),
42
+ },
43
+ };
@@ -0,0 +1,45 @@
1
+ /**
2
+ * tuitui eslint推荐for uni-app
3
+ */
4
+ module.exports = {
5
+ root: true,
6
+ parserOptions: {
7
+ parser: '@typescript-eslint/parser',
8
+ sourceType: 'module',
9
+ ecmaVersion: 2020,
10
+ ecmaFeatures: {
11
+ legacyDecorators: true,
12
+ },
13
+ },
14
+
15
+ globals: {
16
+ uni: true,
17
+ },
18
+
19
+ env: {
20
+ node: true,
21
+ browser: true,
22
+ jest: true,
23
+ },
24
+
25
+ plugins: ['import', 'jest', 'node', 'prettier', 'promise', 'standard', 'vue', 'html'],
26
+
27
+ extends: [
28
+ 'eslint:recommended',
29
+ 'standard',
30
+ 'plugin:vue/essential',
31
+ '@vue/standard',
32
+ '@vue/typescript',
33
+ 'plugin:@typescript-eslint/recommended',
34
+ 'plugin:vue/strongly-recommended',
35
+ 'plugin:vue-scoped-css/recommended',
36
+ 'plugin:prettier/recommended',
37
+ 'prettier',
38
+ 'prettier/vue',
39
+ 'prettier/standard',
40
+ ],
41
+
42
+ rules: {
43
+ ...require('./rules/vue'),
44
+ },
45
+ };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * tuitui eslint推荐vue.project
3
+ */
4
+ module.exports = {
5
+ root: true,
6
+ parserOptions: {
7
+ parser: '@typescript-eslint/parser',
8
+ sourceType: 'module',
9
+ ecmaVersion: 2020,
10
+ ecmaFeatures: {
11
+ legacyDecorators: true,
12
+ },
13
+ },
14
+
15
+ env: {
16
+ node: true,
17
+ browser: true,
18
+ jest: true,
19
+ },
20
+
21
+ plugins: ['import', 'jest', 'node', 'prettier', 'promise', 'standard', 'vue', 'html'],
22
+
23
+ extends: [
24
+ 'eslint:recommended',
25
+ 'standard',
26
+ 'plugin:vue/essential',
27
+ '@vue/standard',
28
+ '@vue/typescript',
29
+ 'plugin:@typescript-eslint/recommended',
30
+ 'plugin:vue/strongly-recommended',
31
+ 'plugin:vue-scoped-css/recommended',
32
+ 'plugin:prettier/recommended',
33
+ 'prettier',
34
+ ],
35
+
36
+ rules: {
37
+ ...require('./rules/vue'),
38
+ },
39
+ };
@@ -0,0 +1 @@
1
+ module.exports = require('./vue.project');
@@ -0,0 +1,19 @@
1
+ module.exports = {
2
+ testEnvironment: 'node',
3
+ moduleNameMapper: {
4
+ '^@/(.*)$': '<rootDir>/src/$1',
5
+ // '^vue$': 'vue/dist/vue.common.js',
6
+ },
7
+ // moduleFileExtensions: ['ts', 'js', 'vue', 'json'],
8
+ moduleFileExtensions: ['ts', 'js', 'json'],
9
+ transform: {
10
+ '^.+\\.ts$': 'ts-jest',
11
+ '^.+\\.js$': 'babel-jest',
12
+ // '.*\\.(vue)$': 'vue-jest',
13
+ },
14
+ collectCoverage: true,
15
+ collectCoverageFrom: [
16
+ // '<rootDir>/components/**/*.vue',
17
+ // '<rootDir>/pages/**/*.vue',
18
+ ],
19
+ };
@@ -0,0 +1,44 @@
1
+ module.exports = {
2
+ globals: {
3
+ 'ts-jest': {
4
+ babelConfig: true,
5
+ },
6
+ },
7
+
8
+ moduleFileExtensions: [
9
+ 'ts',
10
+ 'tsx',
11
+ 'js',
12
+ 'jsx',
13
+ 'json',
14
+ // tell Jest to handle *.vue files
15
+ 'vue',
16
+ ],
17
+
18
+ transform: {
19
+ // process *.vue files with vue-jest
20
+ '^.+\\.vue$': require.resolve('vue-jest'),
21
+ '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': require.resolve('jest-transform-stub'),
22
+ '^.+\\.jsx?$': require.resolve('babel-jest'),
23
+ '^.+\\.tsx?$': require.resolve('ts-jest'),
24
+ },
25
+
26
+ transformIgnorePatterns: ['/node_modules/(?!(tuitui-ele|almighty-tool)/)'],
27
+
28
+ // support the same @ -> src alias mapping in source code
29
+ moduleNameMapper: {
30
+ '^@/(.*)$': '<rootDir>/src/$1',
31
+ },
32
+
33
+ testEnvironment: 'jest-environment-jsdom-fifteen',
34
+
35
+ // serializer for snapshots
36
+ snapshotSerializers: ['jest-serializer-vue'],
37
+
38
+ testMatch: ['**/tests/unit/**/*.spec.[jt]s?(x)', '**/__tests__/*.[jt]s?(x)'],
39
+
40
+ // https://github.com/facebook/jest/issues/6766
41
+ testURL: 'http://localhost/',
42
+
43
+ watchPlugins: [require.resolve('jest-watch-typeahead/filename'), require.resolve('jest-watch-typeahead/testname')],
44
+ };
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ parser: require('postcss-comment'),
3
+ plugins: [require('postcss-import'), require('autoprefixer')],
4
+ };
@@ -0,0 +1,11 @@
1
+ /* eslint-disable @typescript-eslint/no-var-requires */
2
+ module.exports = {
3
+ parser: require('postcss-comment'),
4
+ plugins: [
5
+ require('postcss-import'),
6
+ require('autoprefixer')({
7
+ remove: process.env.UNI_PLATFORM !== 'h5',
8
+ }),
9
+ require('@dcloudio/vue-cli-plugin-uni/packages/postcss'),
10
+ ],
11
+ };
@@ -0,0 +1,26 @@
1
+ // 参考资料:
2
+ //
3
+ // - <https://juejin.im/post/5a7d70496fb9a063317c47f1>
4
+ //
5
+ module.exports = {
6
+ /** tab的宽度 */
7
+ tabWidth: 2,
8
+ /** 使用tab进行缩进 */
9
+ useTabs: false,
10
+ /** 单行宽度 */
11
+ printWidth: 130,
12
+ /** 将多行JSX元素的 > 放在最后一行的末尾,而不是单独放在下一行(不适用于自闭元素) */
13
+ jsxBracketSameLine: false,
14
+ /** 尾随逗号 */
15
+ trailingComma: 'all',
16
+ /** 在语句的末尾打印分号 */
17
+ semi: true,
18
+ /** 使用单引号 */
19
+ singleQuote: true,
20
+ /** 方法名与括号间是否有空格 */
21
+ spaceBeforeFunctionParen: false,
22
+ /** 结尾符问题统一 */
23
+ endOfLine: 'auto',
24
+ /** 箭头函数的参数括起来 */
25
+ arrowParens: 'always',
26
+ };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * package.json
3
+ "eslint": "8.19.0",
4
+ "eslint-config-prettier": "8.5.0",
5
+ "eslint-config-standard": "17.0.0",
6
+ "eslint-friendly-formatter": "4.0.1",
7
+ "eslint-loader": "4.0.2",
8
+ "eslint-plugin-html": "6.2.0",
9
+ "eslint-plugin-import": "2.25.4",
10
+ "eslint-plugin-jest": "26.5.3",
11
+ "eslint-plugin-n": "15.2.4",
12
+ "eslint-plugin-node": "11.1.0",
13
+ "eslint-plugin-prettier": "4.2.1",
14
+ "eslint-plugin-promise": "6.0.0",
15
+ "eslint-plugin-standard": "5.0.0",
16
+ "eslint-plugin-vue": "9.1.1",
17
+ "eslint-plugin-vue-scoped-css": "2.2.0",
18
+ "node-sass": "4.14.1",
19
+ "postcss": "8.4.14",
20
+ "postcss-comment": "2.0.0",
21
+ "postcss-css-variables": "0.17.0",
22
+ "postcss-html": "1.4.1",
23
+ "postcss-scss": "4.0.4",
24
+ "sass-loader": "10.0.4",
25
+ "stylelint": "14.9.1",
26
+ "stylelint-config-rational-order": "0.1.2",
27
+ "stylelint-config-standard": "26.0.0",
28
+ "stylelint-config-standard-scss": "4.0.0",
29
+ "stylelint-order": "5.0.0",
30
+ "stylelint-scss": "4.2.0",
31
+ */
32
+ module.exports = {
33
+ extends: ['stylelint-config-standard', 'stylelint-config-standard-scss', 'stylelint-config-rational-order'],
34
+ plugins: ['stylelint-scss', 'stylelint-order'],
35
+ overrides: [
36
+ {
37
+ files: ['**/*.{vue,html}'],
38
+ customSyntax: 'postcss-html',
39
+ },
40
+ ],
41
+ rules: require('./rules/recommended'),
42
+ };
@@ -0,0 +1,22 @@
1
+ module.exports = {
2
+ 'unit-no-unknown': null,
3
+ 'selector-type-no-unknown': null,
4
+ 'font-family-no-missing-generic-family-keyword': null,
5
+ 'no-descending-specificity': null,
6
+ 'scss/at-import-partial-extension': null,
7
+ 'function-url-quotes': null,
8
+ 'selector-class-pattern': null,
9
+ 'color-function-notation': 'legacy',
10
+ 'selector-pseudo-element-no-unknown': null,
11
+ 'alpha-value-notation': null,
12
+ 'scss/dollar-variable-pattern': null,
13
+ 'no-invalid-position-at-import-rule': null,
14
+ 'selector-pseudo-class-no-unknown': null,
15
+ 'scss/no-global-function-names': null,
16
+ 'scss/operator-no-unspaced': null,
17
+ 'property-no-unknown': null,
18
+ 'selector-pseudo-element-colon-notation': null,
19
+ 'at-rule-no-unknown': null,
20
+ 'property-case': null,
21
+ 'max-line-length': null,
22
+ };
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ extends: ['stylelint-config-standard', 'stylelint-config-standard-scss'],
3
+ plugins: ['stylelint-scss'],
4
+ overrides: [
5
+ {
6
+ files: ['**/*.{vue,html}'],
7
+ customSyntax: 'postcss-html',
8
+ },
9
+ ],
10
+ rules: require('./rules/recommended'),
11
+ };
@@ -0,0 +1,31 @@
1
+ {
2
+ "compileOnSave": true,
3
+ "compilerOptions": {
4
+ "target": "es2017",
5
+ "module": "commonjs",
6
+ "strict": true,
7
+ "noImplicitAny": false,
8
+ "resolveJsonModule": true,
9
+ "experimentalDecorators": true,
10
+ "emitDecoratorMetadata": true,
11
+ "charset": "utf8",
12
+ "allowJs": false,
13
+ "pretty": true,
14
+ "noEmitOnError": false,
15
+ "noUnusedLocals": true,
16
+ "noUnusedParameters": true,
17
+ "allowUnreachableCode": false,
18
+ "allowUnusedLabels": false,
19
+ "strictPropertyInitialization": false,
20
+ "noFallthroughCasesInSwitch": true,
21
+ "skipLibCheck": true,
22
+ "skipDefaultLibCheck": true,
23
+ "inlineSourceMap": true,
24
+ "importHelpers": true
25
+ },
26
+ "exclude": [
27
+ "app/public",
28
+ "app/views",
29
+ "node_modules*"
30
+ ]
31
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "./vue.json"
3
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "extends": "./recommended.json",
3
+ "compilerOptions": {
4
+ "target": "ES5",
5
+ "module": "commonjs",
6
+ "outDir": "./lib",
7
+ "baseUrl": ".",
8
+ "strictNullChecks": true,
9
+ "declaration": true,
10
+ "noImplicitAny": true,
11
+ "sourceMap": true
12
+ },
13
+ "include": ["src"],
14
+ "exclude": ["node_modules", "test"]
15
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": true,
4
+ "esModuleInterop": true,
5
+ "module": "esnext",
6
+ "moduleResolution": "node",
7
+ "noEmit": true,
8
+ "resolveJsonModule": true,
9
+ "experimentalDecorators": true,
10
+ "sourceMap": true,
11
+ "strict": true,
12
+ "target": "es6",
13
+ "paths": {
14
+ "src/*": ["src/*"],
15
+ "app/*": ["*"],
16
+ "components/*": ["src/components/*"],
17
+ "layouts/*": ["src/layouts/*"],
18
+ "pages/*": ["src/pages/*"],
19
+ "assets/*": ["src/assets/*"],
20
+ "boot/*": ["src/boot/*"]
21
+ },
22
+ "types": ["quasar"]
23
+ },
24
+ "exclude": ["/dist", ".quasar", "node_modules"]
25
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2015",
4
+ "module": "esnext",
5
+ "strict": true,
6
+ "jsx": "preserve",
7
+ "noImplicitAny": false,
8
+ "importHelpers": true,
9
+ "resolveJsonModule": true,
10
+ "moduleResolution": "node",
11
+ "experimentalDecorators": true,
12
+ "esModuleInterop": true,
13
+ "allowSyntheticDefaultImports": true,
14
+ "sourceMap": true,
15
+ "types": [
16
+ "node",
17
+ "webpack-env",
18
+ "jest"
19
+ ],
20
+ "paths": {
21
+ "@/*": [
22
+ "./*"
23
+ ]
24
+ },
25
+ "lib": [
26
+ "esnext",
27
+ "dom",
28
+ "dom.iterable",
29
+ "scripthost"
30
+ ]
31
+ },
32
+ "include": [
33
+ "src/**/*.ts",
34
+ "src/**/*.tsx",
35
+ "src/**/*.vue",
36
+ "tests/**/*.ts",
37
+ "tests/**/*.tsx",
38
+ "src/*.ts"
39
+ ],
40
+ "exclude": [
41
+ "node_modules"
42
+ ]
43
+ }