@naturalcycles/dev-lib 20.43.1 → 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 +16 -6
- package/package.json +1 -1
|
@@ -69,16 +69,12 @@ const stylelintCmd = stylelintExists ? `stylelint --fix --config ${stylelintConf
|
|
|
69
69
|
|
|
70
70
|
const linters = {
|
|
71
71
|
// oxlint, eslint, stylelint, oxfmt
|
|
72
|
-
[
|
|
73
|
-
runOxlintEslintStylelintOxfmt(match),
|
|
74
|
-
|
|
75
|
-
// Files in root dir: oxfmt
|
|
76
|
-
[`./*.{${prettierExtensionsAll}}`]: runOxfmt,
|
|
72
|
+
[`./**/*.{${prettierExtensionsAll}}`]: match => runOxlintEslintStylelintOxfmt(match),
|
|
77
73
|
|
|
78
74
|
// ktlint
|
|
79
75
|
'**/*.{kt,kts}': runKtlint,
|
|
80
76
|
|
|
81
|
-
'./.github/**/*.{yml,yaml}':
|
|
77
|
+
'./.github/**/*.{yml,yaml}': runActionlint,
|
|
82
78
|
}
|
|
83
79
|
|
|
84
80
|
export function runOxlintEslintStylelintOxfmt(match) {
|
|
@@ -115,6 +111,20 @@ export function runKtlint(match) {
|
|
|
115
111
|
return [`${dir}/resources/ktlint -F ${filesList}`]
|
|
116
112
|
}
|
|
117
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
|
+
|
|
118
128
|
export function runActionlintOxfmt(match) {
|
|
119
129
|
if (!match.length) return []
|
|
120
130
|
|