lint-staged 17.0.4 → 17.0.5
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/lib/cli.js +10 -1
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -167,6 +167,15 @@ export const parseCliOptions = (argv) => {
|
|
|
167
167
|
values['hide-unstaged'] = false // becomes redundant
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
const maxArgLength =
|
|
171
|
+
values['max-arg-length'] !== undefined ? parseInt(values['max-arg-length'], 10) : undefined
|
|
172
|
+
|
|
173
|
+
if (Number.isNaN(maxArgLength)) {
|
|
174
|
+
throw new TypeError(`Option '--mar-arg-length' takes a numeric argument`, {
|
|
175
|
+
cause: { '--max-arg-length': values['max-arg-length'] },
|
|
176
|
+
})
|
|
177
|
+
}
|
|
178
|
+
|
|
170
179
|
return {
|
|
171
180
|
allowEmpty: values['allow-empty'] ?? false,
|
|
172
181
|
concurrent: values.concurrent === undefined ? true : JSON.parse(values.concurrent),
|
|
@@ -181,7 +190,7 @@ export const parseCliOptions = (argv) => {
|
|
|
181
190
|
hidePartiallyStaged: values['hide-partially-staged'] ?? true,
|
|
182
191
|
hideUnstaged: !!values['hide-unstaged'],
|
|
183
192
|
hideAll: !!values['hide-all'],
|
|
184
|
-
maxArgLength
|
|
193
|
+
maxArgLength,
|
|
185
194
|
quiet: !!values.quiet,
|
|
186
195
|
relative: !!values.relative,
|
|
187
196
|
revert: values.revert ?? true,
|