-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlint-staged.config.js
29 lines (25 loc) · 998 Bytes
/
lint-staged.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// @ts-check
/**
* This is the base lint-staged rules config and just includes prettier by default.
* A good practice is to override this base configuration in each package and/or application
* where we are able to add customization depending on the nature of the project (eslint...).
*
* {@link https://github.com/okonet/lint-staged#how-to-use-lint-staged-in-a-multi-package-monorepo}
* {@link https://github.com/belgattitude/nextjs-monorepo-example/blob/main/docs/about-lint-staged.md}
*/
const { concatFilesForPrettier } = require("./lint-staged.common.js");
console.log(
"🚀 ~ file: lint-staged.config.js:13 ~ concatFilesForPrettier:",
concatFilesForPrettier
);
/**
* @type {Record<string, (filenames: string[]) => string | string[] | Promise<string | string[]>>}
*/
const rules = {
"**/*.{json,md,mdx,css,html,yml,yaml,scss,ts,js,tsx,jsx,mjs}": (
filenames
) => {
return [`prettier --write ${concatFilesForPrettier(filenames)}`];
},
};
module.exports = rules;