-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.js
More file actions
106 lines (104 loc) · 1.96 KB
/
test.js
File metadata and controls
106 lines (104 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
const path = require('path');
const scan = require('./index');
// 扫描配置
const config = {
resultDir: 'scan-results',
sources: [
{
appName: 'project-a',
baseDir: path.join(__dirname, 'resources/project-a'),
codeDir: 'src',
buildDir: '',
aliasConfig: {
"@/*": ["./src/*"]
}
},
{
appName: 'project-b',
baseDir: path.join(__dirname, 'resources/project-b'),
codeDir: 'src',
buildDir: '',
aliasConfig: {
"@/*": ["./src/*"]
}
},
{
appName: 'project-c',
baseDir: path.join(__dirname, 'resources/project-c'),
codeDir: 'src',
buildDir: '',
aliasConfig: {
"@src/*": ["./src/*"]
}
},
],
plugins: [
{
name: 'eslint-check-plugin',
config: {}
},
{
name: 'stylelint-check-plugin',
config: {}
},
{
name: 'count-check-plugin',
config: {}
},
{
name: 'redundancy-check-plugin',
config: {}
},
{
name: 'git-check-plugin',
config: {}
},
{
name: 'config-check-plugin',
config: {
npmrc: {
registryDomain: 'https://npmjs.iceman.cn'
}
}
},
{
name: 'package-check-plugin',
config: {
privatePackagePrefix: ['@iceman'],
riskThreshold: {
isCheck: false
}
}
},
{
name: 'dependency-check-plugin',
config: {
blackImport: [{
name: 'lodash',
items: ['cloneDeep']
}]
}
},
{
name: 'build-check-plugin',
config: {}
},
{
name: 'quality-analysis-plugin',
config: {}
},
{
name: 'custom-plugin',
config: {
countFileType: 'js'
},
customPlugin: './custom-plugin.js'
}
]
};
// 执行扫描
scan(config).then((result) => {
// console.log('scan result:', result);
}).catch((error) => {
console.error('scan failed:', error);
});