Skip to content

Commit

Permalink
fix: linter (#1733)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengkx authored Sep 14, 2024
1 parent e86d053 commit a971fc7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
15 changes: 14 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ module.exports = {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'warn'
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true
}
]
}
};
3 changes: 2 additions & 1 deletion source/knexfile.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* eslint @typescript-eslint/explicit-module-boundary-types: 0 */
try {
// eslint-disable-next-line @typescript-eslint/no-require-imports
const pg = require('pg');
pg.types.setTypeParser(20, 'text', parseInt);
} catch (err) {
} catch (_err) {
logger.info('There is no pg');
}
import { config } from './config';
Expand Down
4 changes: 3 additions & 1 deletion source/middlewares/sub-multi-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export default async (
ttl: Number.isNaN(rssFeed.ttl) ? 0 : rssFeed.ttl
};
} catch (e) {
ctx.reply(`${url} ${i18n[lang]['FETCH_ERROR']}`);
ctx.reply(
`${url} ${i18n[lang]['FETCH_ERROR']} ${e.message}`
);
return undefined;
}
}
Expand Down
4 changes: 2 additions & 2 deletions source/utils/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export async function isFeedValid(feedStr: string): Promise<Option<TRSS>> {
try {
const feed = await parseString(feedStr);
return Optional(feed);
} catch (e) {
} catch (_e) {
return none;
}
}
Expand All @@ -27,7 +27,7 @@ export async function findFeed(
const url = linkTag.match(/href="(.+?)"/)[1];
try {
return new URL(url).toString();
} catch (e) {
} catch (_e) {
reqURL.pathname = url;
return reqURL.toString();
}
Expand Down

0 comments on commit a971fc7

Please sign in to comment.