Skip to content

Commit ebcd3f2

Browse files
committed
Fixes lint warnings.
1 parent 9232dea commit ebcd3f2

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
document.getElementById('replace')!.textContent = 'Hello from JavaScript!';
1+
const replace = document.getElementById('replace');
2+
if (!replace) throw new Error('No `#replace` element.');
3+
replace.textContent = 'Hello from JavaScript!';

packages/rules_prerender/scripts.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export function includeScript(filePath: string, meta: ImportMeta): string {
1818
* wrapping. This is useful for templating engines which don't have easy "parse
1919
* HTML into safe type" utilities.
2020
*/
21-
export function includeScriptAnnotation(
22-
filePath: string, meta: ImportMeta): string {
21+
export function includeScriptAnnotation(filePath: string, meta: ImportMeta):
22+
string {
2323
if (!filePath.startsWith('.')) {
2424
throw new Error(`Only relative imports are supported and must start with \`./\` or \`../\`: "${filePath}".`);
2525
}

0 commit comments

Comments
 (0)