Skip to content

Commit 91060fd

Browse files
TypeScript: Removed duplicate keywords (#3132)
1 parent a394a14 commit 91060fd

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

components/prism-typescript.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
// The keywords TypeScript adds to JavaScript
1414
Prism.languages.typescript.keyword.push(
15-
/\b(?:abstract|as|declare|implements|is|keyof|readonly|require)\b/,
15+
/\b(?:abstract|declare|is|keyof|readonly|require)\b/,
1616
// keywords that have to be followed by an identifier
1717
/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,
1818
// This is for `import type *, {}`

components/prism-typescript.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/languages/typescript/keyword_feature.test

+9-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ namespace foo;
8080
type foo;
8181

8282
import type { Component } from "react";
83+
import type *, {}
8384

8485
----------------------------------------------------
8586

@@ -269,7 +270,14 @@ import type { Component } from "react";
269270
["punctuation", "}"],
270271
["keyword", "from"],
271272
["string", "\"react\""],
272-
["punctuation", ";"]
273+
["punctuation", ";"],
274+
275+
["keyword", "import"],
276+
["keyword", "type"],
277+
["operator", "*"],
278+
["punctuation", ","],
279+
["punctuation", "{"],
280+
["punctuation", "}"]
273281
]
274282

275283
----------------------------------------------------

0 commit comments

Comments
 (0)