Skip to content
Merged
Changes from 2 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
10 changes: 7 additions & 3 deletions src/languages/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export default function(hljs) {
"string",
"object",
"never",
"enum"
"null",
"undefined",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are already included in ECMAScript literals.

"symbol",
"bigint"
];
const NAMESPACE = {
beginKeywords: 'namespace',
Expand Down Expand Up @@ -53,15 +56,16 @@ export default function(hljs) {
const TS_SPECIFIC_KEYWORDS = [
"type",
"namespace",
"typedef",
"interface",
"public",
"private",
"protected",
"implements",
"declare",
"abstract",
"readonly"
"readonly",
"enum",
"keyof"
Copy link
Member

@joshgoebel joshgoebel Jan 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyof is not a keyword, it's a contextual keyword, so I'm not sure we should add it. I feel like this has come up before but the only thing I could find quickly was 3403.

#3403

Our general policy is that false negatives are worse than simply not highlighting something at all.

];
const KEYWORDS = {
$pattern: ECMAScript.IDENT_RE,
Expand Down