Skip to content

Commit

Permalink
fix: resolve eslint warnings (#7)
Browse files Browse the repository at this point in the history
* chore: disable `no-non-null-assertion` rule

* chore: add missing return types

* chore: remove unused vars

* chore: remove unused imports
  • Loading branch information
hadysata authored Nov 14, 2022
1 parent 8d32339 commit 576ae6a
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
// examples, and because it is not a recommended rule, you should either
// disable it, or understand what it enforces.
// https://typescript-eslint.io/rules/explicit-function-return-type/
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-function-return-type": "warn"
}
}
2 changes: 1 addition & 1 deletion functions/src/scheduled/daily_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as BotRunner from '../../../src/runner';
const dailyRunner = functions.pubsub
.schedule('0,10,30 10,11,15 * * *') // Run every day, At minute 0, 10, and 30 past hour 10, 11, 12, and 15
.timeZone('Asia/Riyadh')
.onRun(async (_) => {
.onRun(async () => {
BotRunner.runner();
});

Expand Down
2 changes: 1 addition & 1 deletion src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TwitterHelper } from './utils/twitter_helper';
import { TweetHelper } from './utils/tweet_helper';
import { SetupHelper } from './utils/setup_helper';

export async function runner() {
export async function runner(): Promise<void> {
try {
console.log('Starting runner 💡\n');

Expand Down
4 changes: 2 additions & 2 deletions src/simulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class Simulator {
/**
* It loops through all days in the semester and generates a tweet for each day
*/
public async startSimulation() {
public async startSimulation(): Promise<void> {
try {
await SetupHelper.setupAll();

Expand Down Expand Up @@ -62,7 +62,7 @@ export class Simulator {
}
}

public static async start() {
public static async start(): Promise<void> {
const calender = await CalenderHelper.getCurrentSemesterCalender();

const simulator = new Simulator(calender!);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/date_helper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DateTime, Settings } from 'luxon';

export class DateHelper {
public static setup() {
public static setup(): void {
Settings.defaultZone = 'Asia/Riyadh';
}

Expand Down
1 change: 0 additions & 1 deletion src/utils/progress_bar_helper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import console from 'console';
import { ProgressBar } from '../classes/progress_bar';
import { Calendar } from '../types/calendar';
import { CalenderHelper } from './calender_helper';

export class ProgressBarHelper {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/setup_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DateHelper } from './date_helper';
import * as dotenv from 'dotenv';

export class SetupHelper {
public static async setupAll() {
public static async setupAll() : Promise<void> {
DateHelper.setup();
dotenv.config();
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/twitter_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class TwitterHelper {
* It takes a string as an argument, and then uses the Twitter API to post that string as a tweet
* @param {string} tweet - string - The tweet you want to post.
*/
public async newTweet(tweet: string) {
public async newTweet(tweet: string): Promise<void> {
try {
await this.twitterClient.v1.tweet(tweet);

Expand Down

0 comments on commit 576ae6a

Please sign in to comment.