misc: add IDE language annotation comments (#7678)

add IDE language annotations
This commit is contained in:
Sébastien Lorber 2022-06-25 03:55:28 +02:00 committed by GitHub
parent 9ce7d11309
commit cebe4840aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -29,7 +29,9 @@ const ThemeStorageKey = 'theme';
const noFlashColorMode = ({
defaultMode,
respectPrefersColorScheme,
}: ThemeConfig['colorMode']) => `(function() {
}: ThemeConfig['colorMode']) =>
/* language=js */
`(function() {
var defaultMode = '${defaultMode}';
var respectPrefersColorScheme = ${respectPrefersColorScheme};
@ -76,6 +78,7 @@ const AnnouncementBarDismissDataAttribute =
// We always render the announcement bar html on the server, to prevent layout
// shifts on React hydration. The theme can use CSS + the data attribute to hide
// the announcement bar asap (before React hydration)
/* language=js */
const AnnouncementBarInlineJavaScript = `
(function() {
function isDismissed() {

View file

@ -43,6 +43,7 @@ function createInlineHtmlBanner(baseUrl: string) {
// Needs to work for older browsers!
function createInlineScript(baseUrl: string) {
/* language=js */
return `
window['${InsertBannerWindowAttribute}'] = true;