oxlint-tui 1.0.11 → 1.0.13

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 +18 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-tui",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "A Node TUI Oxlint rules and configuration browser",
5
5
  "type": "module",
6
6
  "bin": {
package/tui.js CHANGED
@@ -96,23 +96,34 @@ function runLint(type_aware) {
96
96
  : `npx -q --yes --package oxlint@${OXLINT_VERSION} -- oxlint`;
97
97
 
98
98
  exec(cmd, (error, stdout, stderr) => {
99
- const fullOutput = stdout + stderr;
100
-
101
- const summaryMatch = fullOutput.match(/Found (\d+) warnings? and (\d+) errors?/i);
102
-
103
99
  state.isLinting = false;
104
100
 
101
+ const summaryMatch = stdout.match(/Found (\d+) warnings? and (\d+) errors?/i);
102
+
105
103
  if (summaryMatch) {
106
104
  state.message = summaryMatch[0].trim();
107
105
  const errors = parseInt(summaryMatch[2]);
108
106
  state.messageType = errors > 0 ? "error" : "warn";
109
- } else if (!error || (error.code === 0)) {
107
+ }
108
+ else if (stdout.includes("Finished") || (!error && stdout.trim() === "")) {
110
109
  state.message = "Linting passed! 0 issues found.";
111
110
  state.messageType = "success";
112
- } else {
113
- state.message = `Error: ${stderr.split('\n')[0] || "Unknown issue"}`;
111
+ }
112
+ else if (error || stderr.trim().length > 0) {
113
+ const realErrors = stderr
114
+ .split('\n')
115
+ .filter(line => !line.includes("JS plugins are experimental"))
116
+ .join(' ')
117
+ .trim();
118
+
119
+ state.message = realErrors ? `Error: ${realErrors.substring(0, 50)}` : "Linting failed";
114
120
  state.messageType = "error";
115
121
  }
122
+ else {
123
+ state.message = "Unknown state";
124
+ state.messageType = "dim";
125
+ }
126
+
116
127
  render();
117
128
  });
118
129
  }