@kosuke-ai/cli 0.0.11 → 0.0.12
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/dist/kosuke/commands/lint.d.ts +9 -4
- package/dist/kosuke/commands/lint.d.ts.map +1 -1
- package/dist/kosuke/commands/lint.js +181 -68
- package/dist/kosuke/commands/lint.js.map +1 -1
- package/dist/lib.d.ts +1 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +1 -1
- package/dist/lib.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Lint command -
|
|
2
|
+
* Lint command - Comprehensive code quality validation and fixing
|
|
3
3
|
*
|
|
4
|
-
* Strategy: Run
|
|
4
|
+
* Strategy: Run all validation steps (format, lint, typecheck, test, knip),
|
|
5
|
+
* give errors to Claude, let it fix them
|
|
5
6
|
*/
|
|
6
7
|
import type { LintOptions } from '../types.js';
|
|
7
8
|
/**
|
|
8
|
-
* Run Claude
|
|
9
|
+
* Run Claude to fix code quality errors
|
|
9
10
|
* Exported so other commands can use it
|
|
10
11
|
*/
|
|
12
|
+
export declare function fixCodeQualityErrors(stepName: string, errors: string): Promise<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* Legacy export for backward compatibility
|
|
15
|
+
*/
|
|
11
16
|
export declare function fixLintErrors(lintErrors: string): Promise<boolean>;
|
|
12
17
|
/**
|
|
13
|
-
* Main lint command
|
|
18
|
+
* Main lint command (now runs comprehensive validation)
|
|
14
19
|
*/
|
|
15
20
|
export declare function lintCommand(options?: LintOptions): Promise<void>;
|
|
16
21
|
//# sourceMappingURL=lint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../kosuke/commands/lint.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../kosuke/commands/lint.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA2F/C;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAiD7F;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAExE;AA6GD;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6D1E"}
|
|
@@ -1,36 +1,98 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Lint command -
|
|
2
|
+
* Lint command - Comprehensive code quality validation and fixing
|
|
3
3
|
*
|
|
4
|
-
* Strategy: Run
|
|
4
|
+
* Strategy: Run all validation steps (format, lint, typecheck, test, knip),
|
|
5
|
+
* give errors to Claude, let it fix them
|
|
5
6
|
*/
|
|
6
|
-
import { runLint } from '../utils/validator.js';
|
|
7
|
+
import { runLint, runFormat, runTypecheck } from '../utils/validator.js';
|
|
7
8
|
import { runWithPR } from '../utils/pr-orchestrator.js';
|
|
8
9
|
import { runAgent } from '../utils/claude-agent.js';
|
|
10
|
+
import { execSync } from 'child_process';
|
|
9
11
|
/**
|
|
10
|
-
* Run
|
|
12
|
+
* Run tests using package.json test script
|
|
13
|
+
*/
|
|
14
|
+
async function runTests() {
|
|
15
|
+
const { readPackageJsonScripts, detectPackageManager } = await import('../utils/validator.js');
|
|
16
|
+
const scripts = readPackageJsonScripts();
|
|
17
|
+
if (!scripts || !scripts.test) {
|
|
18
|
+
return {
|
|
19
|
+
success: true,
|
|
20
|
+
warning: '⚠️ No test script found in package.json. Skipping tests.',
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const packageManager = detectPackageManager();
|
|
24
|
+
const command = `${packageManager} run test`;
|
|
25
|
+
try {
|
|
26
|
+
const output = execSync(command, {
|
|
27
|
+
cwd: process.cwd(),
|
|
28
|
+
encoding: 'utf-8',
|
|
29
|
+
stdio: 'pipe',
|
|
30
|
+
});
|
|
31
|
+
return { success: true, output };
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
const err = error;
|
|
35
|
+
return {
|
|
36
|
+
success: false,
|
|
37
|
+
error: `$ ${command}\n\n${err.stdout || err.stderr || err.message}`,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Run knip to check for unused exports
|
|
43
|
+
*/
|
|
44
|
+
async function runKnip() {
|
|
45
|
+
const { readPackageJsonScripts, detectPackageManager } = await import('../utils/validator.js');
|
|
46
|
+
const scripts = readPackageJsonScripts();
|
|
47
|
+
if (!scripts || !scripts.knip) {
|
|
48
|
+
return {
|
|
49
|
+
success: true,
|
|
50
|
+
warning: '⚠️ No knip script found in package.json. Skipping knip check.',
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const packageManager = detectPackageManager();
|
|
54
|
+
const command = `${packageManager} run knip`;
|
|
55
|
+
try {
|
|
56
|
+
const output = execSync(command, {
|
|
57
|
+
cwd: process.cwd(),
|
|
58
|
+
encoding: 'utf-8',
|
|
59
|
+
stdio: 'pipe',
|
|
60
|
+
});
|
|
61
|
+
return { success: true, output };
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
const err = error;
|
|
65
|
+
return {
|
|
66
|
+
success: false,
|
|
67
|
+
error: `$ ${command}\n\n${err.stdout || err.stderr || err.message}`,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Run Claude to fix code quality errors
|
|
11
73
|
* Exported so other commands can use it
|
|
12
74
|
*/
|
|
13
|
-
export async function
|
|
14
|
-
console.log(
|
|
75
|
+
export async function fixCodeQualityErrors(stepName, errors) {
|
|
76
|
+
console.log(`\n🤖 Using Claude to fix ${stepName} errors...\n`);
|
|
15
77
|
const workspaceRoot = process.cwd();
|
|
16
78
|
// System prompt
|
|
17
|
-
const systemPrompt = `You are a code quality expert specialized in fixing
|
|
79
|
+
const systemPrompt = `You are a code quality expert specialized in fixing ${stepName} errors.
|
|
18
80
|
|
|
19
|
-
Your task is to analyze
|
|
81
|
+
Your task is to analyze errors and fix them according to the project's quality standards.
|
|
20
82
|
|
|
21
83
|
CRITICAL REQUIREMENTS:
|
|
22
|
-
- You MUST use the search_replace or write tools to fix ALL
|
|
84
|
+
- You MUST use the search_replace or write tools to fix ALL errors
|
|
23
85
|
- Simply identifying issues without fixing them is NOT acceptable
|
|
24
|
-
- Focus ONLY on fixing the specific
|
|
86
|
+
- Focus ONLY on fixing the specific errors provided. Do not make unnecessary changes.`;
|
|
25
87
|
// User prompt
|
|
26
|
-
const promptText = `The following
|
|
88
|
+
const promptText = `The following ${stepName} errors need to be fixed:
|
|
27
89
|
|
|
28
90
|
\`\`\`
|
|
29
|
-
${
|
|
91
|
+
${errors}
|
|
30
92
|
\`\`\`
|
|
31
93
|
|
|
32
94
|
**Your task:**
|
|
33
|
-
1. Analyze each
|
|
95
|
+
1. Analyze each error carefully
|
|
34
96
|
2. Read the files that have errors
|
|
35
97
|
3. **IMMEDIATELY FIX each error using search_replace or write tools**
|
|
36
98
|
4. Make minimal changes - only fix what's broken
|
|
@@ -57,63 +119,104 @@ Start by reading the files with errors and fixing them one by one.`;
|
|
|
57
119
|
}
|
|
58
120
|
}
|
|
59
121
|
/**
|
|
60
|
-
*
|
|
122
|
+
* Legacy export for backward compatibility
|
|
123
|
+
*/
|
|
124
|
+
export async function fixLintErrors(lintErrors) {
|
|
125
|
+
return fixCodeQualityErrors('linting', lintErrors);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Core comprehensive validation and fixing logic (git-agnostic)
|
|
61
129
|
* Used internally by lintCommand
|
|
62
130
|
*/
|
|
63
131
|
async function fixLintErrorsCore() {
|
|
64
|
-
console.log('🔍 Running
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
132
|
+
console.log('🔍 Running comprehensive code quality checks...\n');
|
|
133
|
+
// Define all validation steps
|
|
134
|
+
const validationSteps = [
|
|
135
|
+
{ name: '🎨 Format', run: runFormat, fixable: true },
|
|
136
|
+
{ name: '🔍 Lint', run: runLint, fixable: true },
|
|
137
|
+
{ name: '🔎 TypeCheck', run: runTypecheck, fixable: true },
|
|
138
|
+
{ name: '🧪 Tests', run: runTests, fixable: true },
|
|
139
|
+
{ name: '🔪 Knip', run: runKnip, fixable: true },
|
|
140
|
+
];
|
|
141
|
+
const stepsFixed = [];
|
|
142
|
+
let totalAttempts = 0;
|
|
75
143
|
let totalFixes = 0;
|
|
76
|
-
|
|
77
|
-
|
|
144
|
+
// Run each validation step
|
|
145
|
+
for (const step of validationSteps) {
|
|
78
146
|
console.log(`\n${'='.repeat(60)}`);
|
|
79
|
-
console.log(
|
|
80
|
-
console.log(`${'='.repeat(60)}`);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
147
|
+
console.log(`Running: ${step.name}`);
|
|
148
|
+
console.log(`${'='.repeat(60)}\n`);
|
|
149
|
+
let result = await step.run();
|
|
150
|
+
// Handle warnings (non-blocking)
|
|
151
|
+
if (result.warning) {
|
|
152
|
+
console.log(result.warning);
|
|
153
|
+
console.log(`✅ ${step.name} - SKIPPED\n`);
|
|
154
|
+
continue;
|
|
85
155
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (lintResult.success) {
|
|
91
|
-
console.log('✅ All linting errors fixed!\n');
|
|
92
|
-
break;
|
|
156
|
+
// Handle success
|
|
157
|
+
if (result.success) {
|
|
158
|
+
console.log(`✅ ${step.name} - PASSED\n`);
|
|
159
|
+
continue;
|
|
93
160
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
161
|
+
// Handle errors
|
|
162
|
+
console.log(`❌ ${step.name} - FAILED:\n`);
|
|
163
|
+
console.log(result.error);
|
|
164
|
+
if (!step.fixable) {
|
|
165
|
+
console.log(`\n⚠️ ${step.name} errors cannot be auto-fixed by Claude`);
|
|
166
|
+
throw new Error(`${step.name} validation failed`);
|
|
167
|
+
}
|
|
168
|
+
// Attempt to fix errors with Claude (max 3 attempts per step)
|
|
169
|
+
let attemptCount = 0;
|
|
170
|
+
const maxAttempts = 3;
|
|
171
|
+
while (!result.success && attemptCount < maxAttempts) {
|
|
172
|
+
attemptCount++;
|
|
173
|
+
totalAttempts++;
|
|
174
|
+
console.log(`\n${'='.repeat(60)}`);
|
|
175
|
+
console.log(`🔄 ${step.name} Fix Attempt ${attemptCount}/${maxAttempts}`);
|
|
176
|
+
console.log(`${'='.repeat(60)}`);
|
|
177
|
+
const fixApplied = await fixCodeQualityErrors(step.name, result.error || '');
|
|
178
|
+
if (!fixApplied) {
|
|
179
|
+
console.log(`\n⚠️ No fixes were applied by Claude for ${step.name}`);
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
totalFixes++;
|
|
183
|
+
// Verify fixes by running validation again
|
|
184
|
+
console.log(`\n🔍 Verifying ${step.name} fixes...\n`);
|
|
185
|
+
result = await step.run();
|
|
186
|
+
if (result.success) {
|
|
187
|
+
console.log(`✅ ${step.name} - All errors fixed!\n`);
|
|
188
|
+
stepsFixed.push(step.name);
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
const errorLines = result.error?.split('\n').length || 0;
|
|
193
|
+
console.log(`\n⚠️ Some ${step.name} errors remain (${errorLines} lines):`);
|
|
194
|
+
console.log(result.error);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
// Check if step still has errors after attempts
|
|
198
|
+
if (!result.success) {
|
|
199
|
+
console.error(`\n❌ Could not fix all ${step.name} errors after ${maxAttempts} attempts`);
|
|
200
|
+
console.log('\nRemaining errors:');
|
|
201
|
+
console.log(result.error);
|
|
202
|
+
throw new Error(`${step.name} errors remain after maximum attempts`);
|
|
97
203
|
}
|
|
98
204
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
console.log('\nRemaining errors:');
|
|
103
|
-
console.log(lintResult.error);
|
|
104
|
-
throw new Error('Linting errors remain after maximum attempts');
|
|
105
|
-
}
|
|
205
|
+
console.log('\n' + '='.repeat(60));
|
|
206
|
+
console.log('✅ All validation steps passed!');
|
|
207
|
+
console.log('='.repeat(60));
|
|
106
208
|
return {
|
|
107
209
|
success: true,
|
|
108
|
-
attempts:
|
|
210
|
+
attempts: totalAttempts,
|
|
109
211
|
fixesApplied: totalFixes,
|
|
212
|
+
stepsFixed,
|
|
110
213
|
};
|
|
111
214
|
}
|
|
112
215
|
/**
|
|
113
|
-
* Main lint command
|
|
216
|
+
* Main lint command (now runs comprehensive validation)
|
|
114
217
|
*/
|
|
115
218
|
export async function lintCommand(options = {}) {
|
|
116
|
-
console.log('🚀 Starting Kosuke
|
|
219
|
+
console.log('🚀 Starting Kosuke Code Quality Check & Fix...\n');
|
|
117
220
|
try {
|
|
118
221
|
// Validate environment
|
|
119
222
|
if (!process.env.ANTHROPIC_API_KEY) {
|
|
@@ -121,41 +224,51 @@ export async function lintCommand(options = {}) {
|
|
|
121
224
|
}
|
|
122
225
|
// If --pr flag is provided, wrap with PR workflow
|
|
123
226
|
if (options.pr) {
|
|
124
|
-
const { result, prInfo } = await runWithPR({
|
|
125
|
-
branchPrefix: 'fix/kosuke-
|
|
227
|
+
const { result: fixResult, prInfo } = await runWithPR({
|
|
228
|
+
branchPrefix: 'fix/kosuke-quality',
|
|
126
229
|
baseBranch: options.baseBranch,
|
|
127
|
-
commitMessage: 'chore: fix
|
|
128
|
-
prTitle: 'chore: Fix
|
|
129
|
-
prBody: `## 🔧 Automated
|
|
230
|
+
commitMessage: 'chore: fix code quality issues',
|
|
231
|
+
prTitle: 'chore: Fix code quality issues',
|
|
232
|
+
prBody: `## 🔧 Automated Code Quality Fixes
|
|
130
233
|
|
|
131
|
-
This PR contains automated fixes for
|
|
234
|
+
This PR contains automated fixes for code quality issues detected by comprehensive validation.
|
|
132
235
|
|
|
133
|
-
###
|
|
134
|
-
- **
|
|
236
|
+
### 📋 Validation Steps Performed
|
|
237
|
+
- 🎨 **Format**: Code formatting check
|
|
238
|
+
- 🔍 **Lint**: ESLint validation
|
|
239
|
+
- 🔎 **TypeCheck**: TypeScript type checking
|
|
240
|
+
- 🧪 **Tests**: Unit/integration tests
|
|
241
|
+
- 🔪 **Knip**: Unused exports detection
|
|
135
242
|
|
|
136
|
-
### ✅
|
|
137
|
-
|
|
243
|
+
### ✅ Result
|
|
244
|
+
All validation steps passed! Code quality issues have been automatically fixed by Claude.
|
|
138
245
|
|
|
139
246
|
---
|
|
140
247
|
|
|
141
248
|
🤖 *Generated by Kosuke CLI (\`kosuke lint --pr\`)*`,
|
|
142
249
|
}, fixLintErrorsCore);
|
|
143
|
-
console.log('\n✅
|
|
144
|
-
console.log(`📊 Attempts: ${
|
|
145
|
-
console.log(`🔧 Fixes applied: ${
|
|
250
|
+
console.log('\n✅ Code quality check complete!');
|
|
251
|
+
console.log(`📊 Attempts: ${fixResult.attempts}`);
|
|
252
|
+
console.log(`🔧 Fixes applied: ${fixResult.fixesApplied}`);
|
|
253
|
+
if (fixResult.stepsFixed.length > 0) {
|
|
254
|
+
console.log(`🎯 Steps fixed: ${fixResult.stepsFixed.join(', ')}`);
|
|
255
|
+
}
|
|
146
256
|
console.log(`🔗 PR: ${prInfo.prUrl}`);
|
|
147
257
|
}
|
|
148
258
|
else {
|
|
149
259
|
// Run core logic without PR
|
|
150
260
|
const result = await fixLintErrorsCore();
|
|
151
|
-
console.log('\n✅
|
|
261
|
+
console.log('\n✅ Code quality check complete!');
|
|
152
262
|
console.log(`📊 Attempts: ${result.attempts}`);
|
|
153
263
|
console.log(`🔧 Fixes applied: ${result.fixesApplied}`);
|
|
264
|
+
if (result.stepsFixed.length > 0) {
|
|
265
|
+
console.log(`🎯 Steps fixed: ${result.stepsFixed.join(', ')}`);
|
|
266
|
+
}
|
|
154
267
|
console.log('\nℹ️ Changes applied locally. Use --pr flag to create a pull request.');
|
|
155
268
|
}
|
|
156
269
|
}
|
|
157
270
|
catch (error) {
|
|
158
|
-
console.error('\n❌
|
|
271
|
+
console.error('\n❌ Code quality check failed:', error);
|
|
159
272
|
throw error;
|
|
160
273
|
}
|
|
161
274
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../../kosuke/commands/lint.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../../kosuke/commands/lint.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAgBzC;;GAEG;AACH,KAAK,UAAU,QAAQ;IAMrB,MAAM,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAE/F,MAAM,OAAO,GAAG,sBAAsB,EAAE,CAAC;IACzC,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAC9B,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,2DAA2D;SACrE,CAAC;IACJ,CAAC;IAED,MAAM,cAAc,GAAG,oBAAoB,EAAE,CAAC;IAC9C,MAAM,OAAO,GAAG,GAAG,cAAc,WAAW,CAAC;IAE7C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,QAAQ,CAAC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AO,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC/C,OAAO,CAAC,GAAG,CAAC,qBAAqB,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;YACxD,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACjC,OAAO,CAAC,GAAG,CAAC,mBAAmB,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACjE,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC;QACxF,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;QACvD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/lib.d.ts
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
33
|
export { analyseCommand } from './kosuke/commands/analyse.js';
|
|
34
|
-
export { lintCommand } from './kosuke/commands/lint.js';
|
|
34
|
+
export { lintCommand, fixCodeQualityErrors, fixLintErrors } from './kosuke/commands/lint.js';
|
|
35
35
|
export { syncRulesCommand } from './kosuke/commands/sync-rules.js';
|
|
36
36
|
export { requirementsCommand } from './kosuke/commands/requirements.js';
|
|
37
37
|
export { getCodeCore } from './kosuke/commands/getcode.js';
|
package/dist/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../lib.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../lib.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EACL,OAAO,EACP,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAG3E,YAAY,EACV,KAAK,EACL,GAAG,EACH,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,OAAO,EACP,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC"}
|
package/dist/lib.js
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
*/
|
|
33
33
|
// Re-export commands
|
|
34
34
|
export { analyseCommand } from './kosuke/commands/analyse.js';
|
|
35
|
-
export { lintCommand } from './kosuke/commands/lint.js';
|
|
35
|
+
export { lintCommand, fixCodeQualityErrors, fixLintErrors } from './kosuke/commands/lint.js';
|
|
36
36
|
export { syncRulesCommand } from './kosuke/commands/sync-rules.js';
|
|
37
37
|
export { requirementsCommand } from './kosuke/commands/requirements.js';
|
|
38
38
|
export { getCodeCore } from './kosuke/commands/getcode.js';
|
package/dist/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../lib.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,qBAAqB;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../lib.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,qBAAqB;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,sBAAsB;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EACL,OAAO,EACP,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC"}
|