@7n/rules 1.7.2 → 1.7.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.7.3] - 2026-07-16
4
+
5
+ ### Fixed
6
+
7
+ - Краш oxlint (напр. відсутній jsPlugin з канонічного `.oxlintrc.json`) тепер показує exit-код і хвости stderr/stdout замість глухого «json не розпарсено» — причину видно на CI одразу
8
+
3
9
  ## [1.7.2] - 2026-07-16
4
10
 
5
11
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7n/rules",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "CLI еталонних правил і skills (префікс n-): синк у репозиторій, дельта-lint, конформність",
5
5
  "keywords": [
6
6
  "cli",
@@ -63,8 +63,8 @@
63
63
  "rename-yaml-extensions": "bun ./bin/n-rules.js rename-yaml-extensions"
64
64
  },
65
65
  "dependencies": {
66
- "@7n/mt": "^0.5.1",
67
66
  "@7n/llm-lib": "^2.0.0",
67
+ "@7n/mt": "^0.5.1",
68
68
  "@zed-industries/agent-client-protocol": "^0.4.5",
69
69
  "ajv": "^8.20.0",
70
70
  "cli-progress": "^3.12.0",
@@ -3,7 +3,7 @@ type: JS Module
3
3
  title: main.mjs
4
4
  resource: npm/rules/js/eslint/main.mjs
5
5
  docgen:
6
- crc: 11a1340b
6
+ crc: 2d36631f
7
7
  model: omlx/gemma-4-e4b-it-OptiQ-4bit
8
8
  score: 100
9
9
  issues: judge:inaccurate:0.99
@@ -31,3 +31,5 @@ lint — проводить статичний аналіз коду (пофай
31
31
  - Перехоплює помилки і не пропускає винятків назовні (fail-safe).
32
32
 
33
33
  **warnIgnored: false.** ESLint конструюється з `warnIgnored: false` — файли з delta-списку, що матчать ignore-патерни `eslint.config.js` (наприклад, синковані `.pi/extensions/**` чи згенеровані `npm/types/**`), не рахуються порушеннями.
34
+
35
+ **Діагностика крашу oxlint.** Якщо oxlint завершився помилкою і json не розпарсено, у повідомлення DetectorError включаються exit-код і хвости stderr/stdout — інакше на CI причина (відсутній jsPlugin, конфіг, OOM) невидима.
@@ -24,11 +24,11 @@ export function filterJsFiles(files) {
24
24
  /**
25
25
  * @param {string[]} args аргументи запуску oxlint
26
26
  * @param {string} cwd робочий каталог
27
- * @returns {{ status: number, stdout: string }} код завершення й stdout процесу
27
+ * @returns {{ status: number, stdout: string, stderr: string }} код завершення, stdout і stderr процесу
28
28
  */
29
29
  function runOxlintJson(args, cwd) {
30
30
  const r = spawnSync('bunx', args, { cwd, encoding: 'utf8', maxBuffer: JSON_MAX_BUFFER })
31
- return { status: typeof r.status === 'number' ? r.status : 1, stdout: r.stdout ?? '' }
31
+ return { status: typeof r.status === 'number' ? r.status : 1, stdout: r.stdout ?? '', stderr: r.stderr ?? '' }
32
32
  }
33
33
 
34
34
  /**
@@ -64,7 +64,15 @@ async function collectFindings(js, cwd) {
64
64
  const oxRes = runOxlintJson(oxArgs, cwd)
65
65
  const ox = parseOxlint(oxRes.stdout)
66
66
  if (ox === null && oxRes.status !== 0) {
67
- throw new Error('oxlint завершився з помилкою (не lint-порушення) json не розпарсено')
67
+ // Хвости stdout/stderr інакше на CI причина крашу (OOM, конфіг, версія) невидима.
68
+ const tail = [oxRes.stderr, oxRes.stdout]
69
+ .map(t => t.trim().slice(-500))
70
+ .filter(t => t !== '')
71
+ .join('\n--- stdout: ')
72
+ const suffix = tail === '' ? '' : `\n${tail}`
73
+ throw new Error(
74
+ `oxlint завершився з помилкою (exit ${oxRes.status}, не lint-порушення) — json не розпарсено${suffix}`
75
+ )
68
76
  }
69
77
  return [...(ox ?? []), ...es]
70
78
  }