@naturalcycles/dev-lib 20.37.0 → 20.38.0

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.
@@ -50,16 +50,7 @@ if (eslintConfigPath) {
50
50
  let oxlintCmd = undefined
51
51
 
52
52
  if (oxlintConfigPath) {
53
- oxlintCmd = [
54
- 'oxlint',
55
- // '--report-unused-disable-directives', // wrongly reports disabled eslint (not oxlint) rules
56
- '--type-aware',
57
- '--type-check',
58
- '--fix',
59
- '--fix-suggestions',
60
- '--fix-dangerously',
61
- '--max-warnings=0',
62
- ]
53
+ oxlintCmd = ['oxlint', '--fix', '--fix-suggestions', '--fix-dangerously']
63
54
  .filter(Boolean)
64
55
  .join(' ')
65
56
  }
@@ -18,6 +18,9 @@
18
18
  ],
19
19
  "jsPlugins": ["./oxlint-plugin-stylistic.mjs"],
20
20
  "options": {
21
+ "reportUnusedDisableDirectives": "deny",
22
+ "maxWarnings": 0,
23
+ "denyWarnings": true,
21
24
  "typeAware": true,
22
25
  "typeCheck": true
23
26
  },
@@ -4,7 +4,7 @@ import { _ms } from '@naturalcycles/js-lib/datetime'
4
4
  * A minimal reporter that only shows failures and the final summary.
5
5
  * No per-test, no per-file output - just failures and final summary.
6
6
  *
7
- * Use via: VITEST_REPORTER=summary vitest run
7
+ * @deprecated because 'agent' reported is introduced and is better
8
8
  */
9
9
  export class SummaryOnlyReporter {
10
10
  onTestRunEnd(testModules) {
@@ -23,5 +23,3 @@ export function getSharedConfig(cwd?: string): InlineConfig
23
23
  export const CollectReporter: any
24
24
 
25
25
  export class SummaryReporter {}
26
-
27
- export class SummaryOnlyReporter {}
@@ -1,11 +1,10 @@
1
1
  import fs from 'node:fs'
2
+ import { isAgent } from 'std-env'
2
3
  import { defineConfig } from 'vitest/config'
3
- import { SummaryOnlyReporter } from './summaryOnlyReporter.js'
4
4
  import { SummaryReporter } from './summaryReporter.js'
5
5
  import { VitestAlphabeticSequencer } from './vitestAlphabeticSequencer.js'
6
6
  export { SummaryReporter } from './summaryReporter.js'
7
7
  export { CollectReporter } from './collectReporter.js'
8
- export { SummaryOnlyReporter } from './summaryOnlyReporter.js'
9
8
 
10
9
  const runsInIDE = doesItRunInIDE()
11
10
  const testType = getTestType(runsInIDE)
@@ -124,18 +123,18 @@ export function getSharedConfig(cwd) {
124
123
 
125
124
  function getReporters(junitReporterEnabled, testType) {
126
125
  // VITEST_REPORTER env var allows overriding the default reporter
127
- // e.g., VITEST_REPORTER=summary for minimal output
128
- const { VITEST_REPORTER, CLAUDE_CODE } = process.env
129
-
130
- if (VITEST_REPORTER === 'summary' || CLAUDE_CODE) {
131
- return [new SummaryOnlyReporter()]
126
+ const { VITEST_REPORTER, GITHUB_ACTIONS } = process.env
127
+ if (VITEST_REPORTER) {
128
+ return [VITEST_REPORTER]
132
129
  }
133
- if (VITEST_REPORTER === 'dot') {
134
- return ['dot']
130
+
131
+ if (isAgent) {
132
+ return ['agent']
135
133
  }
136
134
 
137
135
  return [
138
136
  'default',
137
+ GITHUB_ACTIONS && 'github-actions',
139
138
  new SummaryReporter(),
140
139
  junitReporterEnabled && [
141
140
  'junit',
@@ -202,15 +202,7 @@ export function runOxlint(fix = true) {
202
202
  const oxlintPath = findPackageBinPath('oxlint', 'oxlint');
203
203
  exec2.spawn(oxlintPath, {
204
204
  name: ['oxlint', !fix && '--no-fix'].filter(Boolean).join(' '),
205
- args: [
206
- // '--report-unused-disable-directives', // wrongly reports disabled eslint (not oxlint) rules
207
- '--max-warnings=0',
208
- '--type-aware',
209
- '--type-check',
210
- fix && '--fix',
211
- fix && '--fix-suggestions',
212
- fix && '--fix-dangerously',
213
- ].filter(_isTruthy),
205
+ args: [fix && '--fix', fix && '--fix-suggestions', fix && '--fix-dangerously'].filter(_isTruthy),
214
206
  shell: false,
215
207
  });
216
208
  return true;
@@ -1,7 +1,6 @@
1
1
  import { createRequire } from 'node:module';
2
2
  // Use require() to get mutable module objects (ESM namespace objects are frozen)
3
3
  const require = createRequire(import.meta.url);
4
- /* eslint-disable @typescript-eslint/naming-convention -- vendored code uses PascalCase for modules */
5
4
  const Net = require('node:net');
6
5
  const Tls = require('node:tls');
7
6
  const Http = require('node:http');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
3
  "type": "module",
4
- "version": "20.37.0",
4
+ "version": "20.38.0",
5
5
  "dependencies": {
6
6
  "prompts": "^2",
7
7
  "@naturalcycles/js-lib": "^15",
@@ -13,7 +13,8 @@
13
13
  "micromatch": "^4",
14
14
  "oxfmt": "^0",
15
15
  "oxlint": "^1",
16
- "oxlint-tsgolint": "^0"
16
+ "oxlint-tsgolint": "^0",
17
+ "std-env": "^4"
17
18
  },
18
19
  "peerDependencies": {
19
20
  "@eslint/js": "^9",