almighty-tool 0.0.114 → 0.0.115

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 (55) hide show
  1. package/.babelrc +17 -17
  2. package/.editorconfig +13 -13
  3. package/.eslintignore +7 -7
  4. package/.eslintrc.js +5 -5
  5. package/.nvmrc +1 -1
  6. package/.opencode/agents/code-reviewer.md +57 -57
  7. package/.opencode/agents/docs-specialist.md +49 -49
  8. package/.opencode/agents/test-runner.md +45 -45
  9. package/.opencode/commands/review.md +25 -25
  10. package/.opencode/commands/test.md +27 -27
  11. package/.opencode/skills/cryptography-dev.md +108 -108
  12. package/.opencode/skills/typescript-library-dev.md +94 -94
  13. package/.prettierrc.js +1 -1
  14. package/.yarnrc +11 -11
  15. package/AGENTS.md +69 -69
  16. package/CHANGELOG.md +7 -7
  17. package/README.md +11 -11
  18. package/bun.lock +2836 -2836
  19. package/bunfig.toml +7 -7
  20. package/jest.config.js +1 -1
  21. package/lib/utils/basic.util.d.ts +5 -0
  22. package/lib/utils/basic.util.js +64 -0
  23. package/lib/utils/basic.util.js.map +1 -1
  24. package/opencode.json +60 -60
  25. package/package.json +122 -122
  26. package/scripts/code.util.ts +135 -135
  27. package/templates/eslints/eggjs.project.js +15 -15
  28. package/templates/eslints/element-ui.project.js +4 -4
  29. package/templates/eslints/recommended.js +26 -26
  30. package/templates/eslints/rules/recommended.js +26 -26
  31. package/templates/eslints/rules/vue.js +12 -12
  32. package/templates/eslints/server.project.js +18 -18
  33. package/templates/eslints/uni-app-v8.project.js +43 -43
  34. package/templates/eslints/uni-app.project.js +45 -45
  35. package/templates/eslints/vue.project.js +39 -39
  36. package/templates/jest/element-ui.project.js +1 -1
  37. package/templates/jest/recommended.js +22 -22
  38. package/templates/jest/vue.project.js +44 -44
  39. package/templates/postcss/recommended.js +4 -4
  40. package/templates/postcss/uni-app.js +11 -11
  41. package/templates/prettiers/recommended.js +26 -26
  42. package/templates/stylelint/recommended.js +42 -42
  43. package/templates/stylelint/rules/recommended.js +22 -22
  44. package/templates/stylelint/uni-app.project.js +11 -11
  45. package/templates/tsconfigs/eggjs.json +31 -31
  46. package/templates/tsconfigs/element-ui.json +3 -3
  47. package/templates/tsconfigs/lib.json +15 -15
  48. package/templates/tsconfigs/quasar.json +25 -25
  49. package/templates/tsconfigs/recommended.json +23 -23
  50. package/templates/tsconfigs/server.json +23 -23
  51. package/templates/tsconfigs/uni-app.json +39 -39
  52. package/templates/tsconfigs/vue.json +45 -45
  53. package/templates/tslints/recommended.json +13 -13
  54. package/test-duration.js +33 -33
  55. package/tsconfig.json +9 -9
@@ -1,135 +1,135 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- import mustache from 'mustache';
4
- import * as inflection from 'inflection';
5
- import yargs from 'yargs';
6
-
7
- /** 生成代码选项 */
8
- export interface CodeUtilGenerateOptions {
9
- /** 模板变量 */
10
- data: any;
11
- /** 模板文件路径 */
12
- templatePath: string;
13
- /** 目标文件路径 */
14
- targetPath: string;
15
- }
16
-
17
- /** 获取生成数据选项 */
18
- export interface CodeUtilGetGenerateDataOptions {
19
- /** 模型名称 */
20
- modelName: string;
21
- /** 模块路径 */
22
- modulePath: string;
23
- }
24
-
25
- export interface CodeUtilGetGenerateData {
26
- /* 小驼峰 eg. authCollection */
27
- FirstLowerModelName: string;
28
- /* 小驼峰复数 eg. authCollections */
29
- FirstLowerModelsName: string;
30
- /* 模块路径 eg. service-forum/src/modules/auth */
31
- ModulePath: string;
32
- /* 模块名称 eg. auth */
33
- ModuleName: string;
34
- /* 大驼峰 eg. AuthCollection */
35
- ModelName: string;
36
- /* 大驼峰复数 eg. AuthCollections */
37
- ModelsName: string;
38
- /* 连字符 eg. auth-collection */
39
- KebabCaseModelName: string;
40
- /* 连字符复数 eg. auth-collections */
41
- KebabCaseModelsName: string;
42
- /* 下划线 eg. auth_collection */
43
- UnderscoreModelName: string;
44
- /* 下划线复数 eg. auth_collections */
45
- UnderscoreModelsName: string;
46
- /** 其他值 */
47
- [key: string]: string;
48
- }
49
-
50
- const codeUtil = {
51
- /**
52
- * 通过模板生成代码
53
- * @param options 生成选项
54
- */
55
- generate: (options: CodeUtilGenerateOptions) => {
56
- const { data: variables, templatePath, targetPath } = options;
57
-
58
- // 检查模板文件是否存在
59
- if (!fs.existsSync(templatePath)) {
60
- throw new Error(`Template file not found: ${templatePath}`);
61
- }
62
-
63
- // 确保目标目录存在
64
- const targetDir = path.dirname(targetPath);
65
- if (!fs.existsSync(targetDir)) {
66
- fs.mkdirSync(targetDir, { recursive: true });
67
- }
68
-
69
- // 读取模板内容
70
- const template = fs.readFileSync(templatePath, 'utf-8');
71
-
72
- // 使用变量渲染模板
73
- const result = mustache
74
- .render(template, variables)
75
- .replace(///g, '/')
76
- .replace(/{/g, '{')
77
- .replace(/}/g, '}');
78
-
79
- // 写入目标文件
80
- fs.writeFileSync(targetPath, result, 'utf-8');
81
- },
82
-
83
- /** 获取布尔值 */
84
- getBooleanValue: (value: string | boolean) => {
85
- return ['true', true].includes(value);
86
- },
87
-
88
- /**
89
- * 获取生成数据
90
- * @param options 获取生成数据选项
91
- */
92
- getGenerateData: (options: CodeUtilGetGenerateDataOptions) => {
93
- if (!options.modelName) {
94
- throw new Error('modelName is required');
95
- }
96
-
97
- if (!options.modulePath) {
98
- throw new Error('modulePath is required');
99
- }
100
-
101
- const ModulePath = options.modulePath;
102
- const ModulePathParts = ModulePath.split('/');
103
- const ModuleName = ModulePathParts[ModulePathParts.length - 1];
104
- const ModelName = inflection.camelize(options.modelName);
105
- const ModelsName = inflection.pluralize(ModelName);
106
- const UnderscoreModelName = inflection.underscore(ModelName);
107
- const UnderscoreModelsName = inflection.underscore(ModelsName);
108
- const KebabCaseModelName = inflection.dasherize(UnderscoreModelName);
109
- const KebabCaseModelsName = inflection.dasherize(UnderscoreModelsName);
110
- const FirstLowerModelName = inflection.camelize(ModelName, true);
111
- const FirstLowerModelsName = inflection.camelize(ModelsName, true);
112
-
113
- const data: CodeUtilGetGenerateData = {
114
- FirstLowerModelName,
115
- FirstLowerModelsName,
116
- ModulePath,
117
- ModuleName,
118
- ModelName,
119
- ModelsName,
120
- KebabCaseModelName,
121
- KebabCaseModelsName,
122
- UnderscoreModelName,
123
- UnderscoreModelsName,
124
- };
125
-
126
- return data;
127
- },
128
-
129
- /** 获取命令行参数 */
130
- getArgv: () => {
131
- return yargs(process.argv).argv as Record<string, any>;
132
- },
133
- };
134
-
135
- export default codeUtil;
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import mustache from 'mustache';
4
+ import * as inflection from 'inflection';
5
+ import yargs from 'yargs';
6
+
7
+ /** 生成代码选项 */
8
+ export interface CodeUtilGenerateOptions {
9
+ /** 模板变量 */
10
+ data: any;
11
+ /** 模板文件路径 */
12
+ templatePath: string;
13
+ /** 目标文件路径 */
14
+ targetPath: string;
15
+ }
16
+
17
+ /** 获取生成数据选项 */
18
+ export interface CodeUtilGetGenerateDataOptions {
19
+ /** 模型名称 */
20
+ modelName: string;
21
+ /** 模块路径 */
22
+ modulePath: string;
23
+ }
24
+
25
+ export interface CodeUtilGetGenerateData {
26
+ /* 小驼峰 eg. authCollection */
27
+ FirstLowerModelName: string;
28
+ /* 小驼峰复数 eg. authCollections */
29
+ FirstLowerModelsName: string;
30
+ /* 模块路径 eg. service-forum/src/modules/auth */
31
+ ModulePath: string;
32
+ /* 模块名称 eg. auth */
33
+ ModuleName: string;
34
+ /* 大驼峰 eg. AuthCollection */
35
+ ModelName: string;
36
+ /* 大驼峰复数 eg. AuthCollections */
37
+ ModelsName: string;
38
+ /* 连字符 eg. auth-collection */
39
+ KebabCaseModelName: string;
40
+ /* 连字符复数 eg. auth-collections */
41
+ KebabCaseModelsName: string;
42
+ /* 下划线 eg. auth_collection */
43
+ UnderscoreModelName: string;
44
+ /* 下划线复数 eg. auth_collections */
45
+ UnderscoreModelsName: string;
46
+ /** 其他值 */
47
+ [key: string]: string;
48
+ }
49
+
50
+ const codeUtil = {
51
+ /**
52
+ * 通过模板生成代码
53
+ * @param options 生成选项
54
+ */
55
+ generate: (options: CodeUtilGenerateOptions) => {
56
+ const { data: variables, templatePath, targetPath } = options;
57
+
58
+ // 检查模板文件是否存在
59
+ if (!fs.existsSync(templatePath)) {
60
+ throw new Error(`Template file not found: ${templatePath}`);
61
+ }
62
+
63
+ // 确保目标目录存在
64
+ const targetDir = path.dirname(targetPath);
65
+ if (!fs.existsSync(targetDir)) {
66
+ fs.mkdirSync(targetDir, { recursive: true });
67
+ }
68
+
69
+ // 读取模板内容
70
+ const template = fs.readFileSync(templatePath, 'utf-8');
71
+
72
+ // 使用变量渲染模板
73
+ const result = mustache
74
+ .render(template, variables)
75
+ .replace(/&#x2F;/g, '/')
76
+ .replace(/&lbrace;/g, '{')
77
+ .replace(/&rbrace;/g, '}');
78
+
79
+ // 写入目标文件
80
+ fs.writeFileSync(targetPath, result, 'utf-8');
81
+ },
82
+
83
+ /** 获取布尔值 */
84
+ getBooleanValue: (value: string | boolean) => {
85
+ return ['true', true].includes(value);
86
+ },
87
+
88
+ /**
89
+ * 获取生成数据
90
+ * @param options 获取生成数据选项
91
+ */
92
+ getGenerateData: (options: CodeUtilGetGenerateDataOptions) => {
93
+ if (!options.modelName) {
94
+ throw new Error('modelName is required');
95
+ }
96
+
97
+ if (!options.modulePath) {
98
+ throw new Error('modulePath is required');
99
+ }
100
+
101
+ const ModulePath = options.modulePath;
102
+ const ModulePathParts = ModulePath.split('/');
103
+ const ModuleName = ModulePathParts[ModulePathParts.length - 1];
104
+ const ModelName = inflection.camelize(options.modelName);
105
+ const ModelsName = inflection.pluralize(ModelName);
106
+ const UnderscoreModelName = inflection.underscore(ModelName);
107
+ const UnderscoreModelsName = inflection.underscore(ModelsName);
108
+ const KebabCaseModelName = inflection.dasherize(UnderscoreModelName);
109
+ const KebabCaseModelsName = inflection.dasherize(UnderscoreModelsName);
110
+ const FirstLowerModelName = inflection.camelize(ModelName, true);
111
+ const FirstLowerModelsName = inflection.camelize(ModelsName, true);
112
+
113
+ const data: CodeUtilGetGenerateData = {
114
+ FirstLowerModelName,
115
+ FirstLowerModelsName,
116
+ ModulePath,
117
+ ModuleName,
118
+ ModelName,
119
+ ModelsName,
120
+ KebabCaseModelName,
121
+ KebabCaseModelsName,
122
+ UnderscoreModelName,
123
+ UnderscoreModelsName,
124
+ };
125
+
126
+ return data;
127
+ },
128
+
129
+ /** 获取命令行参数 */
130
+ getArgv: () => {
131
+ return yargs(process.argv).argv as Record<string, any>;
132
+ },
133
+ };
134
+
135
+ export default codeUtil;
@@ -1,15 +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
- };
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
+ };
@@ -1,4 +1,4 @@
1
- /**
2
- * almighty eslint推荐element-ui.project
3
- */
4
- module.exports = require('./vue.project');
1
+ /**
2
+ * almighty eslint推荐element-ui.project
3
+ */
4
+ module.exports = require('./vue.project');
@@ -1,26 +1,26 @@
1
- /**
2
- * almighty 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
- };
1
+ /**
2
+ * almighty 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
+ };
@@ -1,26 +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
- };
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
+ };
@@ -1,12 +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
- };
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
+ };
@@ -1,18 +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
- };
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
+ };
@@ -1,43 +1,43 @@
1
- /**
2
- * almighty 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
- };
1
+ /**
2
+ * almighty 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
+ };
@@ -1,45 +1,45 @@
1
- /**
2
- * almighty 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
- };
1
+ /**
2
+ * almighty 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
+ };