From 3b0bc15bacc36c3f0d6790789ef4f7aca51b0ad7 Mon Sep 17 00:00:00 2001 From: Dimas Lanjaka Date: Sat, 6 May 2023 13:48:10 +0700 Subject: [PATCH] chore: make ts happy (#301) * chore: re-order types property * refactor: change prepare to postinstall * refactor: fix TS2550 - add lib `es2020`, `es2019` Property 'fromEntries' does not exist on type 'ObjectConstructor' Property 'matchAll' does not exist on type 'string' --- package.json | 4 ++-- tsconfig.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 4fb9ace8..88c3b8ba 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "3.0.1", "description": "Utilities for Hexo.", "main": "dist/index", + "types": "./dist/index.d.ts", "scripts": { "prepublishOnly": "npm install && npm run clean && npm run build", "build": "tsc -b", @@ -13,14 +14,13 @@ "test": "mocha --require ts-node/register", "test-cov": "nyc --reporter=lcovonly npm run test", "build:highlight": "node scripts/build_highlight_alias.js", - "prepare": "npm run build:highlight" + "postinstall": "npm run build:highlight" }, "files": [ "dist/**", "scripts/", "highlight_alias.json" ], - "types": "./dist/index.d.ts", "repository": "hexojs/hexo-util", "homepage": "https://hexo.io/", "keywords": [ diff --git a/tsconfig.json b/tsconfig.json index 9ed52af0..7a1763dc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,8 @@ "esModuleInterop": true, "types": [ "node" - ] + ], + "lib": ["ES2020", "ES2019"] }, "include": [ "lib/index.ts"