From 0eff140a2d4a2e03bfe7aff84ddd7fd78de5654c Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Sat, 14 Dec 2024 14:07:06 -0500 Subject: [PATCH] integrate prettier with eslint --- package-lock.json | 96 ++++++++++++++++++++++++++++++++++++++++++++--- package.json | 2 +- rollup.config.js | 18 ++++----- 3 files changed, 100 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2471333..d1b4b33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "tslib": "^2.8.1" }, "devDependencies": { + "@rollup/plugin-terser": "^0.4.4", "@size-limit/preset-small-lib": "^4.12.0", "@testing-library/jest-dom": "^6.6.3", "@testing-library/preact": "^3.2.4", @@ -2807,22 +2808,26 @@ } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.2", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "license": "MIT", "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/source-map/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.1", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", "dev": true, "license": "MIT", "dependencies": { - "@jridgewell/set-array": "^1.0.0", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -3131,6 +3136,78 @@ "dev": true, "license": "MIT" }, + "node_modules/@rollup/plugin-terser": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", + "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-terser/node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/@rollup/plugin-terser/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/plugin-terser/node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/@rollup/plugin-terser/node_modules/terser": { + "version": "5.37.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz", + "integrity": "sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@rollup/pluginutils": { "version": "4.2.1", "dev": true, @@ -19801,6 +19878,13 @@ "node": ">=8" } }, + "node_modules/smob": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.5.0.tgz", + "integrity": "sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig==", + "dev": true, + "license": "MIT" + }, "node_modules/snapdragon": { "version": "0.8.2", "dev": true, diff --git a/package.json b/package.json index 1fda240..9a8b231 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ } }, "devDependencies": { + "@rollup/plugin-terser": "^0.4.4", "@size-limit/preset-small-lib": "^4.12.0", "@testing-library/jest-dom": "^6.6.3", "@testing-library/preact": "^3.2.4", @@ -65,7 +66,6 @@ "prettier": "^3.4.2", "rollup": "^2.79.2", "rollup-plugin-copy": "^3.5.0", - "rollup-plugin-terser": "^7.0.2", "rollup-plugin-typescript2": "^0.36.0", "size-limit": "^4.12.0", "typescript": "^4.9.5" diff --git a/rollup.config.js b/rollup.config.js index 002d395..b41628f 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,5 +1,5 @@ import copy from 'rollup-plugin-copy'; -import { terser } from 'rollup-plugin-terser'; +import terser from '@rollup/plugin-terser'; import typescript from 'rollup-plugin-typescript2'; import pkg from './package.json'; @@ -9,12 +9,12 @@ export default [ external: ['preact', 'preact/hooks'], plugins: [ typescript({ - typescript: require('typescript') + typescript: require('typescript'), }), copy({ - targets: [{ src: 'lib/package.json', dest: 'dist' }] + targets: [{ src: 'lib/package.json', dest: 'dist' }], }), - terser() + terser(), ], output: [ { @@ -23,11 +23,11 @@ export default [ format: 'umd', globals: { preact: 'preact', - 'preact/hooks': 'preact/hooks' - } + 'preact/hooks': 'preact/hooks', + }, }, { file: pkg.main, format: 'cjs' }, - { file: pkg.module, format: 'es' } - ] - } + { file: pkg.module, format: 'es' }, + ], + }, ];