forked from remeda/remeda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlint-staged.config.mjs
18 lines (16 loc) · 976 Bytes
/
lint-staged.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
export default {
// The Typescript compiler can't type-check a single file, it needs to run on
// the whole project. To do that we use a function (instead of a string or
// array) so that no matter what file or how many, we will always run the same
// command.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -- this is stupid...
"*.ts?(x)": () => "tsc -p tsconfig.json --noEmit",
// Javascript and Typescript (including commonJs and esm variants)
"*.@(js|jsx|ts|tsx|cjs|mjs)": ["eslint --fix", "prettier --write"],
// _try_ prettier on anything, it supports a lot of things! If this is touching a file
// you don't want add it to .prettierignore.
// lint-staged runs *all* matching rules and doesn't have an "anything else" rule, so
// instead, we add all previous file extensions to the glob here so it doesn't run on
// any of those files.
"!(*.@(js|jsx|ts|tsx|cjs|mjs))": "prettier --ignore-unknown --write",
};