oxlint-tui 1.0.16 → 1.0.17
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/README.md +2 -5
- package/package.json +1 -1
- package/tui.js +8 -3
package/README.md
CHANGED
|
@@ -6,8 +6,6 @@ A lightweight, dependency-free Node.js Terminal User Interface (TUI) for browsin
|
|
|
6
6
|
|
|
7
7
|
It automatically loads your local configuration to show you the status of the rules toggled in your project and allows you to toggle them by selecting a rule in the Rules pane and pressing <kbd>1</kbd>, <kbd>2</kbd>, or <kbd>3</kbd>. The config file is modified in real-time.
|
|
8
8
|
|
|
9
|
-
Pressing <kbd>r</kbd> will lint the project using "oxlint". Pressing <kbd>t</kbd> will lint include the oxlint-tsgolint package and lint the project using "oxlint --type-aware". The results are presented directly in the interface.
|
|
10
|
-
|
|
11
9
|
**NOTE**: At the moment, comments will be erased from your configuration file when adding or toggling rules.
|
|
12
10
|
|
|
13
11
|

|
|
@@ -62,9 +60,8 @@ oxlint-tui
|
|
|
62
60
|
| **1** | Set selected rule to "off" |
|
|
63
61
|
| **2** | Set selected rule to "warn" |
|
|
64
62
|
| **3** | Set selected rule to "error" |
|
|
65
|
-
| **x** | Run the selected rule |
|
|
66
|
-
| **r** | Run all enabled rules
|
|
67
|
-
| **t** | Run all enabled rules with "-p oxlint-tsgolint@latest oxlint --type-aware" |
|
|
63
|
+
| **x** | Run "oxlint" with the selected rule |
|
|
64
|
+
| **r** | Run "oxlint with all enabled rules |
|
|
68
65
|
| **Enter** | Open Rule Documentation in Browser |
|
|
69
66
|
| **q** / **Esc** | Quit |
|
|
70
67
|
|
package/package.json
CHANGED
package/tui.js
CHANGED
|
@@ -37,7 +37,6 @@ const KEY_MAP = {
|
|
|
37
37
|
3: { type: "SET_STATUS", value: "error" },
|
|
38
38
|
q: { type: "EXIT" },
|
|
39
39
|
r: { type: "RUN_LINT" },
|
|
40
|
-
t: { type: "RUN_TYPE_AWARE_LINT" },
|
|
41
40
|
x: { type: "RUN_SINGLE_RULE" },
|
|
42
41
|
};
|
|
43
42
|
|
|
@@ -193,6 +192,12 @@ function execute(action) {
|
|
|
193
192
|
return;
|
|
194
193
|
|
|
195
194
|
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 });
|
|
196
201
|
runLint();
|
|
197
202
|
return;
|
|
198
203
|
|
|
@@ -353,7 +358,7 @@ function loadRules() {
|
|
|
353
358
|
config = JSON.parse(
|
|
354
359
|
stripJsonComments(fs.readFileSync(configPath, "utf8")),
|
|
355
360
|
);
|
|
356
|
-
} catch (e) {}
|
|
361
|
+
} catch (e) { }
|
|
357
362
|
}
|
|
358
363
|
|
|
359
364
|
const map = {};
|
|
@@ -614,7 +619,7 @@ function render() {
|
|
|
614
619
|
? `Config: ${state.configPath}`
|
|
615
620
|
: "No config loaded";
|
|
616
621
|
buffer.push(
|
|
617
|
-
`\x1b[${rows - 1};2H${COLORS.dim}Arrows/HJKL: Nav | 1-3: Status | R: Lint |
|
|
622
|
+
`\x1b[${rows - 1};2H${COLORS.dim}Arrows/HJKL: Nav | 1-3: Status | R: Lint | X: Run rule | Enter: Docs | Q: Quit | ${footerConfig}${COLORS.reset}`,
|
|
618
623
|
);
|
|
619
624
|
write(buffer.join(""));
|
|
620
625
|
}
|