Skip to content

Commit

Permalink
feat: Export internal constructs for other plugin authors (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidnioulz committed Aug 20, 2024
1 parent 220c490 commit ad729f0
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
//-----------------------------------------------------------------------------

import { JSONLanguage } from "./languages/json-language.js";
import { JSONSourceCode } from "./languages/json-source-code.js";
import noDuplicateKeys from "./rules/no-duplicate-keys.js";
import noEmptyKeys from "./rules/no-empty-keys.js";

Expand Down Expand Up @@ -43,3 +44,4 @@ Object.assign(plugin.configs, {
});

export default plugin;
export { JSONLanguage, JSONSourceCode };
34 changes: 34 additions & 0 deletions tests/package/exports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* @fileoverview Tests for the package index's exports.
* @author Steve Dodier-Lazaro
*/

//------------------------------------------------------------------------------
// Imports
//------------------------------------------------------------------------------

import * as exports from "../../src/index.js";
import assert from "node:assert";

//------------------------------------------------------------------------------
// Tests
//------------------------------------------------------------------------------

describe("Package exports", () => {
it("has the ESLint plugin as a default export", () => {
assert.deepStrictEqual(Object.keys(exports.default), [
"meta",
"languages",
"rules",
"configs",
]);
});

it("has a JSONLanguage export", () => {
assert.ok(exports.JSONLanguage);
});

it("has a JSONSourceCode export", () => {
assert.ok(exports.JSONSourceCode);
});
});

0 comments on commit ad729f0

Please sign in to comment.