From 1de0fed049559d401a7b8d867d4f17257dbcd522 Mon Sep 17 00:00:00 2001 From: Jimmy Guzman <30631540+jimmy-guzman@users.noreply.github.com> Date: Tue, 30 Apr 2024 06:57:27 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20correctly=20export=20`met?= =?UTF-8?q?a`=20for=20ESM=20types=20(#374)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 🐛 correctly export `meta` for ESM types * test: ✅ add integration for tsc against current fixtures * test: ✅ just test wether or not tsc throws * Create long-rats-divide.md --------- Co-authored-by: Yosuke Ota --- .changeset/long-rats-divide.md | 5 +++++ src/plugin.ts | 4 ++-- tests/fixtures/integration/config/tsconfig.json | 9 +++++++++ tests/integration/test.ts | 4 ++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .changeset/long-rats-divide.md create mode 100644 tests/fixtures/integration/config/tsconfig.json diff --git a/.changeset/long-rats-divide.md b/.changeset/long-rats-divide.md new file mode 100644 index 00000000..0ba447d2 --- /dev/null +++ b/.changeset/long-rats-divide.md @@ -0,0 +1,5 @@ +--- +"eslint-plugin-astro": patch +--- + +fix: 🐛 correctly export `meta` for ESM types diff --git a/src/plugin.ts b/src/plugin.ts index 3b3354a6..bad12849 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -1,7 +1,7 @@ import { rules as ruleList } from "./utils/rules" import * as processorsDefines from "./processor" import type { Rule } from "eslint" -import * as meta from "./meta" +import { name, version } from "./meta" import { environments } from "./environments" const rules = ruleList.reduce( @@ -17,7 +17,7 @@ const processors = { "client-side-ts": processorsDefines.clientSideTsProcessor, } export const plugin = { - meta, + meta: { name, version }, environments, rules, processors, diff --git a/tests/fixtures/integration/config/tsconfig.json b/tests/fixtures/integration/config/tsconfig.json new file mode 100644 index 00000000..b0982264 --- /dev/null +++ b/tests/fixtures/integration/config/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "ESNext", + "moduleResolution": "Bundler", + "noEmit": true, + "allowJs": true + } +} diff --git a/tests/integration/test.ts b/tests/integration/test.ts index b79c1623..d7301358 100644 --- a/tests/integration/test.ts +++ b/tests/integration/test.ts @@ -65,5 +65,9 @@ for (const dirent of fs.readdirSync(TEST_FIXTURES_ROOT, { } } }) + + it("should NOT fail when running tsc", () => { + cp.execSync(`npx tsc`, { cwd: TEST_CWD }) + }) }) }