Skip to content

Commit 790f285

Browse files
authored
chore: upgrade prettier (#426)
1 parent 638be1f commit 790f285

6 files changed

Lines changed: 81 additions & 66 deletions

File tree

example/dll/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require('path');
22
const webpack = require('webpack');
33
const slash = require('slash');
44
const HtmlWebpackPlugin = require('html-webpack-plugin');
5-
const AddAssetHtmlPlugin = require('../../');
5+
const AddAssetHtmlPlugin = require('../..');
66

77
module.exports = {
88
// Normally CWD

example/polyfill/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const path = require('path');
22
const HtmlWebpackPlugin = require('html-webpack-plugin');
3-
const AddAssetHtmlPlugin = require('../../');
3+
const AddAssetHtmlPlugin = require('../..');
44

55
module.exports = {
66
// Normally CWD

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"devDependencies": {
4141
"classnames": "^2.2.5",
4242
"eslint": "^8.10.0",
43-
"eslint-config-simenb-base": "^15.0.1",
43+
"eslint-config-simenb-base": "^16.0.0",
4444
"express": "^4.17.1",
4545
"html-webpack-plugin": "^5.2.0",
4646
"husky": "^9.0.0",
@@ -49,7 +49,7 @@
4949
"licensor": "^4.0.0",
5050
"lint-staged": "^13.0.0",
5151
"pinst": "^3.0.0",
52-
"prettier": "^2.2.1",
52+
"prettier": "^3.0.0",
5353
"puppeteer": "^21.0.0",
5454
"rimraf": "^5.0.0",
5555
"semantic-release": "^24.0.0",

src/utils.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ async function handleUrl(assets) {
5555
await Promise.all(
5656
globbyAssets.map(asset =>
5757
globby(asset.glob).then(paths =>
58-
paths.forEach(filepath =>
59-
ret.push(Object.assign({}, asset, { filepath })),
60-
),
58+
paths.forEach(filepath => ret.push({ ...asset, filepath })),
6159
),
6260
),
6361
);

test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ test('should reject on error', async () => {
5555

5656
test("should add file using compilation's publicPath", async () => {
5757
const compilation = { options: { output: { publicPath: 'vendor/' } } };
58-
const pluginData = Object.assign({ assets: { js: [], css: [] } }, pluginMock);
58+
const pluginData = { assets: { js: [], css: [] }, ...pluginMock };
5959
const plugin = new AddAssetHtmlPlugin({
6060
filepath: path.join(__dirname, 'my-file.js'),
6161
});
@@ -67,7 +67,7 @@ test("should add file using compilation's publicPath", async () => {
6767

6868
test('should used passed in publicPath', async () => {
6969
const compilation = { options: { output: { publicPath: 'vendor/' } } };
70-
const pluginData = Object.assign({ assets: { js: [], css: [] } }, pluginMock);
70+
const pluginData = { assets: { js: [], css: [] }, ...pluginMock };
7171
const plugin = new AddAssetHtmlPlugin({
7272
filepath: 'my-file.js',
7373
publicPath: 'pp',
@@ -83,7 +83,7 @@ test.todo('should handle missing `publicPath`');
8383

8484
test('should add file missing "/" to public path', async () => {
8585
const compilation = { options: { output: { publicPath: 'vendor' } } };
86-
const pluginData = Object.assign({ assets: { js: [], css: [] } }, pluginMock);
86+
const pluginData = { assets: { js: [], css: [] }, ...pluginMock };
8787
const plugin = new AddAssetHtmlPlugin({ filepath: 'my-file.js' });
8888

8989
await plugin.addAllAssetsToCompilation(compilation, pluginData);
@@ -146,7 +146,7 @@ test('should use the hash from HtmlWebpackPlugin if option is set', async () =>
146146
'my-file.js': { source: () => 'some source code is cool to have;' },
147147
},
148148
};
149-
const pluginData = Object.assign({ assets: { js: [], css: [] } }, pluginMock);
149+
const pluginData = { assets: { js: [], css: [] }, ...pluginMock };
150150
const plugin = new AddAssetHtmlPlugin({ filepath: 'my-file.js', hash: true });
151151

152152
await plugin.addAllAssetsToCompilation(compilation, pluginData);
@@ -161,7 +161,7 @@ test('should include hash of file content if option is set', async () => {
161161
'my-file.js': { source: () => 'some source code is cool to have;' },
162162
},
163163
};
164-
const pluginData = Object.assign({ assets: { js: [], css: [] } }, pluginMock);
164+
const pluginData = { assets: { js: [], css: [] }, ...pluginMock };
165165
const plugin = new AddAssetHtmlPlugin({ filepath: 'my-file.js', hash: true });
166166

167167
await plugin.addAllAssetsToCompilation(compilation, pluginData);
@@ -176,7 +176,7 @@ test('should add to css if `typeOfAsset` is css', async () => {
176176
'my-file.js': { source: () => 'some source code is cool to have;' },
177177
},
178178
};
179-
const pluginData = Object.assign({ assets: { js: [], css: [] } }, pluginMock);
179+
const pluginData = { assets: { js: [], css: [] }, ...pluginMock };
180180
const plugin = new AddAssetHtmlPlugin({
181181
filepath: 'my-file.css',
182182
typeOfAsset: 'css',
@@ -220,7 +220,7 @@ test('should replace compilation assets key if `outputPath` is set', async () =>
220220

221221
test('filter option should exclude some files', async () => {
222222
const compilation = { options: { output: { publicPath: 'vendor/' } } };
223-
const pluginData = Object.assign({ assets: { js: [], css: [] } }, pluginMock);
223+
const pluginData = { assets: { js: [], css: [] }, ...pluginMock };
224224
const plugin = new AddAssetHtmlPlugin({
225225
filepath: path.join(__dirname, 'my-file.js'),
226226
files: ['something-weird'],
@@ -233,7 +233,7 @@ test('filter option should exclude some files', async () => {
233233

234234
test('filter option should include some files', async () => {
235235
const compilation = { options: { output: { publicPath: 'vendor/' } } };
236-
const pluginData = Object.assign({ assets: { js: [], css: [] } }, pluginMock);
236+
const pluginData = { assets: { js: [], css: [] }, ...pluginMock };
237237
const plugin = new AddAssetHtmlPlugin({
238238
filepath: path.join(__dirname, 'my-file.js'),
239239
files: ['index.*'],
@@ -246,7 +246,7 @@ test('filter option should include some files', async () => {
246246

247247
test('filter option should include some files with string option', async () => {
248248
const compilation = { options: { output: { publicPath: 'vendor/' } } };
249-
const pluginData = Object.assign({ assets: { js: [], css: [] } }, pluginMock);
249+
const pluginData = { assets: { js: [], css: [] }, ...pluginMock };
250250
const plugin = new AddAssetHtmlPlugin({
251251
filepath: path.join(__dirname, 'my-file.js'),
252252
files: 'index.*',

yarn.lock

Lines changed: 67 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,13 @@ __metadata:
11701170
languageName: node
11711171
linkType: hard
11721172

1173+
"@pkgr/core@npm:^0.1.0":
1174+
version: 0.1.1
1175+
resolution: "@pkgr/core@npm:0.1.1"
1176+
checksum: 6f25fd2e3008f259c77207ac9915b02f1628420403b2630c92a07ff963129238c9262afc9e84344c7a23b5cc1f3965e2cd17e3798219f5fd78a63d144d3cceba
1177+
languageName: node
1178+
linkType: hard
1179+
11731180
"@pnpm/config.env-replace@npm:^1.1.0":
11741181
version: 1.1.0
11751182
resolution: "@pnpm/config.env-replace@npm:1.1.0"
@@ -1876,7 +1883,7 @@ __metadata:
18761883
dependencies:
18771884
classnames: ^2.2.5
18781885
eslint: ^8.10.0
1879-
eslint-config-simenb-base: ^15.0.1
1886+
eslint-config-simenb-base: ^16.0.0
18801887
express: ^4.17.1
18811888
globby: ^11.1.0
18821889
html-webpack-plugin: ^5.2.0
@@ -1887,7 +1894,7 @@ __metadata:
18871894
lint-staged: ^13.0.0
18881895
micromatch: ^4.0.4
18891896
pinst: ^3.0.0
1890-
prettier: ^2.2.1
1897+
prettier: ^3.0.0
18911898
puppeteer: ^21.0.0
18921899
rimraf: ^5.0.0
18931900
semantic-release: ^24.0.0
@@ -2888,7 +2895,7 @@ __metadata:
28882895
languageName: node
28892896
linkType: hard
28902897

2891-
"confusing-browser-globals@npm:^1.0.5":
2898+
"confusing-browser-globals@npm:^1.0.10":
28922899
version: 1.0.11
28932900
resolution: "confusing-browser-globals@npm:1.0.11"
28942901
checksum: 3afc635abd37e566477f610e7978b15753f0e84025c25d49236f1f14d480117185516bdd40d2a2167e6bed8048641a9854964b9c067e3dcdfa6b5d0ad3c3a5ef
@@ -3689,42 +3696,44 @@ __metadata:
36893696
languageName: node
36903697
linkType: hard
36913698

3692-
"eslint-config-airbnb-base@npm:^13.1.0":
3693-
version: 13.2.0
3694-
resolution: "eslint-config-airbnb-base@npm:13.2.0"
3699+
"eslint-config-airbnb-base@npm:^15.0.0":
3700+
version: 15.0.0
3701+
resolution: "eslint-config-airbnb-base@npm:15.0.0"
36953702
dependencies:
3696-
confusing-browser-globals: ^1.0.5
3697-
object.assign: ^4.1.0
3698-
object.entries: ^1.1.0
3703+
confusing-browser-globals: ^1.0.10
3704+
object.assign: ^4.1.2
3705+
object.entries: ^1.1.5
3706+
semver: ^6.3.0
36993707
peerDependencies:
3700-
eslint: ^4.19.1 || ^5.3.0
3701-
eslint-plugin-import: ^2.17.2
3702-
checksum: bfdb104cea2cdf3ac40b28dc2c478bd18ab7bfe90833e2e5efbaa45faa3ad178878a6e7a371f4b1d0e36d2132d5c50337ac2a5242d5afa4f6a2d9ee9650b4407
3708+
eslint: ^7.32.0 || ^8.2.0
3709+
eslint-plugin-import: ^2.25.2
3710+
checksum: 38626bad2ce2859fccac86b30cd2b86c9b7d8d71d458331860861dc05290a5b198bded2f4fb89efcb9046ec48f8ab4c4fb00365ba8916f27b172671da28b93ea
37033711
languageName: node
37043712
linkType: hard
37053713

3706-
"eslint-config-prettier@npm:^4.0.0":
3707-
version: 4.3.0
3708-
resolution: "eslint-config-prettier@npm:4.3.0"
3709-
dependencies:
3710-
get-stdin: ^6.0.0
3714+
"eslint-config-prettier@npm:^9.0.0":
3715+
version: 9.1.0
3716+
resolution: "eslint-config-prettier@npm:9.1.0"
37113717
peerDependencies:
3712-
eslint: ">=3.14.1"
3718+
eslint: ">=7.0.0"
37133719
bin:
3714-
eslint-config-prettier-check: bin/cli.js
3715-
checksum: d2b8a6e95da3bd4a37a791b26d59f4b3cfb597a533f4c46aa1f5c23e0dae651f7afc09434108a1bd0ead8d031708119d0361e3f7168c356d751e2366ec5d19e0
3720+
eslint-config-prettier: bin/cli.js
3721+
checksum: 9229b768c879f500ee54ca05925f31b0c0bafff3d9f5521f98ff05127356de78c81deb9365c86a5ec4efa990cb72b74df8612ae15965b14136044c73e1f6a907
37163722
languageName: node
37173723
linkType: hard
37183724

3719-
"eslint-config-simenb-base@npm:^15.0.1":
3720-
version: 15.0.1
3721-
resolution: "eslint-config-simenb-base@npm:15.0.1"
3725+
"eslint-config-simenb-base@npm:^16.0.0":
3726+
version: 16.0.0
3727+
resolution: "eslint-config-simenb-base@npm:16.0.0"
37223728
dependencies:
3723-
eslint-config-airbnb-base: ^13.1.0
3724-
eslint-config-prettier: ^4.0.0
3725-
eslint-plugin-import: ^2.7.0
3726-
eslint-plugin-prettier: ^3.0.1
3727-
checksum: b9c636df9e09504d5af6fb817ff5fa48055534f81a5a9dabfe0efefa5ea60af50485931381767c76ef04757c9c5845a0ec9c8d92cf1f62d74b9ffa3938e184b8
3729+
eslint-config-airbnb-base: ^15.0.0
3730+
eslint-config-prettier: ^9.0.0
3731+
eslint-plugin-import: ^2.27.5
3732+
eslint-plugin-prettier: ^5.0.0
3733+
peerDependencies:
3734+
eslint: ">=7.32.0"
3735+
prettier: "*"
3736+
checksum: cff8bd66112a328d41e94102406fbb5d44f0c1a4fc841eb33e529f9927bb4ed9dab414d0341f1d10b223ba32417dfba89cc837c7982fc1720ffa0cb2bc505613
37283737
languageName: node
37293738
linkType: hard
37303739

@@ -3751,7 +3760,7 @@ __metadata:
37513760
languageName: node
37523761
linkType: hard
37533762

3754-
"eslint-plugin-import@npm:^2.7.0":
3763+
"eslint-plugin-import@npm:^2.27.5":
37553764
version: 2.29.1
37563765
resolution: "eslint-plugin-import@npm:2.29.1"
37573766
dependencies:
@@ -3778,18 +3787,23 @@ __metadata:
37783787
languageName: node
37793788
linkType: hard
37803789

3781-
"eslint-plugin-prettier@npm:^3.0.1":
3782-
version: 3.4.1
3783-
resolution: "eslint-plugin-prettier@npm:3.4.1"
3790+
"eslint-plugin-prettier@npm:^5.0.0":
3791+
version: 5.1.3
3792+
resolution: "eslint-plugin-prettier@npm:5.1.3"
37843793
dependencies:
37853794
prettier-linter-helpers: ^1.0.0
3795+
synckit: ^0.8.6
37863796
peerDependencies:
3787-
eslint: ">=5.0.0"
3788-
prettier: ">=1.13.0"
3797+
"@types/eslint": ">=8.0.0"
3798+
eslint: ">=8.0.0"
3799+
eslint-config-prettier: "*"
3800+
prettier: ">=3.0.0"
37893801
peerDependenciesMeta:
3802+
"@types/eslint":
3803+
optional: true
37903804
eslint-config-prettier:
37913805
optional: true
3792-
checksum: fa6a89f0d7cba1cc87064352f5a4a68dc3739448dd279bec2bced1bfa3b704467e603d13b69dcec853f8fa30b286b8b715912898e9da776e1b016cf0ee48bd99
3806+
checksum: eb2a7d46a1887e1b93788ee8f8eb81e0b6b2a6f5a66a62bc6f375b033fc4e7ca16448da99380be800042786e76cf5c0df9c87a51a2c9b960ed47acbd7c0b9381
37933807
languageName: node
37943808
linkType: hard
37953809

@@ -4474,13 +4488,6 @@ __metadata:
44744488
languageName: node
44754489
linkType: hard
44764490

4477-
"get-stdin@npm:^6.0.0":
4478-
version: 6.0.0
4479-
resolution: "get-stdin@npm:6.0.0"
4480-
checksum: 593f6fb4fff4c8d49ec93a07c430c1edc6bd4fe7e429d222b5da2f367276a98809af9e90467ad88a2d83722ff95b9b35bbaba02b56801421c5e3668173fe12b4
4481-
languageName: node
4482-
linkType: hard
4483-
44844491
"get-stream@npm:^5.1.0":
44854492
version: 5.2.0
44864493
resolution: "get-stream@npm:5.2.0"
@@ -7362,7 +7369,7 @@ __metadata:
73627369
languageName: node
73637370
linkType: hard
73647371

7365-
"object.assign@npm:^4.1.0, object.assign@npm:^4.1.5":
7372+
"object.assign@npm:^4.1.2, object.assign@npm:^4.1.5":
73667373
version: 4.1.5
73677374
resolution: "object.assign@npm:4.1.5"
73687375
dependencies:
@@ -7374,7 +7381,7 @@ __metadata:
73747381
languageName: node
73757382
linkType: hard
73767383

7377-
"object.entries@npm:^1.1.0":
7384+
"object.entries@npm:^1.1.5":
73787385
version: 1.1.8
73797386
resolution: "object.entries@npm:1.1.8"
73807387
dependencies:
@@ -7924,12 +7931,12 @@ __metadata:
79247931
languageName: node
79257932
linkType: hard
79267933

7927-
"prettier@npm:^2.2.1":
7928-
version: 2.8.8
7929-
resolution: "prettier@npm:2.8.8"
7934+
"prettier@npm:^3.0.0":
7935+
version: 3.3.2
7936+
resolution: "prettier@npm:3.3.2"
79307937
bin:
7931-
prettier: bin-prettier.js
7932-
checksum: b49e409431bf129dd89238d64299ba80717b57ff5a6d1c1a8b1a28b590d998a34e083fa13573bc732bb8d2305becb4c9a4407f8486c81fa7d55100eb08263cf8
7938+
prettier: bin/prettier.cjs
7939+
checksum: 5557d8caed0b182f68123c2e1e370ef105251d1dd75800fadaece3d061daf96b1389141634febf776050f9d732c7ae8fd444ff0b4a61b20535e7610552f32c69
79337940
languageName: node
79347941
linkType: hard
79357942

@@ -9205,6 +9212,16 @@ __metadata:
92059212
languageName: node
92069213
linkType: hard
92079214

9215+
"synckit@npm:^0.8.6":
9216+
version: 0.8.8
9217+
resolution: "synckit@npm:0.8.8"
9218+
dependencies:
9219+
"@pkgr/core": ^0.1.0
9220+
tslib: ^2.6.2
9221+
checksum: 9ed5d33abb785f5f24e2531efd53b2782ca77abf7912f734d170134552b99001915531be5a50297aa45c5701b5c9041e8762e6cd7a38e41e2461c1e7fccdedf8
9222+
languageName: node
9223+
linkType: hard
9224+
92089225
"tapable@npm:^2.0.0, tapable@npm:^2.1.1, tapable@npm:^2.2.0":
92099226
version: 2.2.1
92109227
resolution: "tapable@npm:2.2.1"
@@ -9448,7 +9465,7 @@ __metadata:
94489465
languageName: node
94499466
linkType: hard
94509467

9451-
"tslib@npm:^2.0.1, tslib@npm:^2.0.3":
9468+
"tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.6.2":
94529469
version: 2.6.3
94539470
resolution: "tslib@npm:2.6.3"
94549471
checksum: 74fce0e100f1ebd95b8995fbbd0e6c91bdd8f4c35c00d4da62e285a3363aaa534de40a80db30ecfd388ed7c313c42d930ee0eaf108e8114214b180eec3dbe6f5

0 commit comments

Comments
 (0)