From 11ad3bb98deacafa200b392185f006f441daced8 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 8 May 2023 17:15:39 +0800 Subject: [PATCH 1/2] chore: missing TS peer deps --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6c94de7..f8a0871 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,8 @@ "benchmark": "^2.1.4", "tap": "^16.0.0", "ts-standard": "^12.0.2", - "tsd": "^0.28.0" + "tsd": "^0.28.0", + "typescript": "^5.0.4" }, "tsd": { "compilerOptions": { From 9be2d5180943d9a5ea1a7aaa89ddb3b8e769cbed Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 8 May 2023 18:12:21 +0800 Subject: [PATCH 2/2] remove ts-standard --- .eslintrc | 6 ++++++ package.json | 10 ++++++++-- types/index.test-d.ts | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .eslintrc diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..674065e --- /dev/null +++ b/.eslintrc @@ -0,0 +1,6 @@ +{ + "extends": "standard-with-typescript", + "parserOptions": { + "project": "./tsconfig.eslint.json" + } +} diff --git a/package.json b/package.json index f8a0871..796b76f 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "types": "types/index.d.ts", "scripts": { - "lint": "ts-standard", + "lint": "eslint --ext js,ts .", "test": "npm run test:unit && npm run test:typescript", "test:unit": "tap", "test:typescript": "tsd" @@ -27,9 +27,15 @@ }, "homepage": "https://github.com/fastify/fastify-error#readme", "devDependencies": { + "@typescript-eslint/eslint-plugin": "^5.59.2", + "@typescript-eslint/parser": "^5.0.0", "benchmark": "^2.1.4", + "eslint": "^8.40.0", + "eslint-config-standard-with-typescript": "^34.0.1", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-n": "^15.0.0", + "eslint-plugin-promise": "^6.0.0", "tap": "^16.0.0", - "ts-standard": "^12.0.2", "tsd": "^0.28.0", "typescript": "^5.0.4" }, diff --git a/types/index.test-d.ts b/types/index.test-d.ts index f31aa35..f1375e0 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -1,4 +1,4 @@ -import createError, { FastifyError, FastifyErrorConstructor } from '..' +import createError, { type FastifyError, type FastifyErrorConstructor } from '..' import { expectType } from 'tsd' const CustomError = createError('ERROR_CODE', 'message')