Skip to content

Commit 8160e72

Browse files
Fix missing explicit return types
1 parent ad04042 commit 8160e72

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

.eslintrc.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
{
2-
"extends": "./node_modules/gts/"
3-
}
2+
"extends": "./node_modules/gts/",
3+
"overrides": [
4+
{
5+
"files": "src/**/*.ts",
6+
"rules": {
7+
"@typescript-eslint/explicit-module-boundary-types": 1
8+
}
9+
}
10+
]
11+
}

src/electionguard/core/logging.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ type LogStringType = string | (() => string);
2121
* Sets which logs are ignored. INFO gives all logs. WARN
2222
* gives only WARN and ERROR. ERROR gives only ERROR logs.
2323
*/
24-
export function verbosity(type: LogTypes) {
24+
export function verbosity(type: LogTypes): void {
2525
logLevel = type;
2626
}
2727

2828
/** Logs some information. */
29-
export function info(module: string, contents: LogStringType) {
29+
export function info(module: string, contents: LogStringType): void {
3030
common('INFO', module, contents);
3131
}
3232

3333
/** Logs a warning. */
34-
export function warn(module: string, contents: LogStringType) {
34+
export function warn(module: string, contents: LogStringType): void {
3535
common('WARN', module, contents);
3636
}
3737

@@ -73,6 +73,6 @@ export function getAllLogs(): string[] {
7373
}
7474

7575
/** Prints all the logs to the console. */
76-
export function consoleAllLogs() {
76+
export function consoleAllLogs(): void {
7777
console.log(allLogs.join('\n'));
7878
}

src/electionguard/core/nonces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class Nonces implements Iterable<ElementModQ> {
4343
[Symbol.iterator](): Iterator<ElementModQ> {
4444
let counter = 0;
4545
return {
46-
next: () => {
46+
next: (): IteratorResult<ElementModQ> => {
4747
return {
4848
done: false,
4949
value: this.get(counter++),

src/electionguard/core/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,6 @@ export function undefinedToNull<T>(x: T | undefined): T | null {
345345
}
346346

347347
/** Converts a date to an ISO 8601-formatted string (without milliseconds). */
348-
export function dateToISOString(date: Date) {
348+
export function dateToISOString(date: Date): string {
349349
return `${date.toISOString().split('.')[0]}Z`;
350350
}

0 commit comments

Comments
 (0)