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
7 changes: 5 additions & 2 deletions apps/oxlint/src-js/cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { lint } from './bindings.js';
import { assertIsNonNull } from './utils/asserts.js';

// Lazy-loaded JS plugin-related functions.
// Using `typeof wrapper` here makes TS check that the function signatures of `loadPlugin` and `loadPluginWrapper`
Expand All @@ -24,7 +25,8 @@ function loadPluginWrapper(path: string, packageName: string | null): Promise<st
return loadPlugin(path, packageName);
});
}
return loadPlugin!(path, packageName);
assertIsNonNull(loadPlugin);
return loadPlugin(path, packageName);
}

/**
Expand All @@ -48,7 +50,8 @@ function lintFileWrapper(
): string {
// `lintFileWrapper` is never called without `loadPluginWrapper` being called first,
// so `lintFile` must be defined here
return lintFile!(filePath, bufferId, buffer, ruleIds, settingsJSON);
assertIsNonNull(lintFile);
return lintFile(filePath, bufferId, buffer, ruleIds, settingsJSON);
}

// Get command line arguments, skipping first 2 (node binary and script path)
Expand Down
Loading