mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 06:30:40 +08:00
style/chore(eslint): enforce new rules (#8040)
* style: prefer object shorthand syntax * refactor: prefer Array#map over Array#forEach * style: prefer arrow callback * chore(eslint): update rules * style: auto fix by eslint
This commit is contained in:
@@ -15,7 +15,7 @@ module.exports = async (ctx) => {
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${name}`,
|
||||
link: link,
|
||||
link,
|
||||
item: $('#docContent .content h3')
|
||||
.map((_, item) => {
|
||||
item = $(item);
|
||||
@@ -24,7 +24,7 @@ module.exports = async (ctx) => {
|
||||
.replace(/[\s|#]/g, '')
|
||||
.replace(/更新说明/g, '');
|
||||
return {
|
||||
title: title,
|
||||
title,
|
||||
description:
|
||||
(item.text().indexOf('更新说明') !== -1 ? '<h3><a href="' + item.find('a[target="_blank"]').attr('href') + '" target="_blank" rel="noopener noreferrer">更新说明<span></span></a></h3>' : '') +
|
||||
item.next().html(),
|
||||
|
||||
@@ -15,13 +15,13 @@ module.exports = async (ctx) => {
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${name}`,
|
||||
link: link,
|
||||
link,
|
||||
item: $('#docContent .content h3')
|
||||
.map((_, item) => {
|
||||
item = $(item);
|
||||
const title = item.text().replace(/[\s|#]/g, '');
|
||||
return {
|
||||
title: title,
|
||||
title,
|
||||
description: item.next().html(),
|
||||
pubDate: new Date(new RegExp(/\d{4}-\d{2}-\d{2}/).exec(title) + ' GMT+8').toUTCString(),
|
||||
link: link + item.find('a.header-anchor').attr('href'),
|
||||
|
||||
@@ -13,14 +13,14 @@ module.exports = async (ctx) => {
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${name}`,
|
||||
link: link,
|
||||
link,
|
||||
item: ctx.params.caty
|
||||
? $('#docContent .content h3')
|
||||
.map((_, item) => {
|
||||
item = $(item);
|
||||
const title = item.text().replace(/[\s|#]/g, '');
|
||||
return {
|
||||
title: title,
|
||||
title,
|
||||
description: item.next().html(),
|
||||
pubDate: new Date(new RegExp(/\d{4}.\d{2}.\d{2}/).exec(title) + ' GMT+8').toUTCString(),
|
||||
link: link + item.find('a.header-anchor').attr('href'),
|
||||
@@ -35,10 +35,10 @@ module.exports = async (ctx) => {
|
||||
.text()
|
||||
.replace(/[\s|#]/g, '');
|
||||
return {
|
||||
title: title,
|
||||
title,
|
||||
description: $(item).html(),
|
||||
pubDate: new Date(new RegExp(/\d{4}.\d{2}.\d{2}/).exec(title) + ' GMT+8').toUTCString(),
|
||||
link: link,
|
||||
link,
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
|
||||
Reference in New Issue
Block a user