Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh(js/ts) improve CLASS_REFERENCE #3411

Merged
merged 6 commits into from Dec 9, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/languages/javascript.js
Expand Up @@ -290,10 +290,14 @@ export default function(hljs) {
regex.either(
// Hard coded exceptions
/\bJSON/,
// Float32Array
/\b[A-Z][a-z]+([A-Z][a-z]+|\d)*/,
// Float32Array, OutT
/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,
// CSSFactory
/\b[A-Z]{2,}([A-Z][a-z]+|\d)+/,
// FPs
/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*/,
// P
// single letters are not highlighted
// BLAH
// this will be flagged as a UPPER_CASE_CONSTANT instead
),
Expand Down
7 changes: 5 additions & 2 deletions src/languages/typescript.js
Expand Up @@ -23,7 +23,8 @@ export default function(hljs) {
"string",
"object",
"never",
"enum"
"enum",
"unknown"
joshgoebel marked this conversation as resolved.
Show resolved Hide resolved
];
const NAMESPACE = {
beginKeywords: 'namespace',
Expand Down Expand Up @@ -61,7 +62,9 @@ export default function(hljs) {
"implements",
"declare",
"abstract",
"readonly"
"readonly",
"infer",
"keyof"
joshgoebel marked this conversation as resolved.
Show resolved Hide resolved
];
const KEYWORDS = {
$pattern: ECMAScript.IDENT_RE,
Expand Down