Skip to content

Commit 10415a4

Browse files
committed
ci: move lint-staged settings from package.json to .lintstagedrc.js
1 parent 57501df commit 10415a4

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

.lintstagedrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const path = require('path');
2+
3+
const buildEslintCommand = (filenames) =>
4+
`next lint --fix --file ${filenames
5+
.map((f) => path.relative(process.cwd(), f))
6+
.join(' --file ')}`;
7+
8+
module.exports = {
9+
'*.{js,jsx,ts,tsx}': [buildEslintCommand, 'prettier --write'],
10+
'*.{json,md,css,scss,html}': ['prettier --write'],
11+
};

package.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@
1111
"format": "prettier --write .",
1212
"prepare": "husky"
1313
},
14-
"lint-staged": {
15-
"*.{js,ts,jsx,tsx}": [
16-
"next lint --fix",
17-
"prettier --write"
18-
],
19-
"*.{json,md,css,scss,html}": [
20-
"prettier --write"
21-
]
22-
},
2314
"dependencies": {
2415
"@mdx-js/loader": "^3.1.0",
2516
"@mdx-js/react": "^3.1.0",

0 commit comments

Comments
 (0)