Skip to content

Commit

Permalink
Fix ESLint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ttsukagoshi committed Feb 6, 2024
1 parent 7132e73 commit bce677a
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/sheetsl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ type DeepLTranslationObj = {
*/
export type DeepLLanguageType = 'source' | 'target';

/**
* The type of the object containing key-values pairs to set in the properties of the Google Apps Script.
* @see https://developers.google.com/apps-script/reference/properties/properties#setpropertiesproperties
*/
type PropertiesObj = {
[key: string]: string;
};

/**
* Create add-on menu on opening spreadsheet file.
*/
Expand Down Expand Up @@ -105,8 +113,8 @@ export function setDeeplAuthKey(): void {
`[${ADDON_NAME}] Completed: Your DeepL API Authentication Key has been saved as a user property.`,
);
} catch (error) {
console.error(error.stack);
ui.alert(error.message);
console.error((error as Error).stack);

Check warning on line 116 in src/sheetsl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
ui.alert((error as Error).message);

Check warning on line 117 in src/sheetsl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}
}

Check warning on line 119 in src/sheetsl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function

Expand Down Expand Up @@ -147,8 +155,8 @@ export function deleteDeeplAuthKey(): void {
`[${ADDON_NAME}] Complete: DeepL API Authentication Key has been deleted from your user property.`,
);
} catch (error) {
console.error(error.stack);
ui.alert(error.message);
console.error((error as Error).stack);

Check warning on line 158 in src/sheetsl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
ui.alert((error as Error).message);

Check warning on line 159 in src/sheetsl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}
}

Check warning on line 161 in src/sheetsl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function

Expand Down Expand Up @@ -233,15 +241,15 @@ export function setLanguage(): void {
);
}
// Set the values as user properties
let setObj = {};
let setObj: PropertiesObj = {};

Check warning on line 244 in src/sheetsl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
setObj[UP_KEY_SOURCE_LOCALE] = responseSourceLocale;
setObj[UP_KEY_TARGET_LOCALE] = responseTargetLocale;
up.setProperties(setObj, false);
// Complete
ui.alert('Completed: Language setting has been completed.');
} catch (error) {
console.error(error.stack);
ui.alert(error.message);
console.error((error as Error).stack);

Check warning on line 251 in src/sheetsl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
ui.alert((error as Error).message);

Check warning on line 252 in src/sheetsl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}
}

Check warning on line 254 in src/sheetsl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function

Expand Down Expand Up @@ -318,8 +326,8 @@ export function translateRange(): void {
// Complete
ui.alert('Complete: Translation has been completed.');
} catch (error) {
console.error(error.stack);
ui.alert(error.message);
console.error((error as Error).stack);

Check warning on line 329 in src/sheetsl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
ui.alert((error as Error).message);

Check warning on line 330 in src/sheetsl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}
}

Check warning on line 332 in src/sheetsl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function

Expand Down

0 comments on commit bce677a

Please sign in to comment.