JavaScript mode
JavaScript mode supports several configuration options:
jsonwhich will set the mode to expect JSON data rather than a JavaScript program.jsonldwhich will set the mode to expect JSON-LD linked data rather than a JavaScript program (demo).typescriptwhich will activate additional syntax highlighting and some other things for TypeScript code (demo).statementIndentwhich (given a number) will determine the amount of indentation to use for statements continued on a new line.wordCharacters, a regexp that indicates which characters should be considered part of an identifier. Defaults to/[\w$]/, which does not handle non-ASCII identifiers. Can be set to something more elaborate to improve Unicode support.
MIME types defined:
text/javascript
,
application/json
,
application/ld+json
,
text/typescript
,
application/typescript
.
