Skip to content

Commit b4502d9

Browse files
authored
removed console log and added linter rule (#458)
* removed console log and added linter rule * removed unnecessary logger info
1 parent 2151c5e commit b4502d9

File tree

6 files changed

+3
-6
lines changed

6 files changed

+3
-6
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"rules": {
1010
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
1111
"@typescript-eslint/no-non-null-assertion": "off",
12+
"no-console": 1,
1213
"prettier/prettier": [
1314
"error",
1415
{

src/codeyCommand.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ const setCommandOption = (
103103
T extends ApplicationCommandOptionBase &
104104
ApplicationCommandOptionWithChoicesAndAutocompleteMixin<B>,
105105
>(commandOption: T): T {
106-
logger.info(option.choices);
107106
return option.choices
108107
? commandOption.addChoices(...(option.choices as APIApplicationCommandOptionChoice<B>[]))
109108
: commandOption;

src/commandDetails/company/add.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const companyAddExecuteCommand: SapphireMessageExecuteType = async (
1717
if (!company_id) {
1818
throw new Error('please enter a valid crunchbase company id.');
1919
}
20-
console.log(args);
2120
const role = args['role'];
2221
if (!role) {
2322
throw new Error('please enter your role at this company.');

src/commandDetails/company/find.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ const companyFindExecuteCommand: SapphireMessageExecuteType = async (
5757
throw new Error('This company does not exist in the server!');
5858
}
5959
const companyUsers = await getEmployeesByCompanyId(<string>company_id);
60-
console.log('here');
61-
console.log(companyUsers);
6260
if (!companyUsers.length) {
6361
return 'No one works at this company in the server!';
6462
}

src/commandDetails/company/profile.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const companyProfileExecuteCommand: SapphireMessageExecuteType = async (
1414
const user = getUserFromMessage(messageFromUser);
1515
const companies = await getCompaniesByUserId(user.id);
1616
// return a string where each line is the company_id - company_name
17-
console.log(companies);
1817
const companyString = companies.map((company) => `${company.name} - ${company.role}`).join('\n');
1918
return `You are associated with the following companies:\n${companyString}`;
2019
};

src/components/cron.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
} from './suggestion';
1818
import { updateMemberRole, getRoleName, loadRoleMembers } from '../utils/roles';
1919
import { CodeyUserError } from '../codeyUserError';
20+
import { logger } from '../logger/default';
2021

2122
const NOTIF_CHANNEL_ID: string = vars.NOTIF_CHANNEL_ID;
2223
const OFFICE_STATUS_CHANNEL_ID: string = vars.OFFICE_STATUS_CHANNEL_ID;
@@ -59,7 +60,7 @@ export const createOfficeStatusCron = (client: Client): CronJob =>
5960
await (messageChannel as TextChannel).setName(curName);
6061
const time = Math.floor(response['time']);
6162
const topic = `Last updated at <t:${time}:F> for you (<t:${time}:R>)`;
62-
await (messageChannel as TextChannel).setTopic(topic).catch(console.error);
63+
await (messageChannel as TextChannel).setTopic(topic).catch(logger.error);
6364
} else {
6465
throw 'Bad channel type';
6566
}

0 commit comments

Comments
 (0)