Skip to content

Commit

Permalink
Fix more lint errors in src/translate/index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
J0nathanLai authored Nov 11, 2024
1 parent 19bcfad commit abd0007
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/translate/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
'use strict';

var request = require('request');

Check failure on line 3 in src/translate/index.js

View workflow job for this annotation

GitHub Actions / test

Unexpected var, use let or const instead

Check failure on line 3 in src/translate/index.js

View workflow job for this annotation

GitHub Actions / test

'request' is assigned a value but never used

const translatorApi = module.exports;

translatorApi.translate = async function (postData) {
// Edit the translator URL below
const TRANSLATOR_API = "https://nodebb-translator-wooshiland.azurewebsites.net/"
const response = await fetch(TRANSLATOR_API+'/?content='+postData.content);
const TRANSLATOR_API = "https://nodebb-translator-wooshiland.azurewebsites.net/";

Check failure on line 9 in src/translate/index.js

View workflow job for this annotation

GitHub Actions / test

Strings must use singlequote
const response = await fetch(TRANSLATOR_API + '/?content=' + postData.content);

Check failure on line 10 in src/translate/index.js

View workflow job for this annotation

GitHub Actions / test

Unexpected string concatenation
const data = await response.json();
return [data["is_english"], data["translated_content"]]
}
return [data.is_english, data.translated_content];
};

0 comments on commit abd0007

Please sign in to comment.