oxlint-tui 1.0.10 → 1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tui.js +8 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-tui",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "A Node TUI Oxlint rules and configuration browser",
5
5
  "type": "module",
6
6
  "bin": {
package/tui.js CHANGED
@@ -92,28 +92,23 @@ function runLint(type_aware) {
92
92
  render();
93
93
 
94
94
  const cmd = type_aware
95
- ? `npx --yes -p oxlint@${OXLINT_VERSION} -p oxlint-tsgolint@${TSGOLINT_VERSION} oxlint --type-aware`
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
- const fullOutput = stdout + stderr;
100
- const summaryMatch = fullOutput.match(
101
- /Found (\d+) warnings? and (\d+) errors?/,
102
- );
99
+ const summaryMatch = stdout.match(/Found (\d+) warnings? and (\d+) errors?/i);
103
100
 
104
101
  state.isLinting = false;
102
+
105
103
  if (summaryMatch) {
106
- state.message = summaryMatch[0];
104
+ state.message = summaryMatch[0].trim();
107
105
  const errors = parseInt(summaryMatch[2]);
108
106
  state.messageType = errors > 0 ? "error" : "warn";
109
- } else if (
110
- fullOutput.includes("Finished") ||
111
- (!error && fullOutput.length === 0)
112
- ) {
107
+ } else if (!error || (error.code === 0)) {
113
108
  state.message = "Linting passed! 0 issues found.";
114
109
  state.messageType = "success";
115
110
  } else {
116
- state.message = "Something went wrong";
111
+ state.message = `Error: ${stderr.split('\n')[0] || "Unknown issue"}`;
117
112
  state.messageType = "error";
118
113
  }
119
114
  render();
@@ -241,7 +236,7 @@ function loadRules() {
241
236
 
242
237
  try {
243
238
  const raw = execSync(
244
- `npx --yes oxlint@${OXLINT_VERSION} --rules --format=json`,
239
+ `npx -q --yes oxlint@${OXLINT_VERSION} --rules --format=json`,
245
240
  {
246
241
  encoding: "utf8",
247
242
  stdio: ["ignore", "pipe", "ignore"],