Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

feat: add JSXSpreadChild and tool to build keys out of AST definitions #36

Merged
merged 14 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 1 addition & 9 deletions tests/lib/get-keys-from-ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { diffString } from "json-diff";
import { expect } from "chai";
import { alphabetizeKeyInterfaces, getKeysFromTsFile } from "../../tools/get-keys-from-ts.js";
import { KEYS } from "../../lib/index.js";
import backwardCompatibleKeys from "../../tools/backwardCompatibleKeys.js";

describe("getKeysFromTsFile", () => {
it("gets keys", async () => {
Expand All @@ -20,15 +21,6 @@ describe("getKeysFromTsFile", () => {
}
);

const backwardCompatibleKeys = {
ExperimentalRestProperty: [
"argument"
],
ExperimentalSpreadProperty: [
"argument"
]
};

const actual = alphabetizeKeyInterfaces({ ...keys, ...jsxKeys, ...backwardCompatibleKeys });

const expected = KEYS;
Expand Down
10 changes: 10 additions & 0 deletions tools/backwardCompatibleKeys.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const backwardCompatibleKeys = {
brettz9 marked this conversation as resolved.
Show resolved Hide resolved
ExperimentalRestProperty: [
"argument"
],
ExperimentalSpreadProperty: [
"argument"
]
};

export default backwardCompatibleKeys;
10 changes: 1 addition & 9 deletions tools/build-keys-from-ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import fs from "fs";
import { alphabetizeKeyInterfaces, getKeysFromTsFile } from "./get-keys-from-ts.js";
import backwardCompatibleKeys from "./backwardCompatibleKeys.js";

const { promises: { writeFile } } = fs;

Expand All @@ -21,15 +22,6 @@ const { promises: { writeFile } } = fs;
}
);

const backwardCompatibleKeys = {
ExperimentalRestProperty: [
"argument"
],
ExperimentalSpreadProperty: [
"argument"
]
};

const mergedKeys = alphabetizeKeyInterfaces({ ...keys, ...jsxKeys, ...backwardCompatibleKeys });

// eslint-disable-next-line no-console -- CLI
Expand Down