Skip to content

Conversation

@anydonym
Copy link
Contributor

@anydonym anydonym commented Jan 21, 2022

Basically some minor modifications to the current TypeScript types and TypeScript-specific keywords list.

Changes

  • Add override, move enum to and remove typedef TypeScript-specific keywords list.
  • Add various primitive types to the TypeScript types list, which are unknown, symbol and bigint.

Checklist

  • Updated the changelogs at CHANGES.md

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.
Comment on lines 26 to 27
"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.

"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.

Removed "null" and "undefined" from types list and context-based "keyof" keyword. Added "override" TS-specific keyword and "unknown" TypeScript type.
Copy link
Member

@joshgoebel joshgoebel left a 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.

@joshgoebel joshgoebel merged commit d302ec4 into highlightjs:main Jan 22, 2022
@joshgoebel
Copy link
Member

@anydonym Thanks so much!

@anydonym anydonym deleted the patch-1 branch January 22, 2022 13:16
wkania pushed a commit to wkania-forks/highlight.js that referenced this pull request Jan 29, 2022
…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.
brainlid added a commit to brainlid/highlight.js that referenced this pull request Feb 11, 2022
* 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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants