Skip to content

Commit 4f38e7b

Browse files
Fix eslint
1 parent 349af2e commit 4f38e7b

19 files changed

+58
-58
lines changed

eslint.config.mjs

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,41 @@
11
// @ts-check
2-
3-
import eslint from '@eslint/js';
4-
import tseslint from 'typescript-eslint';
5-
import eslintPluginSvelte from 'eslint-plugin-svelte';
2+
import js from '@eslint/js';
3+
import ts from 'typescript-eslint';
4+
import svelte from 'eslint-plugin-svelte';
65
import globals from 'globals';
76

8-
export default tseslint.config(
9-
eslint.configs.recommended,
10-
...tseslint.configs.recommended,
11-
...tseslint.configs.strict,
12-
...tseslint.configs.stylistic,
13-
...eslintPluginSvelte.configs['flat/recommended'],
7+
export default ts.config(
8+
js.configs.recommended,
9+
...ts.configs.recommended,
10+
...svelte.configs['flat/recommended'],
11+
{
12+
languageOptions: {
13+
globals: {
14+
...globals.browser,
15+
...globals.node,
16+
// Seemingly not defined in `globals.browser`
17+
ScrollBehavior: 'readonly',
18+
}
19+
}
20+
},
21+
{
22+
files: ['**/*.svelte'],
23+
languageOptions: {
24+
parserOptions: {
25+
parser: ts.parser
26+
}
27+
}
28+
},
29+
{
30+
rules: {
31+
// Allow explicit any, to avoid type gymnastics
32+
"@typescript-eslint/no-explicit-any": "off",
33+
"@typescript-eslint/no-unused-vars": ["error", {
34+
argsIgnorePattern: "^_",
35+
caughtErrors: "none",
36+
}]
37+
},
38+
},
1439
{
1540
ignores: [
1641
"**/.DS_Store",
@@ -28,20 +53,5 @@ export default tseslint.config(
2853
"**/vitest.config.ts",
2954
"eslint.config.mjs",
3055
],
31-
languageOptions: {
32-
globals: {
33-
...globals.node,
34-
...globals.browser,
35-
}
36-
},
37-
rules: {
38-
// Allow explicit any, to avoid type gymnastics
39-
"@typescript-eslint/no-explicit-any": "off",
40-
"@typescript-eslint/no-unused-vars": ["error", {
41-
argsIgnorePattern: "^_",
42-
caughtErrors: "none",
43-
}]
44-
},
4556
},
4657
);
47-

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"svelte-jester": "^3.0.0",
6363
"sync-request-curl": "^3.0.0",
6464
"tslib": "^2.4.1",
65-
"typescript": "^5.6.2",
65+
"typescript": "~5.5.0",
6666
"typescript-eslint": "^8.7.0",
6767
"vite": "^5.4.6",
6868
"vitest": "^2.0.5"

src/components/CopyButton.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { tooltip } from '$lib/tooltip';
33
44
export let text: string;
5-
export let hint: string = 'Copy';
5+
export let hint = 'Copy';
66
77
async function copy() {
88
await navigator.clipboard.writeText(text);

src/components/card/Card.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
/** Location to link to, or `false` to not give a link */
77
export let link: string | false = false;
88
/** Whether to open link in new tab */
9-
export let newTab: boolean = false;
9+
export let newTab = false;
1010
/** Color to use for the card */
1111
export let color: string;
1212
/** Whether the card has an icon */
13-
export let hasIcon: boolean = false;
13+
export let hasIcon = false;
1414
1515
const dispatch = createEventDispatcher<{
16-
click: void,
16+
click: undefined,
1717
}>();
1818
1919
$: baseColor = Color(color).lightness(85).hex();

src/components/card/GroupCardGrid.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/** Whether edit mode is active */
1616
export let editing: boolean;
1717
/** Whether to give the option to create a group in edit mode */
18-
export let createOption: boolean = false;
18+
export let createOption = false;
1919
2020
const dispatch = createEventDispatcher<{
2121
click: { groupId: string },

src/components/card/ItemCardGrid.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/** Whether edit mode is active */
1717
export let editing: boolean;
1818
/** Whether to give the option to create an item in edit mode */
19-
export let createOption: boolean = false;
19+
export let createOption = false;
2020
2121
const dispatch = createEventDispatcher<{
2222
click: { itemId: string },

src/components/card/PackageCard.svelte

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<script lang="ts">
22
import { packageIsWithProvider, packageProviders } from '$lib/packageInfo';
33
import { Card } from '.';
4-
import { tooltip } from '$lib/tooltip';
54
import type { PackageInfo } from '$lib/server/data/itemPackage';
6-
import CopyButton from '$components/CopyButton.svelte';
5+
import CopyButton from '$components/CopyButton.svelte';
76
87
export let info: PackageInfo;
98
export let color: string;
@@ -27,10 +26,6 @@
2726
packageIsWithProvider(info)
2827
? packageProviders[info.provider].makeInstallCmd(info.id)
2928
: info.command);
30-
31-
async function copyInstallCommand() {
32-
await navigator.clipboard.writeText(installCommand);
33-
}
3429
</script>
3530

3631
<Card

src/components/chip/Chip.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/** Location to link to on click (or `undefined` for no link) */
1212
export let link: string | undefined;
1313
/** Whether the chip should render as selected (filled) */
14-
export let selected: boolean = false;
14+
export let selected = false;
1515
1616
$: fillColor = selected ? Color(color).lightness(80).hex() : Color(color).lightness(95).hex();
1717
$: borderColor = selected ? Color(color).lightness(50).hex() : Color(color).lightness(85).hex();

src/components/chip/GroupChip.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
55
export let globals: PortfolioGlobals;
66
export let groupId: string;
7-
export let link: boolean = false;
8-
export let selected: boolean = false;
7+
export let link = false;
8+
export let selected = false;
99
1010
$: group = globals.groups[groupId];
1111
</script>

0 commit comments

Comments
 (0)