From a1d1eee7636fd537d76a0e16166250138e62a82e Mon Sep 17 00:00:00 2001 From: ntnyq Date: Thu, 24 Oct 2024 11:22:04 +0800 Subject: [PATCH] feat: add typescript support to `prettier-plugin-java` --- packages/prettier-plugin-java/index.d.ts | 4 ++++ packages/prettier-plugin-java/package.json | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 packages/prettier-plugin-java/index.d.ts diff --git a/packages/prettier-plugin-java/index.d.ts b/packages/prettier-plugin-java/index.d.ts new file mode 100644 index 00000000..462b5f14 --- /dev/null +++ b/packages/prettier-plugin-java/index.d.ts @@ -0,0 +1,4 @@ +import type { Plugin } from "prettier"; + +declare const plugin: Plugin; +export default plugin; diff --git a/packages/prettier-plugin-java/package.json b/packages/prettier-plugin-java/package.json index 2240833f..cd447a71 100644 --- a/packages/prettier-plugin-java/package.json +++ b/packages/prettier-plugin-java/package.json @@ -3,9 +3,15 @@ "version": "2.6.4", "description": "Prettier Java Plugin", "type": "module", - "exports": "./dist/index.js", + "exports": { + ".": { + "types": "./index.d.ts", + "import": "./dist/index.js" + } + }, "files": [ - "dist" + "dist", + "index.d.ts" ], "homepage": "https://jhipster.github.io/prettier-java/", "repository": "https://github.com/jhipster/prettier-java",