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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tui.js +9 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-tui",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
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,25 @@ 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
99
  const fullOutput = stdout + stderr;
100
- const summaryMatch = fullOutput.match(
101
- /Found (\d+) warnings? and (\d+) errors?/,
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 = "Something went wrong";
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"],