devbonzai 2.2.21 → 2.2.201
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.
package/package.json
CHANGED
|
@@ -25,10 +25,24 @@ module.exports = async function scanCodeQuality(req, res) {
|
|
|
25
25
|
const ignorePatterns = getIgnorePatterns();
|
|
26
26
|
const issues = [];
|
|
27
27
|
|
|
28
|
+
// Common build/output directories to always ignore
|
|
29
|
+
const defaultIgnoreGlobs = [
|
|
30
|
+
'**/node_modules/**',
|
|
31
|
+
'**/dist/**',
|
|
32
|
+
'**/build/**',
|
|
33
|
+
'**/static/**',
|
|
34
|
+
'**/out/**',
|
|
35
|
+
'**/.next/**',
|
|
36
|
+
'**/*.min.js',
|
|
37
|
+
'**/*.bundle.js',
|
|
38
|
+
'**/*.chunk.js'
|
|
39
|
+
];
|
|
40
|
+
|
|
28
41
|
// Get all files (needed for multiple checks)
|
|
29
42
|
const allFiles = glob.sync('**/*.{js,ts,jsx,tsx,py,java,go}', {
|
|
30
43
|
cwd: projectPath,
|
|
31
|
-
nodir: true
|
|
44
|
+
nodir: true,
|
|
45
|
+
ignore: defaultIgnoreGlobs
|
|
32
46
|
});
|
|
33
47
|
|
|
34
48
|
const files = allFiles.filter(file => !shouldIgnore(file, ignorePatterns));
|
|
@@ -54,7 +68,8 @@ module.exports = async function scanCodeQuality(req, res) {
|
|
|
54
68
|
// 2. Check folder sizes
|
|
55
69
|
if (willEnforceFolders) {
|
|
56
70
|
const allFolders = glob.sync('**/', {
|
|
57
|
-
cwd: projectPath
|
|
71
|
+
cwd: projectPath,
|
|
72
|
+
ignore: defaultIgnoreGlobs
|
|
58
73
|
});
|
|
59
74
|
|
|
60
75
|
const folders = allFolders.filter(folder => !shouldIgnore(folder, ignorePatterns));
|
|
@@ -96,8 +111,7 @@ module.exports = async function scanCodeQuality(req, res) {
|
|
|
96
111
|
ecmaFeatures: { jsx: true }
|
|
97
112
|
},
|
|
98
113
|
rules: {
|
|
99
|
-
'no-unused-vars': willFlagDeadCode ? 'error' : 'off'
|
|
100
|
-
'@typescript-eslint/no-unused-vars': willFlagDeadCode ? 'error' : 'off'
|
|
114
|
+
'no-unused-vars': willFlagDeadCode ? 'error' : 'off'
|
|
101
115
|
}
|
|
102
116
|
}
|
|
103
117
|
});
|
|
@@ -109,7 +123,7 @@ module.exports = async function scanCodeQuality(req, res) {
|
|
|
109
123
|
const relativePath = path.relative(projectPath, result.filePath);
|
|
110
124
|
|
|
111
125
|
result.messages.forEach(msg => {
|
|
112
|
-
if (msg.ruleId === 'no-unused-vars'
|
|
126
|
+
if (msg.ruleId === 'no-unused-vars') {
|
|
113
127
|
issues.push({
|
|
114
128
|
type: 'unused_variable',
|
|
115
129
|
file: relativePath,
|