Skip to content

Commit a971fc7

Browse files
authored
fix: linter (#1733)
1 parent e86d053 commit a971fc7

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

.eslintrc.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@ module.exports = {
2828
'@typescript-eslint/no-var-requires': 'off',
2929
'@typescript-eslint/explicit-function-return-type': 'off',
3030
'@typescript-eslint/no-explicit-any': 'off',
31-
'@typescript-eslint/ban-ts-comment': 'warn'
31+
'@typescript-eslint/ban-ts-comment': 'warn',
32+
'@typescript-eslint/no-unused-expressions': 'off',
33+
'@typescript-eslint/no-unused-vars': [
34+
'error',
35+
{
36+
args: 'all',
37+
argsIgnorePattern: '^_',
38+
caughtErrors: 'all',
39+
caughtErrorsIgnorePattern: '^_',
40+
destructuredArrayIgnorePattern: '^_',
41+
varsIgnorePattern: '^_',
42+
ignoreRestSiblings: true
43+
}
44+
]
3245
}
3346
};

source/knexfile.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/* eslint @typescript-eslint/explicit-module-boundary-types: 0 */
22
try {
3+
// eslint-disable-next-line @typescript-eslint/no-require-imports
34
const pg = require('pg');
45
pg.types.setTypeParser(20, 'text', parseInt);
5-
} catch (err) {
6+
} catch (_err) {
67
logger.info('There is no pg');
78
}
89
import { config } from './config';

source/middlewares/sub-multi-url.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ export default async (
3333
ttl: Number.isNaN(rssFeed.ttl) ? 0 : rssFeed.ttl
3434
};
3535
} catch (e) {
36-
ctx.reply(`${url} ${i18n[lang]['FETCH_ERROR']}`);
36+
ctx.reply(
37+
`${url} ${i18n[lang]['FETCH_ERROR']} ${e.message}`
38+
);
3739
return undefined;
3840
}
3941
}

source/utils/feed.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export async function isFeedValid(feedStr: string): Promise<Option<TRSS>> {
77
try {
88
const feed = await parseString(feedStr);
99
return Optional(feed);
10-
} catch (e) {
10+
} catch (_e) {
1111
return none;
1212
}
1313
}
@@ -27,7 +27,7 @@ export async function findFeed(
2727
const url = linkTag.match(/href="(.+?)"/)[1];
2828
try {
2929
return new URL(url).toString();
30-
} catch (e) {
30+
} catch (_e) {
3131
reqURL.pathname = url;
3232
return reqURL.toString();
3333
}

0 commit comments

Comments
 (0)