Skip to content

Commit 8eb973b

Browse files
committed
fix linter
Added Node globals for scripts in ESLint config: eslint.config.js Removed TypeScript-only syntax from Astro frontmatter and replaced with JSDoc typing: index.astro
1 parent f5b7858 commit 8eb973b

2 files changed

Lines changed: 14 additions & 16 deletions

File tree

eslint.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
import js from '@eslint/js';
22
import tseslint from 'typescript-eslint';
33
import astroPlugin from 'eslint-plugin-astro';
4+
import globals from 'globals';
45

56
export default [
67
js.configs.recommended,
78
...tseslint.configs.recommended,
89
...astroPlugin.configs.recommended,
10+
{
11+
files: ['scripts/**/*.{js,mjs,cjs}'],
12+
languageOptions: {
13+
globals: {
14+
...globals.node,
15+
},
16+
},
17+
},
918
{
1019
ignores: ['dist', 'node_modules', '.astro', 'public/legacy', 'astro.config.mjs'],
1120
},

src/pages/docs/research/publications/index.astro

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,8 @@
22
import DocsLayout from '../../../../layouts/DocsLayout.astro';
33
import relatedResearch from '../../../../data/related-research.json';
44
5-
type RelatedPaper = {
6-
id: string;
7-
type: string;
8-
title: string;
9-
authors: string;
10-
venue: string;
11-
year: number | null;
12-
month: number;
13-
doi: string;
14-
url: string;
15-
};
16-
17-
const relatedPapers: RelatedPaper[] = relatedResearch?.papers ?? [];
5+
/** @type {Array<{id: string, type: string, title: string, authors: string, venue: string, year: number | null, month: number, doi: string, url: string}>} */
6+
const relatedPapers = relatedResearch?.papers ?? [];
187
const relatedCount = relatedPapers.length;
198
const generatedAt = relatedResearch?.generatedAt
209
? new Date(relatedResearch.generatedAt).toLocaleDateString('en-US', {
@@ -24,19 +13,19 @@ const generatedAt = relatedResearch?.generatedAt
2413
})
2514
: null;
2615
27-
function formatAuthors(authorText: string) {
16+
function formatAuthors(authorText) {
2817
if (!authorText) return 'Unknown authors';
2918
return authorText.replace(/\s+and\s+/gi, ', ');
3019
}
3120
32-
function formatVenue(paper: RelatedPaper) {
21+
function formatVenue(paper) {
3322
const parts = [];
3423
if (paper.venue) parts.push(paper.venue);
3524
if (paper.year) parts.push(String(paper.year));
3625
return parts.join('');
3726
}
3827
39-
function doiUrl(doi: string) {
28+
function doiUrl(doi) {
4029
if (!doi) return null;
4130
const normalized = doi.replace(/^https?:\/\/doi\.org\//i, '');
4231
return `https://doi.org/${normalized}`;

0 commit comments

Comments
 (0)