Skip to content

Commit

Permalink
Upgrade husky and lint-staged
Browse files Browse the repository at this point in the history
Closes #205.
  • Loading branch information
niksy committed Mar 25, 2024
1 parent accd71a commit 7e72bef
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 16 deletions.
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
5 changes: 0 additions & 5 deletions .huskyrc

This file was deleted.

2 changes: 1 addition & 1 deletion generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ export default class extends Generator {
cp('eslintrc', '.eslintrc');
cp('gitignore', '.gitignore');
cp('npmrc', '.npmrc');
cp('huskyrc', '.huskyrc');
cp('husky', '.husky');
cp('lintstagedrc', '.lintstagedrc');

// Remove old references
Expand Down
5 changes: 3 additions & 2 deletions generators/app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"test": "test"
},<% } %>
"scripts": {
"prepare": "if [[ -x \"$(command -v husky)\" ]]; then husky; fi",
"release": "np --no-release-draft",<% if ( changelog ) { %>
"version": "if [ $(git rev-parse --abbrev-ref HEAD) == 'master' ]; then sed -i '' '/\\[unreleased\\]:/d' CHANGELOG.md && version-changelog CHANGELOG.md && changelog-verify CHANGELOG.md && git add CHANGELOG.md; else echo; fi"<% if ( githubRelease ) { %>,
"postpublish": "GITHUB_TOKEN=$GITHUB_RELEASE_TOKEN github-release-from-changelog"<% } %>,<% } %><% if ( (automatedTests && browserModule && !sassModule) || manualTests || integrationTests ) { %>
Expand Down Expand Up @@ -63,8 +64,8 @@
},
"devDependencies": {
"@istanbuljs/esm-loader-hook": "^0.2.0",
"husky": "^4.3.0",
"lint-staged": "^10.4.2",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"np": "^7.6.0",<% if ( prettier ) { %>
"prettier": "^2.4.0",<% } %>
"eslint": "^8.5.0",
Expand Down
1 change: 1 addition & 0 deletions generators/app/templates/husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
5 changes: 0 additions & 5 deletions generators/app/templates/huskyrc

This file was deleted.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"README.md"
],
"scripts": {
"prepare": "if [[ -x \"$(command -v husky)\" ]]; then husky; fi",
"lint": "eslint '{generators/app/index,test/index}.js'",
"release": "np --no-release-draft",
"prerelease": "npm run lint",
Expand All @@ -37,8 +38,8 @@
"eslint-config-nitpick": "^11.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^4.3.0",
"lint-staged": "^10.4.2",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"mocha": "^9.1.3",
"nodemon": "^2.0.6",
"np": "^7.6.0",
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('New project', function () {
'.eslintrc',
'.gitignore',
'.npmrc',
'.huskyrc',
'.husky',
'.lintstagedrc',
'index.js',
'LICENSE.md',
Expand Down

0 comments on commit 7e72bef

Please sign in to comment.