From 9eb91429be05e2eab9379902f6f85e7954d06551 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 31 Aug 2023 15:24:43 +0800 Subject: [PATCH] chore: fix lint-staged --- package.json | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 644239d3..eb3a5163 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,8 @@ "preview:dist": "vite preview", "clean:cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite", "clean:lib": "rimraf node_modules", - "lint": "eslint .", - "lint:fix": "eslint . --fix", + "lint": "eslint \"src/**/*.{vue,ts,tsx}\"", + "lint:fix": "eslint \"src/**/*.{vue,ts,tsx}\" --fix", "lint:stylelint": "stylelint \"**/*.{vue,css,less,scss}\" --fix --cache --cache-location node_modules/.cache/stylelint/", "lint:lint-staged": "lint-staged", "npm:check": "npx npm-check-updates", @@ -142,7 +142,28 @@ "vue-tsc": "^1.8.8" }, "lint-staged": { - "*": "eslint --fix" + "*.{js,jsx,ts,tsx}": [ + "prettier --write", + "eslint --fix" + ], + "{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [ + "prettier --write--parser json" + ], + "package.json": [ + "prettier --write" + ], + "*.vue": [ + "prettier --write", + "eslint --fix", + "stylelint --fix" + ], + "*.{scss,less,styl,html}": [ + "prettier --write", + "stylelint --fix" + ], + "*.md": [ + "prettier --write" + ] }, "config": { "commitizen": {