@naturalcycles/dev-lib 20.31.1 → 20.31.2

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/cfg/biome.jsonc CHANGED
@@ -2,7 +2,18 @@
2
2
  "$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
3
3
  "root": false,
4
4
  "files": {
5
- "includes": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx", "!**/__exclude", "!**/try.ts"],
5
+ "includes": [
6
+ "**/*.ts",
7
+ "**/*.tsx",
8
+ "**/*.js",
9
+ "**/*.jsx",
10
+ "!**/__exclude",
11
+ "!tmp",
12
+ "!coverage",
13
+ "!deploy",
14
+ "!dist",
15
+ "!**/try.ts",
16
+ ],
6
17
  },
7
18
  "formatter": {
8
19
  "enabled": true,
@@ -7,7 +7,6 @@ const {
7
7
  platform,
8
8
  arch,
9
9
  versions: { node },
10
- // env: { ESLINT_CONCURRENCY },
11
10
  } = process
12
11
 
13
12
  console.log(`lint-staged.config.js runs on node ${node} ${platform} ${arch}`)
@@ -43,9 +42,6 @@ if (eslintConfigPath) {
43
42
  `--config ${eslintConfigPath}`,
44
43
  '--cache',
45
44
  '--cache-location node_modules/.cache/eslint',
46
- // concurrency is disabled here, as it's not expected to help,
47
- // since we're running on a limited set of files already
48
- // ESLINT_CONCURRENCY && `--concurrency=${ESLINT_CONCURRENCY}`,
49
45
  ]
50
46
  .filter(Boolean)
51
47
  .join(' ')
@@ -88,7 +84,7 @@ const linters = {
88
84
  // ktlint
89
85
  '**/*.{kt,kts}': runKtlint,
90
86
 
91
- './.github/**/*.{yml,yaml}': runActionlint,
87
+ './.github/**/*.{yml,yaml}': runActionlintOxfmt,
92
88
  }
93
89
 
94
90
  export function runBiomeEslintStylelintOxfmt(match) {
@@ -131,20 +127,26 @@ export function runKtlint(match) {
131
127
  return [`${dir}/resources/ktlint -F ${filesList}`]
132
128
  }
133
129
 
134
- export function runActionlint(match) {
130
+ export function runActionlintOxfmt(match) {
135
131
  if (!match.length) return []
136
132
 
137
- if (!canRunBinary('actionlint')) {
133
+ const tools = []
134
+
135
+ if (canRunBinary('actionlint')) {
136
+ requireActionlintVersion()
137
+ // run actionlint on all files at once, as it's fast anyway
138
+ tools.push('actionlint')
139
+ } else {
138
140
  console.log(
139
141
  `actionlint is not installed and won't be run.\nThis is how to install it: https://github.com/rhysd/actionlint/blob/main/docs/install.md`,
140
142
  )
141
- return []
142
143
  }
143
144
 
144
- requireActionlintVersion()
145
+ if (oxfmtCmd) {
146
+ tools.push(oxfmtCmd)
147
+ }
145
148
 
146
- // run actionlint on all files at once, as it's fast anyway
147
- return [`actionlint`]
149
+ return tools
148
150
  }
149
151
 
150
152
  function getFilesList(match) {
@@ -16,7 +16,7 @@ import { kpySync } from '@naturalcycles/nodejs-lib/kpy';
16
16
  import { _yargs } from '@naturalcycles/nodejs-lib/yargs';
17
17
  import { eslintExtensions, lintExclude, minActionlintVersion, prettierDirs, stylelintExtensions, } from '../cfg/_cnst.js';
18
18
  import { cfgDir } from './paths.js';
19
- const { CI, ESLINT_CONCURRENCY } = process.env;
19
+ const { CI } = process.env;
20
20
  /**
21
21
  * Run all linters.
22
22
  *
@@ -178,7 +178,6 @@ function runESLint(extensions = eslintExtensions.split(','), fix = true) {
178
178
  // `--parser-options=project:${tsconfigPath}`,
179
179
  // The next line fixes the `typescript-eslint` 8.37 bug of resolving tsconfig.json
180
180
  // `--parser-options=tsconfigRootDir:${tsconfigRootDir}`,
181
- ESLINT_CONCURRENCY && `--concurrency=${ESLINT_CONCURRENCY}`,
182
181
  '--cache',
183
182
  '--cache-location',
184
183
  cacheLocation,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
3
  "type": "module",
4
- "version": "20.31.1",
4
+ "version": "20.31.2",
5
5
  "dependencies": {
6
6
  "@biomejs/biome": "^2",
7
7
  "prompts": "^2",