Skip to content

feat: export meta object #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/happy-coins-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"typescript-eslint-parser-for-extra-files": minor
---

feat: export meta object
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import type { ProgramOptions } from "./ts";
import { TSServiceManager } from "./ts";
import * as tsEslintParser from "@typescript-eslint/parser";
import { getProjectConfigFiles } from "./utils/get-project-config-files";
export * as meta from "./meta";
export { name } from "./meta";

const DEFAULT_EXTRA_FILE_EXTENSIONS = [".vue", ".svelte", ".astro"];
const tsServiceManager = new TSServiceManager();

export const name = "typescript-eslint-parser-for-extra-files";

export function parseForESLint(
code: string,
options: ParserOptions = {}
Expand Down
1 change: 1 addition & 0 deletions src/meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { name, version } from "../package.json";
13 changes: 13 additions & 0 deletions tests/src/meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import assert from "assert";
import * as parser from "../../src";
import { version } from "../../package.json";
const expectedMeta = {
name: "typescript-eslint-parser-for-extra-files",
version,
};

describe("Test for meta object", () => {
it("A parser should have a meta object.", () => {
assert.deepStrictEqual(parser.meta, expectedMeta);
});
});
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"esModuleInterop": true,
"resolveJsonModule": true,

"skipLibCheck": true
},
Expand Down