Skip to content

Commit

Permalink
Fix a conflict between lint-staged and tsc
Browse files Browse the repository at this point in the history
lint-staged passed a list of files to tsc.  tsc cannot find its
configuration when this happens.  For the workaround, see
lint-staged/lint-staged#825.
  • Loading branch information
epineapple committed May 9, 2024
1 parent ad28d3e commit ba4e17a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lint-staged.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ export default {
"*.json": ["prettier --write"],
"*.md": ["prettier --write"],
"*.mjs": ["eslint", "prettier --write"],
"*.ts": ["eslint", "prettier --write", "tsc --noEmit"],
"*.ts": [
"eslint",
"prettier --write",
// Call TypeScript compiler through a function to avoid getting a list of
// files passed to it.
// https://github.com/lint-staged/lint-staged/issues/825
() => "tsc --noEmit",
],
"*.yaml": ["prettier --write"],
};

0 comments on commit ba4e17a

Please sign in to comment.