oxlint-tui 1.0.17 → 1.0.19

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 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-tui",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "A Node TUI Oxlint rules and configuration browser",
5
5
  "type": "module",
6
6
  "bin": {
package/tui.js CHANGED
@@ -81,13 +81,18 @@ function updateConfig(rule, newStatus) {
81
81
  }
82
82
  }
83
83
 
84
- function runLint({ typeAware = false, rule = null } = {}) {
84
+ function runLint({ rule = null } = {}) {
85
85
  if (state.isLinting) return;
86
86
 
87
87
  state.isLinting = true;
88
88
 
89
89
  let ruleName = rule ? `${rule.scope}/${rule.value}` : null;
90
- typeAware = typeAware || rule?.type_aware;
90
+
91
+ const typeAware = rule
92
+ ? rule.type_aware
93
+ : Object.values(state.rulesByCategory)
94
+ .flat()
95
+ .some((rule) => rule.isActive && rule.type_aware === true);
91
96
 
92
97
  state.message = "Linting";
93
98
  if (ruleName) state.message += ` [${ruleName}]`;
@@ -192,12 +197,6 @@ function execute(action) {
192
197
  return;
193
198
 
194
199
  case "RUN_LINT":
195
- const allRules = Object.values(state.rulesByCategory).flat();
196
- const hasActiveTypeAwareRule = allRules.some(
197
- (rule) => rule.isActive && rule.type_aware === true
198
- );
199
-
200
- runLint({ typeAware: hasActiveTypeAwareRule });
201
200
  runLint();
202
201
  return;
203
202
 
@@ -358,7 +357,7 @@ function loadRules() {
358
357
  config = JSON.parse(
359
358
  stripJsonComments(fs.readFileSync(configPath, "utf8")),
360
359
  );
361
- } catch (e) { }
360
+ } catch (e) {}
362
361
  }
363
362
 
364
363
  const map = {};