Skip to content

Commit e1faffa

Browse files
committed
chore: better linting during commits
This will help catch issues before committing. Also having the configuration outside of `package.json` makes it easier to add comments.
1 parent 707d3b6 commit e1faffa

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

lint-staged.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
'*.{js,ts}': [
3+
'prettier --write',
4+
'eslint',
5+
// `lint:ts` can't receive files that doesn't know how to build/parse, thus
6+
// we ignore any files passed in from lint-staged here.
7+
() => 'yarn lint:ts',
8+
],
9+
'*.{json,md,yml}': ['prettier --write'],
10+
};

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@
6161
"engines": {
6262
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
6363
},
64-
"lint-staged": {
65-
"*.{js,ts,css,md,yml}": "prettier --write"
66-
},
6764
"standard-version": {
6865
"scripts": {
6966
"postchangelog": "prettier --write CHANGELOG.md"

0 commit comments

Comments
 (0)