oxlint-tui 1.0.10 → 1.0.11
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 +1 -1
- package/tui.js +9 -12
package/package.json
CHANGED
package/tui.js
CHANGED
|
@@ -92,28 +92,25 @@ function runLint(type_aware) {
|
|
|
92
92
|
render();
|
|
93
93
|
|
|
94
94
|
const cmd = type_aware
|
|
95
|
-
? `npx --yes
|
|
96
|
-
: `npx --yes oxlint@${OXLINT_VERSION}`;
|
|
95
|
+
? `npx -q --yes --package oxlint@${OXLINT_VERSION} --package oxlint-tsgolint@${TSGOLINT_VERSION} -- oxlint --type-aware`
|
|
96
|
+
: `npx -q --yes --package oxlint@${OXLINT_VERSION} -- oxlint`;
|
|
97
97
|
|
|
98
98
|
exec(cmd, (error, stdout, stderr) => {
|
|
99
99
|
const fullOutput = stdout + stderr;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
);
|
|
100
|
+
|
|
101
|
+
const summaryMatch = fullOutput.match(/Found (\d+) warnings? and (\d+) errors?/i);
|
|
103
102
|
|
|
104
103
|
state.isLinting = false;
|
|
104
|
+
|
|
105
105
|
if (summaryMatch) {
|
|
106
|
-
state.message = summaryMatch[0];
|
|
106
|
+
state.message = summaryMatch[0].trim();
|
|
107
107
|
const errors = parseInt(summaryMatch[2]);
|
|
108
108
|
state.messageType = errors > 0 ? "error" : "warn";
|
|
109
|
-
} else if (
|
|
110
|
-
fullOutput.includes("Finished") ||
|
|
111
|
-
(!error && fullOutput.length === 0)
|
|
112
|
-
) {
|
|
109
|
+
} else if (!error || (error.code === 0)) {
|
|
113
110
|
state.message = "Linting passed! 0 issues found.";
|
|
114
111
|
state.messageType = "success";
|
|
115
112
|
} else {
|
|
116
|
-
state.message =
|
|
113
|
+
state.message = `Error: ${stderr.split('\n')[0] || "Unknown issue"}`;
|
|
117
114
|
state.messageType = "error";
|
|
118
115
|
}
|
|
119
116
|
render();
|
|
@@ -241,7 +238,7 @@ function loadRules() {
|
|
|
241
238
|
|
|
242
239
|
try {
|
|
243
240
|
const raw = execSync(
|
|
244
|
-
`npx --yes oxlint@${OXLINT_VERSION} --rules --format=json`,
|
|
241
|
+
`npx -q --yes oxlint@${OXLINT_VERSION} --rules --format=json`,
|
|
245
242
|
{
|
|
246
243
|
encoding: "utf8",
|
|
247
244
|
stdio: ["ignore", "pipe", "ignore"],
|