Skip to content

Commit

Permalink
fix: get the new eslint rules working
Browse files Browse the repository at this point in the history
  • Loading branch information
aalemayhu committed Oct 17, 2024
1 parent 4f8049b commit ee04e6d
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ module.exports = {
'react/jsx-filename-extension': 'off',
'prettier/prettier': ['error'],
'require-await': 'error',
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/no-throw-literal': 'off',
},
"ignorePatterns": ["src/data_layer/public/", "migrations", "*.test.*"],
ignorePatterns: ['src/data_layer/public/', 'migrations', '*.test.*'],
};
1 change: 1 addition & 0 deletions src/controllers/FavoritesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class FavoritesController {
);
res.json(favorites);
} catch (error) {
console.error(error);
res.json([]);
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/lib/isStaging.ts

This file was deleted.

4 changes: 3 additions & 1 deletion src/lib/parser/DeckParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ export class DeckParser {
try {
const firstHeading = dom('h1').first();
return firstHeading.text();
} catch (_e) {
} catch (e) {
console.error(e);
return undefined;
}
}
Expand Down Expand Up @@ -305,6 +306,7 @@ export class DeckParser {
}
return ma;
} catch (error) {
console.error(error);
return null;
}
});
Expand Down
1 change: 1 addition & 0 deletions src/lib/parser/ParserRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class ParserRules {
rules.EMAIL_NOTIFICATION = result.email_notification;
return rules;
} catch (error) {
console.error(error);
return new ParserRules();
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/storage/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export function isFileNameEqual(file: File, name: string) {
return true;
}
} catch (error) {
console.error(error);
console.debug('Failed to decode name');
}

Expand All @@ -62,6 +63,7 @@ export function isFileNameEqual(file: File, name: string) {

return decodedFilename === decodedName;
} catch (error) {
console.error(error);
console.debug('Failed to decode names');
}

Expand Down
5 changes: 1 addition & 4 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import webhookRouter from './routes/WebhookRouter';

import { sendError } from './lib/error/sendError';

import { isStaging } from './lib/isStaging';
import { getDatabase, setupDatabase } from './data_layer';

function registerSignalHandlers(server: http.Server) {
Expand All @@ -57,9 +56,7 @@ const serve = async () => {
app.use(express.json({ limit: '1000mb' }) as RequestHandler);
app.use(cookieParser());

if (isStaging()) {
app.use(morgan('combined') as RequestHandler);
}
app.use(morgan('combined') as RequestHandler);

app.use('/templates', express.static(templateDir));
app.use(express.static(BUILD_DIR));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default async function useMetadata(url: string): Promise<Metadata> {
const response = await axios.get(url);
return metascraper({ html: response.data, url });
} catch (error) {
console.error(error);
return {
description: '',
title: new URL(url).hostname,
Expand Down

0 comments on commit ee04e6d

Please sign in to comment.