Skip to content

Commit

Permalink
fix: πŸ› correctly export meta for ESM types (#374)
Browse files Browse the repository at this point in the history
* 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 <otameshiyo23@gmail.com>
  • Loading branch information
jimmy-guzman and ota-meshi authored Apr 30, 2024
1 parent 841aa91 commit 1de0fed
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/long-rats-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eslint-plugin-astro": patch
---

fix: πŸ› correctly export `meta` for ESM types
4 changes: 2 additions & 2 deletions src/plugin.ts
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -17,7 +17,7 @@ const processors = {
"client-side-ts": processorsDefines.clientSideTsProcessor,
}
export const plugin = {
meta,
meta: { name, version },
environments,
rules,
processors,
Expand Down
9 changes: 9 additions & 0 deletions tests/fixtures/integration/config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Bundler",
"noEmit": true,
"allowJs": true
}
}
4 changes: 4 additions & 0 deletions tests/integration/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
})
})
}

0 comments on commit 1de0fed

Please sign in to comment.