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
8 changes: 4 additions & 4 deletions napi/oxlint2/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Linter {
/**
* @param {string} path - The absolute path of the plugin we're loading
*/
loadPlugin = async (path) => {
async loadPlugin(path) {
if (this.pluginRegistry.isPluginRegistered(path)) {
return JSON.stringify({
Failure: 'This plugin has already been registered',
Expand All @@ -60,11 +60,11 @@ class Linter {
: 'An unknown error occurred';
return JSON.stringify({ Failure: errorMessage });
}
};
}

// TODO(camc314): why do we have to destructure here?
// In `./bindings.d.ts`, it doesn't indicate that we have to (typed as `(filePath: string, ruleIds: number[]))`
lint = ([filePath, ruleIds]) => {
lint([filePath, ruleIds]) {
if (typeof filePath !== 'string' || filePath.length === 0) {
throw new Error('expected filePath to be a non-zero length string');
}
Expand Down Expand Up @@ -93,7 +93,7 @@ class Linter {
// TODO: walk the AST

return JSON.stringify(diagnostics);
};
}
}

async function main() {
Expand Down
Loading