Refactor: Fix linting issues caused by new XO version.
This commit is contained in:
parent
904be5b097
commit
307cfa4bd0
12
gulpfile.js
12
gulpfile.js
|
@ -4,7 +4,7 @@ const cheerio = require('cheerio');
|
|||
const df = require('date-format');
|
||||
const {Feed} = require('feed');
|
||||
const fs = require('fs-extra');
|
||||
const GitLab = require('gitlab/dist/es5').default;
|
||||
const GitLab = require('gitlab').Gitlab;
|
||||
const gulp = require('gulp');
|
||||
const htmlclean = require('gulp-htmlclean');
|
||||
const klaw = require('klaw-sync');
|
||||
|
@ -228,7 +228,7 @@ function createIssueTable() {
|
|||
// We're going to be replacing all instances of <> signs to make sure nobody can add
|
||||
// <script></script> in their issue title and run JS on the site or mess up the layout or something
|
||||
// I do check myself before I commit and push anything but I'd rather be completely sure.
|
||||
title = issue.title.substring(0, 47).replace(/[<>]/g, '') + '...';
|
||||
title = issue.title.slice(0, 47).replace(/[<>]/g, '') + '...';
|
||||
} else {
|
||||
title = issue.title.replace(/[<>]/g, '');
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ function createIssueTable() {
|
|||
|
||||
let title;
|
||||
if (issue.title.length >= 50) {
|
||||
title = issue.title.substring(0, 47).replace(/[<>]/g, '') + '...';
|
||||
title = issue.title.slice(0, 47).replace(/[<>]/g, '') + '...';
|
||||
} else {
|
||||
title = issue.title.replace(/[<>]/g, '');
|
||||
}
|
||||
|
@ -411,8 +411,8 @@ function createFeeds() {
|
|||
const yearA = Number(a.replace(/\D/g, ''));
|
||||
const yearB = Number(b.replace(/\D/g, ''));
|
||||
if (yearA === yearB) {
|
||||
const monthA = months.join(',').toLowerCase().split(',').indexOf(a.substring(0, a.indexOf('-'))) + 1;
|
||||
const monthB = months.join(',').toLowerCase().split(',').indexOf(b.substring(0, b.indexOf('-'))) + 1;
|
||||
const monthA = months.join(',').toLowerCase().split(',').indexOf(a.slice(0, a.indexOf('-'))) + 1;
|
||||
const monthB = months.join(',').toLowerCase().split(',').indexOf(b.slice(0, b.indexOf('-'))) + 1;
|
||||
return monthB - monthA;
|
||||
}
|
||||
|
||||
|
@ -428,7 +428,7 @@ function createFeeds() {
|
|||
Number(post.replace(/\D/g, '')),
|
||||
// Add one to the month since UTC months are 0 based and since we set the
|
||||
// day as 0 we'll get the Date back as the last day of the previous month
|
||||
months.join(',').toLowerCase().split(',').indexOf(post.substring(0, post.indexOf('-'))) + 1,
|
||||
months.join(',').toLowerCase().split(',').indexOf(post.slice(0, post.indexOf('-'))) + 1,
|
||||
0, 23, 59, 59
|
||||
));
|
||||
const content = $('#post')
|
||||
|
|
Reference in New Issue