Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
TypeScript: Removed duplicate keywords (#3132)
  • Loading branch information
RunDevelopment committed Oct 5, 2021
1 parent a394a14 commit 91060fd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/prism-typescript.js
Expand Up @@ -12,7 +12,7 @@

// The keywords TypeScript adds to JavaScript
Prism.languages.typescript.keyword.push(
/\b(?:abstract|as|declare|implements|is|keyof|readonly|require)\b/,
/\b(?:abstract|declare|is|keyof|readonly|require)\b/,
// keywords that have to be followed by an identifier
/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,
// This is for `import type *, {}`
Expand Down
2 changes: 1 addition & 1 deletion components/prism-typescript.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion tests/languages/typescript/keyword_feature.test
Expand Up @@ -80,6 +80,7 @@ namespace foo;
type foo;

import type { Component } from "react";
import type *, {}

----------------------------------------------------

Expand Down Expand Up @@ -269,7 +270,14 @@ import type { Component } from "react";
["punctuation", "}"],
["keyword", "from"],
["string", "\"react\""],
["punctuation", ";"]
["punctuation", ";"],

["keyword", "import"],
["keyword", "type"],
["operator", "*"],
["punctuation", ","],
["punctuation", "{"],
["punctuation", "}"]
]

----------------------------------------------------
Expand Down

0 comments on commit 91060fd

Please sign in to comment.