Skip to content

Commit 700fc4a

Browse files
authored
refactor(documentation-ui): use @nodesecure/js-x-ray/warnings to build menu list (#575)
1 parent 4f3f267 commit 700fc4a

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

workspaces/documentation-ui/index.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
// Import Third-party Dependencies
44
import { getManifest } from "@nodesecure/flags/web";
5+
import { warnings } from "@nodesecure/js-x-ray/warnings";
56

67
// Import Internal Dependencies
78
import * as utils from "./src/utils.js";
@@ -11,19 +12,9 @@ import { Navigation } from "./src/components/navigation.class.js";
1112
import { fetchAndRenderByMenu } from "./src/fetch.js";
1213

1314
// CONSTANTS
14-
const kSASTWarnings = [
15-
"parsing-error",
16-
"unsafe-import",
17-
"unsafe-regex",
18-
"unsafe-stmt",
19-
"shady-link",
20-
"encoded-literal",
21-
"short-identifiers",
22-
"suspicious-literal",
23-
"suspicious-file",
24-
"obfuscated-code",
25-
"weak-crypto"
26-
].map((name) => ({ name }));
15+
const kSASTWarnings = Object
16+
.keys(warnings)
17+
.map((name) => ({ name }));
2718

2819
const kWikiMenus = {
2920
flags: {

workspaces/documentation-ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"license": "MIT",
2727
"dependencies": {
2828
"@nodesecure/flags": "^2.4.0",
29+
"@nodesecure/js-x-ray": "^9.2.0",
2930
"highlight.js": "^11.10.0",
3031
"markdown-it": "^14.1.0"
3132
}

0 commit comments

Comments
 (0)