Skip to content

Commit 94561ba

Browse files
authored
fix: Remove broken higlight rules (#28)
1 parent 87f7e45 commit 94561ba

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"./highlight/ruby": "./code-view/highlight/ruby.js",
5454
"./highlight/rust": "./code-view/highlight/rust.js",
5555
"./highlight/sh": "./code-view/highlight/sh.js",
56-
"./highlight/swift": "./code-view/highlight/swift.js",
5756
"./highlight/typescript": "./code-view/highlight/typescript.js",
5857
"./highlight/xml": "./code-view/highlight/xml.js",
5958
"./highlight/yaml": "./code-view/highlight/yaml.js",
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
import fs from "node:fs";
4+
import path from "node:path";
5+
import url from "node:url";
6+
import { describe, expect, test } from "vitest";
7+
8+
const dirname = path.dirname(url.fileURLToPath(import.meta.url));
9+
const rulesDir = path.resolve(dirname, "../highlight");
10+
const rules = fs.readdirSync(rulesDir).filter((file) => file !== "index.tsx");
11+
12+
describe("highlight rules can be loaded", () => {
13+
test.each(rules)("%s", async (rule) => {
14+
// eslint-disable-next-line no-unsanitized/method
15+
const { default: highlight } = await import(path.join(rulesDir, rule));
16+
expect(highlight("")).toBeDefined();
17+
});
18+
});

src/code-view/highlight/swift.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)