Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/oxlint/src-js/plugins/location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ export function initLines(): void {
if (sourceText === null) initSourceText();
debugAssertIsNonNull(sourceText);

// TODO: ESLint freezes `lines`, but doesn't freeze `lineStartIndices`.
// Should we freeze them? Upside is it would prevent user mutating them, but on downside would prevent us re-using
// the same arrays for multiple files. Maybe we shouldn't bother, in same way that we don't freeze the AST.
// Once we introduce lazy deserialization, presumably we'll use proxy arrays (like `NodeArray`), which will make
// them immutable by user. Maybe we can leave it until then. (@overlookmotel)

// This implementation is based on the one in ESLint.
// TODO: Investigate if using `String.prototype.matchAll` is faster.
// This comment is above ESLint's implementation:
Expand Down
Loading