Skip to content

Commit 8375723

Browse files
authored
Merge branch 'master' into chore/deps/update-and-pinned-deps
2 parents 6040f3e + 391c7d8 commit 8375723

File tree

6 files changed

+14
-18
lines changed

6 files changed

+14
-18
lines changed

eslint.config.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
const config = require('eslint-config-hexo/ts');
2-
const testConfig = require('eslint-config-hexo/test');
2+
const testConfig = require('eslint-config-hexo/ts-test');
33

44
module.exports = [
55
// Configurations applied globally
66
...config,
77
{
88
rules: {
99
'@typescript-eslint/no-explicit-any': 0,
10-
'@typescript-eslint/no-var-requires': 0,
1110
'@typescript-eslint/no-require-imports': 0,
12-
'n/no-missing-require': 0,
1311
'n/no-missing-import': 0,
12+
'n/no-missing-require': 0,
1413
'@typescript-eslint/no-unused-vars': [
1514
'error', {
1615
'argsIgnorePattern': '^_'
@@ -19,15 +18,15 @@ module.exports = [
1918
}
2019
},
2120
// Configurations applied only to test files
22-
{
23-
files: [
24-
'test/**/*.ts'
25-
],
26-
languageOptions: {
27-
...testConfig.languageOptions
28-
},
21+
...testConfig.map(config => ({
22+
...config,
23+
files: ['test/**/*.ts'],
2924
rules: {
30-
...testConfig.rules,
25+
...config.rules,
26+
'@typescript-eslint/no-explicit-any': 0,
27+
'@typescript-eslint/no-require-imports': 0,
28+
'n/no-missing-require': 0,
29+
'n/no-missing-import': 0,
3130
'@typescript-eslint/ban-ts-comment': 0,
3231
'@typescript-eslint/no-unused-expressions': 0,
3332
'@typescript-eslint/no-unused-vars': [
@@ -38,5 +37,5 @@ module.exports = [
3837
}
3938
]
4039
}
41-
}
40+
}))
4241
];

lib/box/file.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class File {
2222
/**
2323
* File type. The value can be create, update, skip, delete.
2424
*/
25-
// eslint-disable-next-line no-use-before-define
2625
public type: typeof File.TYPE_CREATE | typeof File.TYPE_UPDATE | typeof File.TYPE_SKIP | typeof File.TYPE_DELETE;
2726
static TYPE_CREATE: 'create';
2827
static TYPE_UPDATE: 'update';

lib/hexo/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ const routeCache = new WeakMap();
5151

5252
const castArray = (obj: any) => { return Array.isArray(obj) ? obj : [obj]; };
5353

54-
// eslint-disable-next-line no-use-before-define
5554
const mergeCtxThemeConfig = (ctx: Hexo) => {
5655
// Merge hexo.config.theme_config into hexo.theme.config before post rendering & generating
5756
// config.theme_config has "_config.[theme].yml" merged in load_theme_config.js
@@ -60,7 +59,6 @@ const mergeCtxThemeConfig = (ctx: Hexo) => {
6059
}
6160
};
6261

63-
// eslint-disable-next-line no-use-before-define
6462
const createLoadThemeRoute = function(generatorResult: BaseGeneratorReturn, locals: LocalsType, ctx: Hexo) {
6563
const { log, theme } = ctx;
6664
const { path, cache: useCache } = locals;

lib/plugins/filter/after_post_render/external_link.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type Hexo from '../../../hexo';
33
import type { RenderData } from '../../../types';
44

55
let EXTERNAL_LINK_POST_ENABLED = true;
6-
const rATag = /<a(?:\s+?|\s+?[^<>]+?\s+?)href=["']((?:https?:|\/\/)[^<>"']+)["'][^<>]*>/gi;
6+
const rATag = /<a\s[^<>]*?href=["']((?:https?:|\/\/)[^<>"']+)["'][^<>]*>/gi;
77
const rTargetAttr = /target=/i;
88
const rRelAttr = /rel=/i;
99
const rRelStrAttr = /rel=["']([^<>"']*)["']/i;

lib/plugins/filter/after_render/external_link.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { isExternalLink } from 'hexo-util';
22
import type Hexo from '../../../hexo';
33

44
let EXTERNAL_LINK_SITE_ENABLED = true;
5-
const rATag = /<a(?:\s+?|\s+?[^<>]+?\s+?)href=["']((?:https?:|\/\/)[^<>"']+)["'][^<>]*>/gi;
5+
const rATag = /<a\s[^<>]*?href=["']((?:https?:|\/\/)[^<>"']+)["'][^<>]*>/gi;
66
const rTargetAttr = /target=/i;
77
const rRelAttr = /rel=/i;
88
const rRelStrAttr = /rel=["']([^<>"']*)["']/i;

test/scripts/filters/save_database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('Save database', () => {
1818
const exist = await exists(dbPath);
1919
exist.should.be.true;
2020

21-
unlink(dbPath);
21+
await unlink(dbPath);
2222
});
2323

2424
it('do nothing if hexo is not initialized', async () => {

0 commit comments

Comments
 (0)