@nt-ai-lab/opencode-skillz 0.3.7 → 0.3.8
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/tools/lint.js
CHANGED
|
@@ -26,6 +26,7 @@ class LintExecutionError extends Error {
|
|
|
26
26
|
super(message);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
+
const ansiEscapeSequencePattern = new RegExp(String.raw `\u001B\[[0-?]*[ -/]*[@-~]`, "g");
|
|
29
30
|
const toolDirectory = path.dirname(fileURLToPath(import.meta.url));
|
|
30
31
|
const toolRepositoryRoot = path.resolve(toolDirectory, "..", "..");
|
|
31
32
|
const eslintConfigPath = path.join(toolRepositoryRoot, "scripts", "living-architecture-eslint.config.mjs");
|
|
@@ -130,6 +131,9 @@ function createLintTitle(filePaths, baseReference) {
|
|
|
130
131
|
}
|
|
131
132
|
return "Lint current TypeScript files";
|
|
132
133
|
}
|
|
134
|
+
function removeAnsiEscapeSequences(value) {
|
|
135
|
+
return value.replaceAll(ansiEscapeSequencePattern, "");
|
|
136
|
+
}
|
|
133
137
|
async function runEslint(repositoryRoot, lintTargets) {
|
|
134
138
|
const previousLintRepositoryRoot = process.env.NT_SKILLZ_LINT_REPO_ROOT;
|
|
135
139
|
process.env.NT_SKILLZ_LINT_REPO_ROOT = repositoryRoot;
|
|
@@ -142,7 +146,7 @@ async function runEslint(repositoryRoot, lintTargets) {
|
|
|
142
146
|
try {
|
|
143
147
|
const lintResults = await eslint.lintFiles(lintTargets);
|
|
144
148
|
const formatter = await eslint.loadFormatter("stylish");
|
|
145
|
-
const formattedOutput = (await formatter.format(lintResults)).trim();
|
|
149
|
+
const formattedOutput = removeAnsiEscapeSequences((await formatter.format(lintResults)).trim());
|
|
146
150
|
const errorCount = lintResults.reduce((count, lintResult) => count + lintResult.errorCount + lintResult.fatalErrorCount, 0);
|
|
147
151
|
return {
|
|
148
152
|
exitCode: errorCount > 0 ? 1 : 0,
|
package/package.json
CHANGED
|
@@ -22,8 +22,6 @@ if (!lintRepositoryRoot) {
|
|
|
22
22
|
|
|
23
23
|
const typescriptFiles = ['**/*.ts', '**/*.tsx']
|
|
24
24
|
const testFiles = ['**/*.spec.ts', '**/*.spec.tsx', '**/*.test.ts', '**/*.test.tsx']
|
|
25
|
-
const thinLayerFiles = ['**/entrypoint/**/*.ts', '**/commands/**/*.ts', '**/queries/**/*.ts']
|
|
26
|
-
const thinLayerIgnoredFiles = ['**/*.spec.ts', '**/*.test.ts']
|
|
27
25
|
const ignoredPaths = [
|
|
28
26
|
'**/dist',
|
|
29
27
|
'**/out-tsc',
|
|
@@ -58,21 +56,6 @@ const noEmptyStringFallbackRule = {
|
|
|
58
56
|
|
|
59
57
|
const restrictedSyntaxRules = ['error', noLetRule, noGenericErrorRule, noEmptyStringFallbackRule]
|
|
60
58
|
|
|
61
|
-
const entrypointRestrictedSyntaxRules = [
|
|
62
|
-
'error',
|
|
63
|
-
noLetRule,
|
|
64
|
-
noGenericErrorRule,
|
|
65
|
-
{
|
|
66
|
-
selector: 'FunctionDeclaration:not([parent.type="ExportNamedDeclaration"])',
|
|
67
|
-
message: 'Entrypoints must not define private functions. Move logic to commands/, queries/, or infra/.',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
selector: 'VariableDeclarator > ArrowFunctionExpression',
|
|
71
|
-
message: 'Entrypoints must not define private arrow functions. Move logic to commands/, queries/, or infra/.',
|
|
72
|
-
},
|
|
73
|
-
noEmptyStringFallbackRule,
|
|
74
|
-
]
|
|
75
|
-
|
|
76
59
|
const restrictedImportPatterns = [
|
|
77
60
|
{
|
|
78
61
|
group: ['*/utils/*', '*/utils', '*/utilities'],
|
|
@@ -229,20 +212,6 @@ export default tseslint.config(
|
|
|
229
212
|
'@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: false }],
|
|
230
213
|
},
|
|
231
214
|
},
|
|
232
|
-
{
|
|
233
|
-
files: thinLayerFiles,
|
|
234
|
-
ignores: thinLayerIgnoredFiles,
|
|
235
|
-
rules: {
|
|
236
|
-
'max-lines': ['error', { max: 150, skipBlankLines: true, skipComments: true }],
|
|
237
|
-
},
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
files: ['**/entrypoint/**/*.ts'],
|
|
241
|
-
ignores: thinLayerIgnoredFiles,
|
|
242
|
-
rules: {
|
|
243
|
-
'no-restricted-syntax': entrypointRestrictedSyntaxRules,
|
|
244
|
-
},
|
|
245
|
-
},
|
|
246
215
|
{
|
|
247
216
|
files: typescriptFiles,
|
|
248
217
|
plugins: {
|