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 }) + }) }) }