Skip to content

Commit

Permalink
Fix lint-staged command for package.json files (#918)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrm007 committed Jan 16, 2024
1 parent c01f13a commit f77940d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/metal-hairs-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'sku': patch
---

Fix running lint-staged when `package.json` files are staged
7 changes: 4 additions & 3 deletions packages/sku/config/lintStaged/lintStagedConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ const config = {

// Yarn lock integrity check
if (isYarn) {
config['+(package.json|yarn.lock)'] = [
getCommand('yarn', 'install', ['--check-files']),
];
config['+(package.json|yarn.lock)'] =
// The function form allows running the command without file arguments
// https://github.com/lint-staged/lint-staged#example-run-tsc-on-changes-to-typescript-files-but-do-not-pass-any-filename-arguments
() => getCommand('yarn', 'install', ['--check-files']);
}

module.exports = config;

0 comments on commit f77940d

Please sign in to comment.