Skip to content

Commit

Permalink
Make eslint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
robsimmons committed Sep 21, 2024
1 parent 388e371 commit a59da5f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/src/components/js/tokenizer-highlighter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function spanHighlight<State, Token>(
tokenizer: StreamParser<State, Token>,
string: string,
): { tag: string | null; contents: string }[][] {
let outputLines: { tag: string | null; contents: string }[][] = [];
const outputLines: { tag: string | null; contents: string }[][] = [];
let output: { tag: string | null; contents: string }[] = [];
let workingTag: string | undefined = undefined;
let workingContents: string = '';
Expand All @@ -23,13 +23,14 @@ export function spanHighlight<State, Token>(
}

let state: State = tokenizer.startState;
for (let [lineOffByOne, remainingLine] of string.split('\n').entries()) {
for (const [lineOffByOne, ...restLine] of string.split('\n').entries()) {
let remainingLine = restLine[0];
const line = lineOffByOne + 1;
let column = 1;

let currentStartColumn: number;
let currentMatch: string;
let stream: StringStream = {
const stream: StringStream = {
eat: (match: string | RegExp) => {
const peek = stream.peek(match);
if (peek === null) return null;
Expand Down

0 comments on commit a59da5f

Please sign in to comment.