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.
Files changed (2) hide show
  1. package/lib/cli.js +10 -1
  2. 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: parseInt(values['max-arg-length'], 10),
193
+ maxArgLength,
185
194
  quiet: !!values.quiet,
186
195
  relative: !!values.relative,
187
196
  revert: values.revert ?? true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lint-staged",
3
- "version": "17.0.4",
3
+ "version": "17.0.5",
4
4
  "description": "Lint files staged by git",
5
5
  "license": "MIT",
6
6
  "repository": {