Skip to content

Commit 179a6e3

Browse files
committed
chore: add lint-staged config
1 parent 049252d commit 179a6e3

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.lintstagedrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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],
10+
};

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
"format": "prettier --write .",
1212
"prepack": "husky install"
1313
},
14-
"lint-staged": {
15-
"*.{js,ts,tsx}": [
16-
"next lint --fix"
17-
]
18-
},
1914
"dependencies": {
2015
"@notionhq/client": "^2.2.0",
2116
"fast-glob": "^3.2.11",
@@ -44,7 +39,7 @@
4439
"@types/react": "^18.0.18",
4540
"@types/styled-components": "^5.1.26",
4641
"@types/styled-system": "^5.1.15",
47-
"@typescript-eslint/parser": "^5.36.1",
42+
"@typescript-eslint/parser": "^5.36.2",
4843
"eslint": "^8.23.0",
4944
"eslint-config-next": "^12.2.5",
5045
"eslint-config-prettier": "^8.5.0",

0 commit comments

Comments
 (0)