-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Minor change to TypeScript types and TypeScript-specific keywords #3466
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
Conversation
Minor TypeScript primitive types addition and removal of "typedef" TypeScript-specific keyword. There is no such keyword as "typedef".
"enum" is not a type in TypeScript, but it is, indeed, a TypeScript-specific keyword. Also added "keyof" to TypeScript-specific keywords list.
src/languages/typescript.js
Outdated
| "null", | ||
| "undefined", |
There was a problem hiding this comment.
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.
src/languages/typescript.js
Outdated
| "readonly" | ||
| "readonly", | ||
| "enum", | ||
| "keyof" |
There was a problem hiding this comment.
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.
Our general policy is that false negatives are worse than simply not highlighting something at all.
Removed "null" and "undefined" from types list and context-based "keyof" keyword. Added "override" TS-specific keyword and "unknown" TypeScript type.
joshgoebel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, now please just add a changelog entry.
|
@anydonym Thanks so much! |
…ghlightjs#3466) - Minor TypeScript primitive types addition and removal of "typedef" TypeScript-specific keyword. There is no such keyword as "typedef". - "enum" is not a type in TypeScript, but it is, indeed, a TypeScript-specific keyword. - Added "override" TS-specific keyword and "unknown" TypeScript type.
* master: (816 commits) (chore) add sideEffects: false to enable tree-shaking in esbuild & others fix(markdown) Handle `***Hello world***` without breaking (highlightjs#3457) (chore) DRY up php grammar just a little enh(php) support CSSCase attribute naming refactor, security issues enh(php) Add support for Attributes fix(java) prevent false variable init on `else` (highlightjs#3455) (ci) min change threshold for size report (highlightjs#3401) (themes) Add `tokyo-night-dark` (highlightjs#3467) enh(llvm) Improve number support, add `char.escape` (highlightjs#3471) (chore) simplify brainfuck grammar fix(brainfuck) fix highlighting of initial ++/-- Minor change to TypeScript types and TypeScript-specific keywords (highlightjs#3466) fix(angelscript) Fix highlighting of int8, int16, int32, int64 (highlightjs#3464) enh(php) named arguments and fix php constants (highlightjs#3459) themes: add new felipec theme (highlightjs#3441) (chore) release 10.4.0 enh(arcade) Add missing keywords for Arcade v1.16 chore(arcade) eslint --fix, explode keywords enh(php) Left and right-side of double colon (highlightjs#3422) ...
Basically some minor modifications to the current TypeScript types and TypeScript-specific keywords list.
Changes
override, moveenumto and removetypedefTypeScript-specific keywords list.unknown,symbolandbigint.Checklist
CHANGES.md