Skip to content

Commit

Permalink
Use lint-staged in husky
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmaguitar committed Feb 17, 2025
1 parent 660db9b commit 8ee15d9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "GPL-2.0-or-later",
"main": "build/index.js",
"scripts": {
"setup": "npm install && composer install && npx husky init && echo \"npm run lint\" > .husky/pre-commit",
"setup": "npm install && composer install && npx husky init && echo \"npx lint-staged\" > .husky/pre-commit",
"start": "wp-scripts start",
"build": "wp-scripts build",
"format": "wp-scripts format",
Expand All @@ -15,9 +15,21 @@
"lint:js": "wp-scripts lint-js --no-error-on-unmatched-pattern",
"prepare": "husky"
},
"lint-staged": {
"*.js": [
"wp-scripts lint-js --ignore-pattern 'public/**/*.js' --ignore-pattern 'build/**/*.js'"
],
"*.php": [
"composer run lint"
],
"*.scss": [
"wp-scripts lint-style"
]
},
"prettier": "@wordpress/prettier-config",
"devDependencies": {
"@wordpress/scripts": "*",
"husky": "^9.1.7"
"husky": "^9.1.7",
"lint-staged": "^13.2.0"
}
}

0 comments on commit 8ee15d9

Please sign in to comment.