Skip to content

Commit f7c343c

Browse files
committed
core: lints code
1 parent 5336d9a commit f7c343c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

core/Renderer.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ export class Renderer {
3636
return "\t".repeat(level + n);
3737
};
3838

39-
let i = 0, text_level = level, code = "", lines = [];
39+
const text_level = level;
40+
const lines = [];
41+
let i = 0;
42+
let code = "";
4043

4144
if (debug && options.filename) {
4245
code += `${indent(0)}// ${options.filename}\n`;
@@ -45,7 +48,7 @@ export class Renderer {
4548
code += `${indent(0)}let __output = "";\n`;
4649
code += `${indent(0)}try { with (this) {\n`;
4750

48-
while (true) {
51+
while (i < data.length) {
4952
let j = data.indexOf(START_BLOCK, i);
5053

5154
if (j == -1) {
@@ -111,7 +114,7 @@ export class Renderer {
111114
const command = match.groups.command;
112115

113116
switch (command) {
114-
case "include":
117+
case "include": {
115118
const view = await this.compilePath(match.groups.method, options.filename ? dirname(options.filename) : null, debug ? text_level + 2 : text_level);
116119

117120
if (view !== null) {
@@ -126,6 +129,7 @@ export class Renderer {
126129
code += `${indent()}__output += "${escape(new RenderingError(`Include not found: ${match.groups.method}`))}";\n`;
127130
}
128131
break;
132+
}
129133
default:
130134
code += `${indent()}__output += "${escape(new RenderingError(`Unknown command: ${command}`))}";\n`;
131135
}

core/Resolver.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { dirname, resolve } from "path";
1+
import { resolve } from "path";
22

33
export function Resolver(path, base = null) {
44
if (!path.endsWith(".html")) {

0 commit comments

Comments
 (0)