Skip to content

Commit 175d12d

Browse files
authored
Merge pull request #98 from open-wc/updates-husky
feat: update husky to 9.x
2 parents ad8dd25 + 1e14c85 commit 175d12d

File tree

8 files changed

+16
-21
lines changed

8 files changed

+16
-21
lines changed

src/generators/linting-ts/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ export const TsLintingMixin = subclass =>
1212
`${__dirname}/templates/package.json`,
1313
this.destinationPath('package.json'),
1414
);
15+
16+
await this.copyTemplates(`${__dirname}/templates/static/**/*`);
1517
}
1618
};
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
{
2-
"husky": {
3-
"hooks": {
4-
"pre-commit": "lint-staged"
5-
}
6-
},
72
"lint-staged": {
83
"*.ts": [
94
"eslint --fix",
@@ -12,10 +7,11 @@
127
},
138
"scripts": {
149
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
15-
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore"
10+
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
11+
"prepare": "husky"
1612
},
1713
"devDependencies": {
18-
"husky": "^4.3.8",
14+
"husky": "^9.0.11",
1915
"lint-staged": "^10.5.4"
2016
}
2117
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./node_modules/.bin/lint-staged

src/generators/linting/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ export const LintingMixin = subclass =>
1212
`${__dirname}/templates/package.json`,
1313
this.destinationPath('package.json'),
1414
);
15+
16+
await this.copyTemplates(`${__dirname}/templates/static/**/*`);
1517
}
1618
};
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
{
2-
"husky": {
3-
"hooks": {
4-
"pre-commit": "lint-staged"
5-
}
6-
},
72
"lint-staged": {
83
"*.js": [
94
"eslint --fix",
@@ -12,10 +7,11 @@
127
},
138
"scripts": {
149
"lint": "eslint --ext .js,.html . --ignore-path .gitignore && prettier \"**/*.js\" --check --ignore-path .gitignore",
15-
"format": "eslint --ext .js,.html . --fix --ignore-path .gitignore && prettier \"**/*.js\" --write --ignore-path .gitignore"
10+
"format": "eslint --ext .js,.html . --fix --ignore-path .gitignore && prettier \"**/*.js\" --write --ignore-path .gitignore",
11+
"prepare": "husky"
1612
},
1713
"devDependencies": {
18-
"husky": "^4.3.8",
14+
"husky": "^9.0.11",
1915
"lint-staged": "^10.5.4"
2016
}
2117
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./node_modules/.bin/lint-staged
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./node_modules/.bin/lint-staged

test/snapshots/fully-loaded-app/package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"build": "rimraf dist && rollup -c rollup.config.js && npm run analyze -- --exclude dist",
1616
"start:build": "web-dev-server --root-dir dist --app-index index.html --open",
1717
"analyze": "cem analyze --litelement",
18-
"start": "web-dev-server"
18+
"start": "web-dev-server",
19+
"prepare": "husky"
1920
},
2021
"dependencies": {
2122
"lit": "^2.0.2"
@@ -37,7 +38,7 @@
3738
"deepmerge": "^4.2.2",
3839
"eslint": "^8.31.0",
3940
"eslint-config-prettier": "^8.3.0",
40-
"husky": "^4.3.8",
41+
"husky": "^9.0.11",
4142
"lint-staged": "^10.5.4",
4243
"prettier": "^2.4.1",
4344
"rimraf": "^3.0.2",
@@ -55,11 +56,6 @@
5556
"singleQuote": true,
5657
"arrowParens": "avoid"
5758
},
58-
"husky": {
59-
"hooks": {
60-
"pre-commit": "lint-staged"
61-
}
62-
},
6359
"lint-staged": {
6460
"*.js": [
6561
"eslint --fix",

0 commit comments

Comments
 (0)