@nt-ai-lab/opencode-skillz 0.3.6 → 0.3.7
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 +5 -6
- package/package.json +1 -1
package/dist/tools/lint.js
CHANGED
|
@@ -16,7 +16,7 @@ class GitCommandError extends Error {
|
|
|
16
16
|
super(message);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
class
|
|
19
|
+
class MissingBundledLintAssetError extends Error {
|
|
20
20
|
constructor(message) {
|
|
21
21
|
super(message);
|
|
22
22
|
}
|
|
@@ -28,7 +28,6 @@ class LintExecutionError extends Error {
|
|
|
28
28
|
}
|
|
29
29
|
const toolDirectory = path.dirname(fileURLToPath(import.meta.url));
|
|
30
30
|
const toolRepositoryRoot = path.resolve(toolDirectory, "..", "..");
|
|
31
|
-
const eslintCliPath = path.join(toolRepositoryRoot, "node_modules", "eslint", "bin", "eslint.js");
|
|
32
31
|
const eslintConfigPath = path.join(toolRepositoryRoot, "scripts", "living-architecture-eslint.config.mjs");
|
|
33
32
|
const gitBinaryPath = "/usr/bin/git";
|
|
34
33
|
export const LINT_TOOL_NAME = "nt_skillz_lint";
|
|
@@ -63,11 +62,11 @@ function normalizeFilePaths(filePaths) {
|
|
|
63
62
|
normalizedFilePaths.forEach(ensureSupportedFilePath);
|
|
64
63
|
return normalizedFilePaths;
|
|
65
64
|
}
|
|
66
|
-
function
|
|
67
|
-
if (fs.existsSync(
|
|
65
|
+
function ensureBundledLintAssetsExist() {
|
|
66
|
+
if (fs.existsSync(eslintConfigPath)) {
|
|
68
67
|
return;
|
|
69
68
|
}
|
|
70
|
-
throw new
|
|
69
|
+
throw new MissingBundledLintAssetError(`Expected bundled lint config to exist at ${eslintConfigPath}.`);
|
|
71
70
|
}
|
|
72
71
|
function runGitCommand(repositoryRoot, gitArguments) {
|
|
73
72
|
const gitResult = spawnSync(gitBinaryPath, ["-C", repositoryRoot, ...gitArguments], { encoding: "utf8" });
|
|
@@ -192,7 +191,7 @@ function parsePortableLintCommandLine(commandLineArguments) {
|
|
|
192
191
|
};
|
|
193
192
|
}
|
|
194
193
|
export async function runPortableLint(request) {
|
|
195
|
-
|
|
194
|
+
ensureBundledLintAssetsExist();
|
|
196
195
|
const repositoryRoot = resolveDirectory(request.repositoryRoot ?? process.cwd());
|
|
197
196
|
const baseReference = normalizeOptionalText(request.base);
|
|
198
197
|
const headReference = normalizeOptionalText(request.head);
|