@naturalcycles/dev-lib 20.43.0 → 20.43.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/lint-staged.config.js +23 -7
- package/dist/check.util.js +6 -1
- package/package.json +4 -4
|
@@ -50,7 +50,13 @@ if (eslintConfigPath) {
|
|
|
50
50
|
let oxlintCmd = undefined
|
|
51
51
|
|
|
52
52
|
if (oxlintConfigPath) {
|
|
53
|
-
oxlintCmd = [
|
|
53
|
+
oxlintCmd = [
|
|
54
|
+
'oxlint',
|
|
55
|
+
'--fix',
|
|
56
|
+
'--fix-suggestions',
|
|
57
|
+
'--fix-dangerously',
|
|
58
|
+
'--no-error-on-unmatched-pattern',
|
|
59
|
+
]
|
|
54
60
|
.filter(Boolean)
|
|
55
61
|
.join(' ')
|
|
56
62
|
}
|
|
@@ -63,16 +69,12 @@ const stylelintCmd = stylelintExists ? `stylelint --fix --config ${stylelintConf
|
|
|
63
69
|
|
|
64
70
|
const linters = {
|
|
65
71
|
// oxlint, eslint, stylelint, oxfmt
|
|
66
|
-
[
|
|
67
|
-
runOxlintEslintStylelintOxfmt(match),
|
|
68
|
-
|
|
69
|
-
// Files in root dir: oxfmt
|
|
70
|
-
[`./*.{${prettierExtensionsAll}}`]: runOxfmt,
|
|
72
|
+
[`./**/*.{${prettierExtensionsAll}}`]: match => runOxlintEslintStylelintOxfmt(match),
|
|
71
73
|
|
|
72
74
|
// ktlint
|
|
73
75
|
'**/*.{kt,kts}': runKtlint,
|
|
74
76
|
|
|
75
|
-
'./.github/**/*.{yml,yaml}':
|
|
77
|
+
'./.github/**/*.{yml,yaml}': runActionlint,
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
export function runOxlintEslintStylelintOxfmt(match) {
|
|
@@ -109,6 +111,20 @@ export function runKtlint(match) {
|
|
|
109
111
|
return [`${dir}/resources/ktlint -F ${filesList}`]
|
|
110
112
|
}
|
|
111
113
|
|
|
114
|
+
export function runActionlint(match) {
|
|
115
|
+
if (!match.length) return []
|
|
116
|
+
|
|
117
|
+
if (!canRunBinary('actionlint')) {
|
|
118
|
+
console.log(
|
|
119
|
+
`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`,
|
|
120
|
+
)
|
|
121
|
+
return []
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
requireActionlintVersion()
|
|
125
|
+
return ['actionlint']
|
|
126
|
+
}
|
|
127
|
+
|
|
112
128
|
export function runActionlintOxfmt(match) {
|
|
113
129
|
if (!match.length) return []
|
|
114
130
|
|
package/dist/check.util.js
CHANGED
|
@@ -202,7 +202,12 @@ 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: [
|
|
205
|
+
args: [
|
|
206
|
+
'--no-error-on-unmatched-pattern',
|
|
207
|
+
fix && '--fix',
|
|
208
|
+
fix && '--fix-suggestions',
|
|
209
|
+
fix && '--fix-dangerously',
|
|
210
|
+
].filter(_isTruthy),
|
|
206
211
|
shell: false,
|
|
207
212
|
});
|
|
208
213
|
return true;
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturalcycles/dev-lib",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "20.43.
|
|
4
|
+
"version": "20.43.2",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"prompts": "^2",
|
|
7
6
|
"@naturalcycles/js-lib": "^15",
|
|
8
7
|
"@naturalcycles/nodejs-lib": "^15",
|
|
9
8
|
"@vitest/coverage-v8": "^4",
|
|
10
9
|
"eslint-plugin-oxlint": "^1",
|
|
11
10
|
"globals": "^17",
|
|
12
11
|
"lint-staged": "^16",
|
|
13
|
-
"picomatch": "^4",
|
|
14
12
|
"oxfmt": "^0",
|
|
15
13
|
"oxlint": "^1",
|
|
16
14
|
"oxlint-tsgolint": "^0",
|
|
15
|
+
"picomatch": "^4",
|
|
16
|
+
"prompts": "^2",
|
|
17
17
|
"std-env": "^4"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/node": "^25",
|
|
50
50
|
"@types/prompts": "^2",
|
|
51
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
51
|
+
"@typescript/native-preview": "7.0.0-dev.20260415.1"
|
|
52
52
|
},
|
|
53
53
|
"exports": {
|
|
54
54
|
"./cfg/": "./cfg/",
|