Bauke/tildes-issue-log
Bauke
/
tildes-issue-log
Archived
1
Fork 0

Update the dependencies and fix all the new linting issues.

This commit is contained in:
Bauke 2020-06-30 00:26:01 +02:00
parent 19cd2a2f0c
commit 35f9319012
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
9 changed files with 1549 additions and 1044 deletions

View File

@ -21,30 +21,30 @@
"modern-normalize": "^0.6.0"
},
"devDependencies": {
"@types/cheerio": "^0.22.16",
"@types/got": "^9.6.9",
"@types/marked": "^0.7.2",
"@types/cheerio": "^0.22.18",
"@types/got": "^9.6.11",
"@types/marked": "^1.1.0",
"@types/nunjucks": "^3.1.3",
"@types/tar": "^4.0.3",
"@types/wordwrap": "^1.0.0",
"cheerio": "^1.0.0-rc.3",
"cpy-cli": "^3.1.0",
"fecha": "^4.1.0",
"feed": "^4.1.0",
"cpy-cli": "^3.1.1",
"fecha": "^4.2.0",
"feed": "^4.2.0",
"gitlab": "^14.2.2",
"got": "^10.6.0",
"got": "^11.3.0",
"htmlclean": "^3.0.8",
"marked": "^0.8.0",
"nunjucks": "^3.2.0",
"sass": "^1.26.1",
"stylelint": "^13.2.0",
"marked": "^1.1.0",
"nunjucks": "^3.2.1",
"sass": "^1.26.9",
"stylelint": "^13.6.1",
"stylelint-config-xo-scss": "^0.12.0",
"stylelint-config-xo-space": "^0.14.0",
"tar": "^6.0.1",
"ts-node": "^8.6.2",
"typescript": "^3.8.2",
"tar": "^6.0.2",
"ts-node": "^8.10.2",
"typescript": "^3.9.5",
"wordwrap": "^1.0.0",
"xo": "^0.27.2"
"xo": "^0.32.0"
},
"stylelint": {
"extends": [

View File

@ -8,7 +8,7 @@ window.addEventListener('load', () => {
}
// When the theme button is clicked, switch the theme to the other one.
themeToggleButton.addEventListener('click', event => {
themeToggleButton.addEventListener('click', (event) => {
event.preventDefault();
if (document.body.getAttribute('id') === 'dark-theme') {

View File

@ -17,5 +17,5 @@ async function entry(): Promise<void> {
}
if (require.main === module) {
entry();
void entry();
}

View File

@ -19,10 +19,10 @@ async function setupGitLabAPI(): Promise<GitLab> {
return api;
}
async function setupTempDirectory(): Promise<string> {
const tempDirectory: string = join(__dirname, '../../temp/');
await fsp.mkdir(tempDirectory + 'data/', {recursive: true});
return tempDirectory;
async function setupTemporaryDirectory(): Promise<string> {
const temporaryDirectory: string = join(__dirname, '../../temp/');
await fsp.mkdir(temporaryDirectory + 'data/', {recursive: true});
return temporaryDirectory;
}
async function getConfig(): Promise<Config> {
@ -33,13 +33,13 @@ async function getConfig(): Promise<Config> {
}
export async function getCommits(): Promise<any[]> {
const tempDirectory: string = await setupTempDirectory();
const temporaryDirectory: string = await setupTemporaryDirectory();
const api: GitLab = await setupGitLabAPI();
const project: gitlab.ProjectSchema = await api.Projects.show(
'tildes/tildes'
);
const commitsPath: string = join(
tempDirectory,
temporaryDirectory,
`data/commits (${fecha.format(new Date(), 'YYYY-MM-DD')}).json`
);
let commits: any[];
@ -59,13 +59,13 @@ export async function getCommits(): Promise<any[]> {
}
export async function getIssues(): Promise<any[]> {
const tempDirectory: string = await setupTempDirectory();
const temporaryDirectory: string = await setupTemporaryDirectory();
const api: GitLab = await setupGitLabAPI();
const project: gitlab.ProjectSchema = await api.Projects.show(
'tildes/tildes'
);
const issuesPath: string = join(
tempDirectory,
temporaryDirectory,
`data/issues (${fecha.format(new Date(), 'YYYY-MM-DD')}).json`
);
let issues: any[];
@ -83,13 +83,13 @@ export async function getIssues(): Promise<any[]> {
}
export async function getMergeRequests(): Promise<any[]> {
const tempDirectory: string = await setupTempDirectory();
const temporaryDirectory: string = await setupTemporaryDirectory();
const api: GitLab = await setupGitLabAPI();
const project: gitlab.ProjectSchema = await api.Projects.show(
'tildes/tildes'
);
const mergeRequestsPath: string = join(
tempDirectory,
temporaryDirectory,
`data/merge requests (${fecha.format(new Date(), 'YYYY-MM-DD')}).json`
);
let mergeRequests: any[];
@ -114,5 +114,5 @@ export async function getMergeRequests(): Promise<any[]> {
}
if (require.main === module) {
entry();
void entry();
}

View File

@ -1,7 +1,7 @@
import {promises as fsp} from 'fs';
import {basename, join} from 'path';
import fecha from 'fecha';
// @ts-ignore
// @ts-expect-error
import htmlclean from 'htmlclean';
import marked from 'marked';
import nunjucks from 'nunjucks';
@ -99,7 +99,7 @@ async function entry(): Promise<void> {
// Get the statistics for that month.
const statistic: Statistics = statistics.find(
val => val.year === Number(year) && val.month === monthNumber
(value) => value.year === Number(year) && value.month === monthNumber
)!;
const topics: OfficialTopic[] = await getTopicsFromMonth(
@ -184,7 +184,7 @@ async function entry(): Promise<void> {
export async function renderTemplate(
template: string,
location: string,
context: object = {}
context: Record<string, unknown> = {}
): Promise<void> {
const html: string = htmlclean(nunjucks.render(template, context));
await fsp.writeFile(location, html);
@ -211,5 +211,5 @@ export function pluralize(
}
if (require.main === module) {
entry();
void entry();
}

View File

@ -58,8 +58,8 @@ async function entry(): Promise<void> {
// If all pagination buttons are "previous" buttons, stop the loop.
if (
paginationButtons.every(val =>
val.firstChild.data?.toLowerCase().includes('prev')
paginationButtons.every((value) =>
value.firstChild.data?.toLowerCase().includes('prev')
)
) {
hasNextButton = false;
@ -76,7 +76,7 @@ async function entry(): Promise<void> {
}
export async function wait(timeout: number): Promise<void> {
return new Promise(resolve => setTimeout(resolve, timeout));
return new Promise((resolve) => setTimeout(resolve, timeout));
}
export async function getTopicsFromMonth(
@ -100,5 +100,5 @@ export async function getTopicsFromMonth(
}
if (require.main === module) {
entry();
void entry();
}

View File

@ -33,5 +33,5 @@ async function entry(): Promise<void> {
}
if (require.main === module) {
entry();
void entry();
}

View File

@ -288,7 +288,7 @@ export async function findData<T extends Result>(
}
// Find the monthly that applies to this datapoint.
const monthly: T | undefined = monthlies.find(result =>
const monthly: T | undefined = monthlies.find((result) =>
findFn(result, point)
);
@ -311,11 +311,11 @@ async function getResultCount(
month: number
): Promise<number> {
const result: MonthlyResult | undefined = results.find(
val => val.year === year && val.month === month
(value) => value.year === year && value.month === month
);
return result === undefined ? 0 : result.count;
}
if (require.main === module) {
entry();
void entry();
}

2513
yarn.lock

File diff suppressed because it is too large Load Diff