oxlint-tui 1.0.5 → 1.0.6
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 +0 -5
- package/package.json +2 -2
- package/tui.js +5 -2
package/README.md
CHANGED
|
@@ -17,11 +17,6 @@ Configuring linters often involves jumping between your editor, a massive JSON f
|
|
|
17
17
|
* **View Docs**: Press <kbd>ENTER</kbd> on any rule to open its official documentation in your browser.
|
|
18
18
|
* **Zero Dependencies**: Written in pure Node.js without any heavy TUI libraries.
|
|
19
19
|
|
|
20
|
-
## Important note
|
|
21
|
-
|
|
22
|
-
Documentation links and information about fixability are not available in older versions of oxlint.
|
|
23
|
-
This tool was developed using oxlint version 1.41.0.
|
|
24
|
-
|
|
25
20
|
## Usage
|
|
26
21
|
|
|
27
22
|
### Quick Start (via npx)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint-tui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "A Node TUI Oxlint rules and configuration browser",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
13
|
"start": "node tui.js",
|
|
14
|
-
"
|
|
14
|
+
"dev": "node tui.js .oxlintrc.example.json"
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"oxlint",
|
package/tui.js
CHANGED
|
@@ -5,6 +5,8 @@ import { stdout, stdin, exit, platform, argv } from 'node:process';
|
|
|
5
5
|
import readline from 'node:readline';
|
|
6
6
|
import fs from 'node:fs';
|
|
7
7
|
|
|
8
|
+
const OXLINT_VERSION = "1.41.0"
|
|
9
|
+
|
|
8
10
|
const COLORS = {
|
|
9
11
|
reset: '\x1b[0m',
|
|
10
12
|
dim: '\x1b[90m',
|
|
@@ -43,7 +45,8 @@ function reducer(state, action) {
|
|
|
43
45
|
|
|
44
46
|
switch (action.type) {
|
|
45
47
|
case 'MOVE_RIGHT':
|
|
46
|
-
|
|
48
|
+
if (activePane !== 1)
|
|
49
|
+
return { ...state, activePane: Math.min(2, activePane + 1) };
|
|
47
50
|
|
|
48
51
|
case 'MOVE_LEFT':
|
|
49
52
|
return { ...state, activePane: Math.max(0, activePane - 1) };
|
|
@@ -126,7 +129,7 @@ function loadRules() {
|
|
|
126
129
|
let config = { rules: {}, categories: {} };
|
|
127
130
|
|
|
128
131
|
try {
|
|
129
|
-
const raw = execSync(
|
|
132
|
+
const raw = execSync(`npx --yes oxlint@${OXLINT_VERSION} --rules --format=json`, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] });
|
|
130
133
|
rulesData = JSON.parse(raw);
|
|
131
134
|
} catch (e) {
|
|
132
135
|
console.error(`${COLORS.error}Error: Could not run 'npx oxlint'. Ensure oxlint is installed.${COLORS.reset}`);
|