Skip to content

Commit 09a9d0c

Browse files
committed
x
1 parent e3e988a commit 09a9d0c

27 files changed

+504
-300
lines changed

.eslintignore

Lines changed: 0 additions & 13 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 31 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"cSpell.words": ["idlweb", "tailwindcss", "uwdata"],
3+
"eslint.experimental.useFlatConfig": true
4+
}

eslint.config.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// https://github.com/sveltejs/eslint-plugin-svelte/issues/732
2+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
3+
import eslintPluginSvelte from 'eslint-plugin-svelte';
4+
import js from '@eslint/js';
5+
import svelteParser from 'svelte-eslint-parser';
6+
import tsEslint from 'typescript-eslint';
7+
import tsParser from '@typescript-eslint/parser';
8+
9+
import globals from 'globals';
10+
11+
export default [
12+
{
13+
ignores: ['.DS_Store', 'node_modules', 'build/', '.svelte-kit/', 'index.js']
14+
},
15+
js.configs.recommended,
16+
...tsEslint.configs.strict,
17+
...eslintPluginSvelte.configs['flat/recommended'],
18+
eslintPluginPrettierRecommended, // must be last to override conflicting rules.
19+
{
20+
languageOptions: {
21+
globals: {
22+
...globals.node,
23+
...globals.browser
24+
}
25+
}
26+
},
27+
{
28+
rules: {
29+
'no-console': 'off',
30+
'@typescript-eslint/no-non-null-assertion': 'off'
31+
}
32+
},
33+
{
34+
files: ['**/*.svelte'],
35+
languageOptions: {
36+
parser: svelteParser,
37+
parserOptions: {
38+
parser: tsParser
39+
}
40+
},
41+
rules: {
42+
'svelte/no-target-blank': 'error',
43+
'svelte/no-at-debug-tags': 'error',
44+
'svelte/no-reactive-functions': 'error',
45+
'svelte/no-reactive-literals': 'error',
46+
'svelte/no-at-html-tags': 'off'
47+
}
48+
}
49+
];

index.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1+
// AM: does the file need to exist?
12
// cache pre-existing global values
2-
var globals = ["d3"],
3-
globalValues = {};
3+
var globals = ['d3'],
4+
globalValues = {};
45

5-
globals.forEach(function(g) {
6-
if (g in global) globalValues[g] = global[g];
6+
globals.forEach(function (g) {
7+
if (g in global) globalValues[g] = global[g];
78
});
89

910
// ensure availability of d3 in global namespace
10-
d3 = require("d3");
11+
// eslint-disable-next-line no-undef
12+
d3 = require('d3');
1113

1214
// load and export vega
13-
require("./idl");
15+
// eslint-disable-next-line @typescript-eslint/no-require-imports
16+
require('./idl');
17+
// eslint-disable-next-line no-undef
1418
module.exports = idl;
1519

1620
// restore pre-existing global values
17-
globals.forEach(function(g) {
18-
if (g in globalValues) global[g] = globalValues[g];
19-
else delete global[g];
20-
});
21+
globals.forEach(function (g) {
22+
if (g in globalValues) global[g] = globalValues[g];
23+
else delete global[g];
24+
});

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"integrity-enforcement": "vite-node scripts/integrity-enforcement.ts "
2020
},
2121
"devDependencies": {
22+
"@eslint/js": "^9.13.0",
2223
"@sveltejs/adapter-auto": "^3.2.2",
2324
"@sveltejs/adapter-static": "^3.0.2",
2425
"@sveltejs/kit": "^2.5.17",
@@ -32,9 +33,11 @@
3233
"@vitest/ui": "^1.6.0",
3334
"ajv": "^8.16.0",
3435
"autoprefixer": "^10.4.19",
35-
"eslint": "^8.56.0",
36+
"eslint": "^9.13.0",
3637
"eslint-config-prettier": "^9.1.0",
37-
"eslint-plugin-svelte": "^2.40.0",
38+
"eslint-plugin-prettier": "^5.2.1",
39+
"eslint-plugin-svelte": "^2.45.1",
40+
"globals": "^15.11.0",
3841
"husky": "^9.0.11",
3942
"postcss": "^8.4.38",
4043
"prettier": "^3.3.2",
@@ -45,6 +48,7 @@
4548
"ts-json-schema-generator": "^1.5.0",
4649
"tslib": "^2.6.3",
4750
"typescript": "^5.5.2",
51+
"typescript-eslint": "^8.10.0",
4852
"vite": "^5.3.1",
4953
"vitest": "^1.6.0"
5054
},

postcss.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default {
2-
plugins: {
3-
tailwindcss: {},
4-
autoprefixer: {},
5-
},
6-
}
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {}
5+
}
6+
};

scripts/integrity-enforcement.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import type { Paper, Person } from '../src/lib/app-types';
44

55
async function generateIndex() {
66
const people = JSON.parse(peopleRaw) as Person[];
7-
const personMap = Object.fromEntries(
8-
people.map((p) => [`${p.first_name} ${p.last_name}`, p])
9-
);
7+
const personMap = Object.fromEntries(people.map((p) => [`${p.first_name} ${p.last_name}`, p]));
108
const paperList = await fs.readdir('./static/papers');
119

1210
const papers = [] as Paper[];

src/lib/author-list.svelte

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66

77
{#each people as author, i}
88
{#if author.url}
9-
<a href={author.url}>{displayName(author)}</a>{i <
10-
people.length - 1
11-
? ', '
12-
: ''}
9+
<a href={author.url}>{displayName(author)}</a>{i < people.length - 1 ? ', ' : ''}
1310
{:else}
1411
{`${displayName(author)}${i < people.length - 1 ? ', ' : ''}`}
1512
{/if}

src/lib/bibtex.svelte

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
const edits = (p.editors || '').replace('&', 'AND');
1010
const pages = (p.start_page || '') + (p.end_page ? '--' + p.end_page : '');
1111
const auths = p.authors.map((a) => `${a.last_name}, ${a.first_name}`).join(' AND ');
12-
const type = v.venueType == 'journal' ? 'article'
13-
: v.venueType == 'book' ? 'incollection'
14-
: 'inproceedings';
12+
const type =
13+
v.venueType == 'journal'
14+
? 'article'
15+
: v.venueType == 'book'
16+
? 'incollection'
17+
: 'inproceedings';
1518
1619
const fields = [
1720
attr('title', escape(p.title)),
@@ -28,38 +31,48 @@
2831
attr('doi', p.doi)
2932
];
3033
31-
const id = `${p.year}-${p.web_name}`;
34+
const id = `${p.year}-${p.web_name}`;
3235
return `@${type}{${id},\n${fields.filter((x) => x).join(',\n')}\n}`;
3336
}
3437
3538
function attr(name: string, value?: string | number | null) {
36-
return value ? ` ${name} = {${value}}` : '';
37-
}
39+
return value ? ` ${name} = {${value}}` : '';
40+
}
3841
3942
function escape(str: string = '') {
4043
return str
41-
.replace('&', '\\&')
42-
.replace('%', '\\%')
43-
.replace(/\u00E9/, "\\'{e}")
44-
.replace(/\u00C7/, '\\c{C}')
45-
.replace(/\u011F/, '\\u{g}');
44+
.replace('&', '\\&')
45+
.replace('%', '\\%')
46+
.replace(/\u00E9/, "\\'{e}")
47+
.replace(/\u00C7/, '\\c{C}')
48+
.replace(/\u011F/, '\\u{g}');
4649
}
4750
48-
const bibtex = formatBibtex(paper, venue);
51+
const bibtex = formatBibtex(paper, venue);
4952
50-
async function copyBibtex() {
51-
await navigator.clipboard.writeText(bibtex);
52-
alert('Copied BibTeX citation data to clipboard.');
53-
}
53+
async function copyBibtex() {
54+
await navigator.clipboard.writeText(bibtex);
55+
alert('Copied BibTeX citation data to clipboard.');
56+
}
5457
</script>
5558

5659
<div class="group relative bg-slate-100 p-2">
57-
<button
60+
<button
5861
class="absolute top-0.5 right-0.5 p-1 rounded-md text-gray-400 hover:text-gray-600 active:bg-slate-600 active:text-white"
5962
title="Copy BibTeX citation"
6063
on:click={copyBibtex}
6164
>
62-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2"><path d="M2 6C2 5.44772 2.44772 5 3 5H10C10.5523 5 11 5.44772 11 6V13C11 13.5523 10.5523 14 10 14H3C2.44772 14 2 13.5523 2 13V6Z M4 2.00004L12 2.00001C13.1046 2 14 2.89544 14 4.00001V12"></path></svg>
65+
<svg
66+
width="16"
67+
height="16"
68+
viewBox="0 0 16 16"
69+
fill="none"
70+
stroke="currentColor"
71+
stroke-width="2"
72+
><path
73+
d="M2 6C2 5.44772 2.44772 5 3 5H10C10.5523 5 11 5.44772 11 6V13C11 13.5523 10.5523 14 10 14H3C2.44772 14 2 13.5523 2 13V6Z M4 2.00004L12 2.00001C13.1046 2 14 2.89544 14 4.00001V12"
74+
></path></svg
75+
>
6376
</button>
64-
<pre class="font-mono text-xs whitespace-pre-wrap">{bibtex}</pre>
77+
<pre class="font-mono text-xs whitespace-pre-wrap">{bibtex}</pre>
6578
</div>

0 commit comments

Comments
 (0)