From ffafc981998f1b0c4013e6a6b1f3e8d920dd204a Mon Sep 17 00:00:00 2001 From: John Doe Date: Sun, 11 Feb 2024 23:15:16 +0000 Subject: [PATCH] chore(linter): make linter happy --- clean-terms.js | 9 +++------ i18n-z2m-exporter.js | 1 - poeditor.js | 10 ++++------ 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/clean-terms.js b/clean-terms.js index eabeeb723..a0ea6e311 100644 --- a/clean-terms.js +++ b/clean-terms.js @@ -1,4 +1,4 @@ -const { getTerms, deleteTerms } = require("./poeditor"); +const { getTerms, deleteTerms } = require('./poeditor'); async function main(project_id, api_token) { const enTranslationFile = './src/i18n/locales/en.json'; @@ -11,16 +11,13 @@ async function main(project_id, api_token) { '"settingsSchemaDescriptions"', '"settingsSchemaTitles"', ]; - const cleanableTerms = terms - .filter((term) => cleanableContexts.includes(term.context)); + const cleanableTerms = terms.filter((term) => cleanableContexts.includes(term.context)); - const termsToClean = cleanableTerms - .filter((term) => !enTranslations[JSON.parse(term.context)][term.term]); + const termsToClean = cleanableTerms.filter((term) => !enTranslations[JSON.parse(term.context)][term.term]); console.log(`cleanableTerms ${cleanableTerms.length}, termsToClean ${termsToClean.length}`); const deletionResults = await deleteTerms(project_id, api_token, termsToClean); console.log(deletionResults); - } const { POEDITOR_PROJECT_ID, POEDITOR_API_TOKEN } = process.env; diff --git a/i18n-z2m-exporter.js b/i18n-z2m-exporter.js index 37bafec22..f378a5aa1 100644 --- a/i18n-z2m-exporter.js +++ b/i18n-z2m-exporter.js @@ -23,7 +23,6 @@ devices.forEach((device) => { const enTranslationFile = './src/i18n/locales/en.json'; const enTranslations = require(enTranslationFile); - let settingsSchemaDescriptions = {}; let settingsSchemaTitles = {}; const isObject = (value) => value !== null && typeof value === 'object'; diff --git a/poeditor.js b/poeditor.js index 781a3b23f..fe011bfe6 100644 --- a/poeditor.js +++ b/poeditor.js @@ -27,7 +27,7 @@ async function downloadLanguage(project_id, api_token, language) { async function getAvaliableLanguages(project_id, api_token) { const languages = await callApi('https://api.poeditor.com/v2/languages/list', { api_token, - id: project_id + id: project_id, }); return languages.result.languages.map((lang) => ({ code: lang.code, name: lang.name })); } @@ -36,20 +36,18 @@ async function getTerms(project_id, api_token, language) { const terms = await callApi('https://api.poeditor.com/v2/terms/list', { api_token, id: project_id, - language + language, }); return terms.result.terms.map((term) => ({ term: term.term, context: term.context })); } - async function deleteTerms(project_id, api_token, terms) { const res = await callApi('https://api.poeditor.com/v2/terms/delete', { api_token, id: project_id, - data: JSON.stringify(terms) + data: JSON.stringify(terms), }); return res; } - -module.exports = { downloadLanguage, getAvaliableLanguages, getTerms, deleteTerms }; \ No newline at end of file +module.exports = { downloadLanguage, getAvaliableLanguages, getTerms, deleteTerms };