Minor Changes
-
#1825
16b3f74- It is now possible to run multiple tasks in parallel for a single glob by configuring it with an array of tasks (which run sequentially), and then placing another array inside it (where the tasks will run in parallel). The following demonstrates the order tasks will start in:{ "*.ts": ["first", "second", ["third", "third"], "fourth"] }As a concrete example, lint-staged's own configuration is:
/** @type {import('./lib/index.js').Configuration} */ export default { "*": [ [ "oxfmt --check --no-error-on-unmatched-pattern", "oxlint --no-error-on-unmatched-pattern", ], ], "*.ts": () => "tsc", };
which means:
- for all staged files, run the two commands in parallel with staged filenames appended, for example:
oxfmt --check --no-error-on-unmatched-pattern lib/index.jsoxlint --no-error-on-unmatched-pattern lib/index.js
- additionally, if any
*.tsfiles are staged, runtscwithout appending any arguments - The two sets of commands also run in parallel
- for all staged files, run the two commands in parallel with staged filenames appended, for example: