@nt-ai-lab/opencode-skillz 0.3.5 → 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.
@@ -10,8 +10,9 @@ Implement the required task to the highest standards possible. Do not take short
10
10
 
11
11
  ## Linting
12
12
 
13
- After each small TypeScript code change, call `nt_skillz_lint` for the changed `.ts` or `.tsx` file or files.
13
+ After each small TypeScript code change, call `nt_skillz_lint` with only the `files` argument for the changed `.ts` or `.tsx` file or files from that step.
14
14
 
15
+ - do not pass `base` or `head` during normal implementation work
15
16
  - all lint errors on new code must be addressed before continuing
16
17
  - if the lint fails on existing code, ignore the error unless it is very close to the new code
17
18
  - line-length limits do not count as existing code; if new code causes a file-length lint error, it must be fixed
@@ -1,5 +1,16 @@
1
- import { type ToolContext } from "@opencode-ai/plugin";
1
+ interface PortableLintRequest {
2
+ repositoryRoot?: string;
3
+ files?: string[];
4
+ base?: string;
5
+ head?: string;
6
+ }
7
+ interface PortableLintOutcome {
8
+ exitCode: number;
9
+ output: string;
10
+ }
2
11
  export declare const LINT_TOOL_NAME = "nt_skillz_lint";
12
+ export declare function runPortableLint(request: PortableLintRequest): Promise<PortableLintOutcome>;
13
+ export declare function runPortableLintFromCommandLine(commandLineArguments: string[]): Promise<number>;
3
14
  export declare const lintTool: {
4
15
  description: string;
5
16
  args: {
@@ -11,5 +22,6 @@ export declare const lintTool: {
11
22
  files?: string[] | undefined;
12
23
  base?: string | undefined;
13
24
  head?: string | undefined;
14
- }, context: ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
25
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
15
26
  };
27
+ export {};
@@ -1,89 +1,218 @@
1
- import { spawn } from "node:child_process";
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import process from "node:process";
4
+ import { spawnSync } from "node:child_process";
2
5
  import { fileURLToPath } from "node:url";
3
- import { tool, } from "@opencode-ai/plugin";
4
- class InvalidLintRequestError extends Error {
6
+ import { parseArgs } from "node:util";
7
+ import { ESLint } from "eslint";
8
+ import { tool } from "@opencode-ai/plugin";
9
+ class UsageError extends Error {
5
10
  constructor(message) {
6
11
  super(message);
7
12
  }
8
13
  }
9
- class LintRunFailedError extends Error {
14
+ class GitCommandError extends Error {
10
15
  constructor(message) {
11
16
  super(message);
12
17
  }
13
18
  }
14
- const lintScriptPath = fileURLToPath(new URL("../../scripts/lint-ts.mjs", import.meta.url));
19
+ class MissingBundledLintAssetError extends Error {
20
+ constructor(message) {
21
+ super(message);
22
+ }
23
+ }
24
+ class LintExecutionError extends Error {
25
+ constructor(message) {
26
+ super(message);
27
+ }
28
+ }
29
+ const toolDirectory = path.dirname(fileURLToPath(import.meta.url));
30
+ const toolRepositoryRoot = path.resolve(toolDirectory, "..", "..");
31
+ const eslintConfigPath = path.join(toolRepositoryRoot, "scripts", "living-architecture-eslint.config.mjs");
32
+ const gitBinaryPath = "/usr/bin/git";
15
33
  export const LINT_TOOL_NAME = "nt_skillz_lint";
16
- function validateLintRequest(request) {
17
- if (request.base && request.files?.length) {
18
- throw new InvalidLintRequestError("Expected either file paths or base reference. Got both.");
34
+ function normalizeOptionalText(value) {
35
+ if (typeof value !== "string") {
36
+ return undefined;
19
37
  }
20
- if (!request.base && request.head) {
21
- throw new InvalidLintRequestError("Expected head reference to be used together with base reference.");
38
+ const trimmedValue = value.trim();
39
+ if (!trimmedValue) {
40
+ return undefined;
22
41
  }
42
+ return trimmedValue;
23
43
  }
24
- function createLintCommandArguments(request) {
25
- const commandArguments = [lintScriptPath];
26
- if (request.base) {
27
- commandArguments.push("--base", request.base);
28
- if (request.head) {
29
- commandArguments.push("--head", request.head);
30
- }
44
+ function resolveDirectory(directoryPath) {
45
+ const absoluteDirectoryPath = path.resolve(directoryPath);
46
+ if (!fs.existsSync(absoluteDirectoryPath)) {
47
+ throw new UsageError(`Expected repository path to exist. Got ${absoluteDirectoryPath}.`);
48
+ }
49
+ if (!fs.statSync(absoluteDirectoryPath).isDirectory()) {
50
+ throw new UsageError(`Expected repository path to be a directory. Got ${absoluteDirectoryPath}.`);
51
+ }
52
+ return absoluteDirectoryPath;
53
+ }
54
+ function ensureSupportedFilePath(filePath) {
55
+ if (filePath.endsWith(".ts") || filePath.endsWith(".tsx")) {
56
+ return;
31
57
  }
32
- for (const filePath of request.files ?? []) {
33
- commandArguments.push(filePath);
58
+ throw new UsageError(`Expected a TypeScript file path ending in .ts or .tsx. Got ${filePath}.`);
59
+ }
60
+ function normalizeFilePaths(filePaths) {
61
+ const normalizedFilePaths = (filePaths ?? []).map((filePath) => filePath.trim()).filter(Boolean);
62
+ normalizedFilePaths.forEach(ensureSupportedFilePath);
63
+ return normalizedFilePaths;
64
+ }
65
+ function ensureBundledLintAssetsExist() {
66
+ if (fs.existsSync(eslintConfigPath)) {
67
+ return;
34
68
  }
35
- return commandArguments;
69
+ throw new MissingBundledLintAssetError(`Expected bundled lint config to exist at ${eslintConfigPath}.`);
36
70
  }
37
- function createLintTitle(request) {
38
- if (request.files?.length) {
39
- return `Lint ${request.files.length} TypeScript file(s)`;
71
+ function runGitCommand(repositoryRoot, gitArguments) {
72
+ const gitResult = spawnSync(gitBinaryPath, ["-C", repositoryRoot, ...gitArguments], { encoding: "utf8" });
73
+ if (gitResult.error) {
74
+ throw new GitCommandError(`Expected git command to run. Got ${gitResult.error.message}.`);
40
75
  }
41
- if (request.base) {
42
- return `Lint TypeScript changes from ${request.base}`;
76
+ if (gitResult.status === 0) {
77
+ return gitResult.stdout;
43
78
  }
44
- return "Lint current TypeScript files";
79
+ const errorOutput = gitResult.stderr.trim() || gitResult.stdout.trim() || "git command failed";
80
+ throw new GitCommandError(`Expected git command to succeed. Got ${errorOutput}.`);
81
+ }
82
+ function readChangedTypeScriptFiles(repositoryRoot, baseReference, headReference) {
83
+ const diffRange = `${baseReference}...${headReference}`;
84
+ const output = runGitCommand(repositoryRoot, [
85
+ "diff",
86
+ "--name-only",
87
+ "--diff-filter=ACMR",
88
+ diffRange,
89
+ "--",
90
+ "*.ts",
91
+ "*.tsx",
92
+ ]);
93
+ return output.split("\n").filter(Boolean);
45
94
  }
46
- function createLintOutput(standardOutputParts, standardErrorParts) {
47
- const sections = [standardOutputParts.join("").trim(), standardErrorParts.join("").trim()].filter(Boolean);
48
- return sections.join("\n");
95
+ function readTrackedAndUntrackedTypeScriptFiles(repositoryRoot) {
96
+ const output = runGitCommand(repositoryRoot, [
97
+ "ls-files",
98
+ "--cached",
99
+ "--others",
100
+ "--exclude-standard",
101
+ "--",
102
+ "*.ts",
103
+ "*.tsx",
104
+ ]);
105
+ return output.split("\n").filter(Boolean);
49
106
  }
50
- function normalizeExitCode(value) {
51
- if (typeof value === "number") {
52
- return value;
107
+ function ensureValidLintRequest(baseReference, headReference, filePaths) {
108
+ if (baseReference && filePaths.length > 0) {
109
+ throw new UsageError("Expected either file paths or base reference. Got both.");
110
+ }
111
+ if (!baseReference && headReference) {
112
+ throw new UsageError("Expected head reference to be used together with base reference.");
53
113
  }
54
- return 1;
55
114
  }
56
- function runLintCommand(request, context) {
57
- return new Promise((resolve, reject) => {
58
- const lintCommand = spawn(process.execPath, createLintCommandArguments(request), {
59
- cwd: context.worktree,
60
- signal: context.abort,
61
- stdio: ["ignore", "pipe", "pipe"],
62
- });
63
- const standardOutputParts = [];
64
- const standardErrorParts = [];
65
- lintCommand.stdout.on("data", (chunk) => {
66
- standardOutputParts.push(chunk.toString());
67
- });
68
- lintCommand.stderr.on("data", (chunk) => {
69
- standardErrorParts.push(chunk.toString());
70
- });
71
- lintCommand.on("error", (error) => {
72
- reject(error);
73
- });
74
- lintCommand.on("close", (exitCode) => {
75
- resolve({
76
- exitCode: normalizeExitCode(exitCode),
77
- output: createLintOutput(standardOutputParts, standardErrorParts),
78
- });
79
- });
115
+ function resolveLintTargets(repositoryRoot, baseReference, headReference, filePaths) {
116
+ if (filePaths.length > 0) {
117
+ return filePaths;
118
+ }
119
+ if (baseReference) {
120
+ return readChangedTypeScriptFiles(repositoryRoot, baseReference, headReference ?? "HEAD");
121
+ }
122
+ return readTrackedAndUntrackedTypeScriptFiles(repositoryRoot);
123
+ }
124
+ function createLintTitle(filePaths, baseReference) {
125
+ if (filePaths.length > 0) {
126
+ return `Lint ${filePaths.length} TypeScript file(s)`;
127
+ }
128
+ if (baseReference) {
129
+ return `Lint TypeScript changes from ${baseReference}`;
130
+ }
131
+ return "Lint current TypeScript files";
132
+ }
133
+ async function runEslint(repositoryRoot, lintTargets) {
134
+ const previousLintRepositoryRoot = process.env.NT_SKILLZ_LINT_REPO_ROOT;
135
+ process.env.NT_SKILLZ_LINT_REPO_ROOT = repositoryRoot;
136
+ const eslint = new ESLint({
137
+ cwd: repositoryRoot,
138
+ errorOnUnmatchedPattern: false,
139
+ overrideConfigFile: eslintConfigPath,
140
+ warnIgnored: false,
141
+ });
142
+ try {
143
+ const lintResults = await eslint.lintFiles(lintTargets);
144
+ const formatter = await eslint.loadFormatter("stylish");
145
+ const formattedOutput = (await formatter.format(lintResults)).trim();
146
+ const errorCount = lintResults.reduce((count, lintResult) => count + lintResult.errorCount + lintResult.fatalErrorCount, 0);
147
+ return {
148
+ exitCode: errorCount > 0 ? 1 : 0,
149
+ output: formattedOutput,
150
+ };
151
+ }
152
+ finally {
153
+ if (previousLintRepositoryRoot) {
154
+ process.env.NT_SKILLZ_LINT_REPO_ROOT = previousLintRepositoryRoot;
155
+ }
156
+ else {
157
+ delete process.env.NT_SKILLZ_LINT_REPO_ROOT;
158
+ }
159
+ }
160
+ }
161
+ function parsePortableLintCommandLine(commandLineArguments) {
162
+ const parsedArguments = parseArgs({
163
+ args: commandLineArguments,
164
+ options: {
165
+ repo: { type: "string" },
166
+ base: { type: "string" },
167
+ head: { type: "string" },
168
+ help: {
169
+ type: "boolean",
170
+ short: "h",
171
+ },
172
+ },
173
+ allowPositionals: true,
80
174
  });
175
+ if (parsedArguments.values.help) {
176
+ process.stdout.write([
177
+ "Usage: ./scripts/lint-ts.sh [--repo PATH] [--base REF] [--head REF] [file ...]",
178
+ "",
179
+ "Examples:",
180
+ " ./scripts/lint-ts.sh --repo ../living-architecture --base origin/main",
181
+ " ./scripts/lint-ts.sh --repo ../living-architecture packages/example/src/example.ts",
182
+ " ./scripts/lint-ts.sh src/example.ts",
183
+ ].join("\n") + "\n");
184
+ process.exit(0);
185
+ }
186
+ return {
187
+ repositoryRoot: resolveDirectory(parsedArguments.values.repo ?? process.cwd()),
188
+ files: normalizeFilePaths(parsedArguments.positionals),
189
+ base: normalizeOptionalText(parsedArguments.values.base),
190
+ head: normalizeOptionalText(parsedArguments.values.head),
191
+ };
81
192
  }
82
- function createLintFailureMessage(outcome) {
193
+ export async function runPortableLint(request) {
194
+ ensureBundledLintAssetsExist();
195
+ const repositoryRoot = resolveDirectory(request.repositoryRoot ?? process.cwd());
196
+ const baseReference = normalizeOptionalText(request.base);
197
+ const headReference = normalizeOptionalText(request.head);
198
+ const filePaths = normalizeFilePaths(request.files);
199
+ ensureValidLintRequest(baseReference, headReference, filePaths);
200
+ const lintTargets = resolveLintTargets(repositoryRoot, baseReference, headReference, filePaths);
201
+ if (lintTargets.length === 0) {
202
+ return {
203
+ exitCode: 0,
204
+ output: "No TypeScript files matched.",
205
+ };
206
+ }
207
+ return runEslint(repositoryRoot, lintTargets);
208
+ }
209
+ export async function runPortableLintFromCommandLine(commandLineArguments) {
210
+ const request = parsePortableLintCommandLine(commandLineArguments);
211
+ const outcome = await runPortableLint(request);
83
212
  if (outcome.output) {
84
- return outcome.output;
213
+ process.stdout.write(`${outcome.output}\n`);
85
214
  }
86
- return `Lint failed with exit code ${outcome.exitCode}.`;
215
+ return outcome.exitCode;
87
216
  }
88
217
  export const lintTool = tool({
89
218
  description: "Run bundled TypeScript lint rules against current project files.",
@@ -93,18 +222,26 @@ export const lintTool = tool({
93
222
  head: tool.schema.string().optional().describe("Optional head git reference used with base."),
94
223
  },
95
224
  async execute(request, context) {
96
- validateLintRequest(request);
97
- context.metadata({ title: createLintTitle(request) });
98
- const outcome = await runLintCommand(request, context);
225
+ const filePaths = normalizeFilePaths(request.files);
226
+ const baseReference = normalizeOptionalText(request.base);
227
+ const headReference = normalizeOptionalText(request.head);
228
+ ensureValidLintRequest(baseReference, headReference, filePaths);
229
+ context.metadata({ title: createLintTitle(filePaths, baseReference) });
230
+ const outcome = await runPortableLint({
231
+ repositoryRoot: context.worktree,
232
+ files: filePaths,
233
+ base: baseReference,
234
+ head: headReference,
235
+ });
99
236
  if (outcome.exitCode !== 0) {
100
- throw new LintRunFailedError(createLintFailureMessage(outcome));
237
+ throw new LintExecutionError(outcome.output || "Lint failed.");
101
238
  }
102
239
  return {
103
240
  output: outcome.output || "Lint passed.",
104
241
  metadata: {
105
- base: request.base ?? null,
106
- fileCount: request.files?.length ?? 0,
107
- head: request.head ?? null,
242
+ base: baseReference ?? null,
243
+ fileCount: filePaths.length,
244
+ head: headReference ?? null,
108
245
  },
109
246
  };
110
247
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nt-ai-lab/opencode-skillz",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "Bundled OpenCode commands and agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -24,14 +24,11 @@
24
24
  "README.md"
25
25
  ],
26
26
  "dependencies": {
27
- "@opencode-ai/plugin": "^1.14.28"
28
- },
29
- "devDependencies": {
30
27
  "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
31
28
  "@eslint/js": "^9.39.0",
29
+ "@opencode-ai/plugin": "^1.14.28",
32
30
  "@stylistic/eslint-plugin": "^5.6.1",
33
31
  "@vitest/eslint-plugin": "^1.0.1",
34
- "@types/node": "^24.7.2",
35
32
  "eslint": "^9.39.0",
36
33
  "eslint-plugin-import": "^2.32.0",
37
34
  "eslint-plugin-sonarjs": "^3.0.5",
@@ -39,6 +36,9 @@
39
36
  "typescript": "^5.9.3",
40
37
  "typescript-eslint": "^8.50.1"
41
38
  },
39
+ "devDependencies": {
40
+ "@types/node": "^24.7.2"
41
+ },
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  }
@@ -1,218 +1,8 @@
1
- import fs from 'node:fs'
2
- import path from 'node:path'
3
1
  import process from 'node:process'
4
- import { spawnSync } from 'node:child_process'
5
- import { fileURLToPath } from 'node:url'
6
- import { parseArgs } from 'node:util'
7
-
8
- class UsageError extends Error {
9
- constructor(message) {
10
- super(message)
11
- }
12
- }
13
-
14
- class GitCommandError extends Error {
15
- constructor(message) {
16
- super(message)
17
- }
18
- }
19
-
20
- class MissingLocalDependencyError extends Error {
21
- constructor(message) {
22
- super(message)
23
- }
24
- }
25
-
26
- class LintExecutionError extends Error {
27
- constructor(message) {
28
- super(message)
29
- }
30
- }
31
-
32
- const scriptDirectory = path.dirname(fileURLToPath(import.meta.url))
33
- const toolRepositoryRoot = path.resolve(scriptDirectory, '..')
34
- const eslintCliPath = path.join(toolRepositoryRoot, 'node_modules', 'eslint', 'bin', 'eslint.js')
35
- const eslintConfigPath = path.join(toolRepositoryRoot, 'scripts', 'living-architecture-eslint.config.mjs')
36
-
37
- const printUsage = () => {
38
- const usage = [
39
- 'Usage: ./scripts/lint-ts.sh [--repo PATH] [--base REF] [--head REF] [file ...]',
40
- '',
41
- 'Examples:',
42
- ' ./scripts/lint-ts.sh --repo ../living-architecture --base origin/main',
43
- ' ./scripts/lint-ts.sh --repo ../living-architecture packages/example/src/example.ts',
44
- ' ./scripts/lint-ts.sh src/example.ts',
45
- ].join('\n')
46
-
47
- process.stdout.write(`${usage}\n`)
48
- }
49
-
50
- const parseCommandLine = () => {
51
- return parseArgs({
52
- options: {
53
- repo: { type: 'string' },
54
- base: { type: 'string' },
55
- head: { type: 'string' },
56
- help: { type: 'boolean', short: 'h' },
57
- },
58
- allowPositionals: true,
59
- })
60
- }
61
-
62
- const resolveDirectory = (directoryPath) => {
63
- const absoluteDirectoryPath = path.resolve(directoryPath)
64
-
65
- if (!fs.existsSync(absoluteDirectoryPath)) {
66
- throw new UsageError(`Expected repository path to exist. Got ${absoluteDirectoryPath}.`)
67
- }
68
-
69
- if (!fs.statSync(absoluteDirectoryPath).isDirectory()) {
70
- throw new UsageError(`Expected repository path to be a directory. Got ${absoluteDirectoryPath}.`)
71
- }
72
-
73
- return absoluteDirectoryPath
74
- }
75
-
76
- const ensureSupportedFilePath = (filePath) => {
77
- if (filePath.endsWith('.ts') || filePath.endsWith('.tsx')) {
78
- return
79
- }
80
-
81
- throw new UsageError(`Expected a TypeScript file path ending in .ts or .tsx. Got ${filePath}.`)
82
- }
83
-
84
- const runGit = (repositoryRoot, args) => {
85
- const gitResult = spawnSync('git', ['-C', repositoryRoot, ...args], {
86
- encoding: 'utf8',
87
- })
88
-
89
- if (gitResult.error) {
90
- throw new GitCommandError(`Expected git command to run. Got ${gitResult.error.message}.`)
91
- }
92
-
93
- if (gitResult.status === 0) {
94
- return gitResult.stdout
95
- }
96
-
97
- const errorOutput = gitResult.stderr.trim() || gitResult.stdout.trim() || 'git command failed'
98
- throw new GitCommandError(`Expected git command to succeed. Got ${errorOutput}.`)
99
- }
100
-
101
- const readChangedTypeScriptFiles = (repositoryRoot, baseReference, headReference) => {
102
- const diffRange = `${baseReference}...${headReference}`
103
- const output = runGit(repositoryRoot, [
104
- 'diff',
105
- '--name-only',
106
- '--diff-filter=ACMR',
107
- diffRange,
108
- '--',
109
- '*.ts',
110
- '*.tsx',
111
- ])
112
-
113
- return output.split('\n').filter(Boolean)
114
- }
115
-
116
- const readTrackedAndUntrackedTypeScriptFiles = (repositoryRoot) => {
117
- const output = runGit(repositoryRoot, [
118
- 'ls-files',
119
- '--cached',
120
- '--others',
121
- '--exclude-standard',
122
- '--',
123
- '*.ts',
124
- '*.tsx',
125
- ])
126
-
127
- return output.split('\n').filter(Boolean)
128
- }
129
-
130
- const resolveLintTargets = (repositoryRoot, baseReference, headReference, positionalArguments) => {
131
- if (positionalArguments.length > 0) {
132
- positionalArguments.forEach(ensureSupportedFilePath)
133
- return positionalArguments
134
- }
135
-
136
- if (baseReference) {
137
- return readChangedTypeScriptFiles(repositoryRoot, baseReference, headReference)
138
- }
139
-
140
- return readTrackedAndUntrackedTypeScriptFiles(repositoryRoot)
141
- }
142
-
143
- const ensureValidArguments = (baseReference, headReference, positionalArguments) => {
144
- if (baseReference && positionalArguments.length > 0) {
145
- throw new UsageError('Expected either explicit file paths or --base. Got both.')
146
- }
147
-
148
- if (!baseReference && headReference !== 'HEAD') {
149
- throw new UsageError('Expected --head to be used together with --base.')
150
- }
151
- }
152
-
153
- const ensureLocalDependencies = () => {
154
- if (fs.existsSync(eslintCliPath)) {
155
- return
156
- }
157
-
158
- throw new MissingLocalDependencyError(
159
- `Expected ESLint dependencies to be installed in ${toolRepositoryRoot}. Run npm install in this repository.`,
160
- )
161
- }
162
-
163
- const runEslint = (repositoryRoot, lintTargets) => {
164
- const eslintResult = spawnSync(
165
- process.execPath,
166
- [eslintCliPath, '--no-config-lookup', '--no-warn-ignored', '--config', eslintConfigPath, ...lintTargets],
167
- {
168
- cwd: repositoryRoot,
169
- env: {
170
- ...process.env,
171
- NT_SKILLZ_LINT_REPO_ROOT: repositoryRoot,
172
- },
173
- stdio: 'inherit',
174
- },
175
- )
176
-
177
- if (eslintResult.error) {
178
- throw new LintExecutionError(`Expected ESLint to run. Got ${eslintResult.error.message}.`)
179
- }
180
-
181
- if (typeof eslintResult.status === 'number') {
182
- return eslintResult.status
183
- }
184
-
185
- throw new LintExecutionError(`Expected ESLint to exit with a status code. Got signal ${eslintResult.signal}.`)
186
- }
187
-
188
- const main = () => {
189
- const parsedArguments = parseCommandLine()
190
-
191
- if (parsedArguments.values.help) {
192
- printUsage()
193
- return 0
194
- }
195
-
196
- const repositoryRoot = resolveDirectory(parsedArguments.values.repo ?? process.cwd())
197
- const baseReference = parsedArguments.values.base
198
- const headReference = parsedArguments.values.head ?? 'HEAD'
199
- const positionalArguments = parsedArguments.positionals
200
-
201
- ensureValidArguments(baseReference, headReference, positionalArguments)
202
- ensureLocalDependencies()
203
-
204
- const lintTargets = resolveLintTargets(repositoryRoot, baseReference, headReference, positionalArguments)
205
-
206
- if (lintTargets.length === 0) {
207
- process.stdout.write('No TypeScript files matched.\n')
208
- return 0
209
- }
210
-
211
- return runEslint(repositoryRoot, lintTargets)
212
- }
2
+ import { runPortableLintFromCommandLine } from '../dist/tools/lint.js'
213
3
 
214
4
  try {
215
- process.exitCode = main()
5
+ process.exitCode = await runPortableLintFromCommandLine(process.argv.slice(2))
216
6
  } catch (error) {
217
7
  const message = error instanceof Error ? error.message : `Expected an error message. Got ${String(error)}.`
218
8
  process.stderr.write(`${message}\n`)