Skip to content

Commit

Permalink
chore: resolve lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtechsimetka committed Dec 29, 2023
1 parent fb2b60e commit b49d54c
Show file tree
Hide file tree
Showing 50 changed files with 103 additions and 93 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
node_modules
/build
/dist
/.svelte-kit
/package
.env
Expand Down
28 changes: 18 additions & 10 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
/** @type { import("eslint").Linter.Config } */
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['svelte3', '@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
settings: {
'svelte3/typescript': () => require('typescript'),
},
plugins: ['@typescript-eslint'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte'],
},
env: {
browser: true,
es2017: true,
node: true,
},
globals: {
svelte: true,
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
},
],
}
7 changes: 4 additions & 3 deletions src/lib/components/data-display/badge.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
import type { HTMLAttributes } from 'svelte/elements'
type Variant = 'primary' | 'secondary' | 'overlay'
let className: string | undefined | null = undefined
export { className as class }
export let variant: Variant = 'primary'
interface Props extends HTMLAttributes<HTMLSpanElement> {
variant?: Variant
class?: string | null
}
type $$Props = Props
export let variant: $$Props['variant'] = 'primary'
let className: $$Props['class'] = undefined
export { className as class }
</script>

<span class={`badge ${variant} small-sans ${className}`} {...$$restProps}>
Expand Down
10 changes: 5 additions & 5 deletions src/lib/components/data-display/typography.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
| 'serif-italic'
type Element = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span'
let className: string | undefined | null = undefined
export { className as class }
export let variant: Variant = 'serif'
export let element: Element = 'span'
type Props = {
class?: string | null
variant?: Variant
element?: Element
}
type $$Props = (HTMLAttributes<HTMLHeadingElement> | HTMLAttributes<HTMLSpanElement>) & Props
let className: $$Props['class'] = undefined
export { className as class }
export let variant: $$Props['variant'] = 'serif'
export let element: $$Props['element'] = 'span'
</script>

<svelte:element this={element} class={`${variant} ${className}`} {...$$restProps}>
Expand Down
48 changes: 24 additions & 24 deletions src/lib/components/inputs/button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,31 @@
type Variant = 'primary' | 'secondary' | 'overlay'
let className: string | undefined | null = undefined
type Props = {
class?: string | null
variant?: Variant
active?: boolean
}
interface AnchorElement extends Props, HTMLAnchorAttributes {
href?: HTMLAnchorAttributes['href']
type?: never
}
interface ButtonElement extends Props, HTMLButtonAttributes {
type?: HTMLButtonAttributes['type']
href?: never
}
type $$Props = AnchorElement | ButtonElement
let className: $$Props['class'] = undefined
export { className as class }
export let href: HTMLAnchorAttributes['href'] = undefined
export let type: HTMLButtonAttributes['type'] = undefined
export let role: HTMLButtonAttributes['role'] = undefined
export let variant: Variant = 'secondary'
export let active: boolean = false
export let href: $$Props['href'] = undefined
export let type: $$Props['type'] = undefined
export let role: $$Props['role'] = undefined
export let variant: $$Props['variant'] = 'secondary'
export let active: $$Props['active'] = false
let buttonElement: HTMLButtonElement | HTMLAnchorElement
let singleSVG = false
Expand All @@ -33,24 +51,6 @@
singleSVG = true
}
})
type Props = {
class?: string | null
variant?: Variant
active?: boolean
}
interface AnchorElement extends Props, HTMLAnchorAttributes {
href?: HTMLAnchorAttributes['href']
type?: never
}
interface ButtonElement extends Props, HTMLButtonAttributes {
type?: HTMLButtonAttributes['type']
href?: never
}
type $$Props = AnchorElement | ButtonElement
</script>

<svelte:element
Expand Down
14 changes: 7 additions & 7 deletions src/lib/components/inputs/input-text.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<script lang="ts">
import type { HTMLInputAttributes } from 'svelte/elements'
export let value = ''
export let placeholder: string | undefined | null = undefined
export let autofocus: boolean | undefined | null = false
export let disabled: boolean | undefined | null = false
export let label: string | undefined | null = undefined
export let unit: string | undefined | null = undefined
interface Props extends HTMLInputAttributes {
disabled?: boolean | null
label?: string | null
Expand All @@ -16,6 +9,13 @@
}
type $$Props = Props
export let value = ''
export let placeholder: $$Props['placeholder'] = undefined
export let autofocus: $$Props['autofocus'] = false
export let disabled: $$Props['disabled'] = false
export let label: $$Props['label'] = undefined
export let unit: $$Props['unit'] = undefined
</script>

<label class:disabled>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/add-comment.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/add.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/arrow-down-right.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/arrow-right.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/arrow-up-right.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/arrow-up.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/arrows-vertical.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/asleep.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/bullhorn.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/camera.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/caret-down.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/chat-bot.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/chat-launch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/checkmark-filled.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/checkmark.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/chevron-down.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/chevron-left.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/chevron-right.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/chevron-up.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/close.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/copy-link.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/copy.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/data-view-alt.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type $$Props = IconProps
export let size = 20
export let size: $$Props['size'] = 20
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width={size} height={size}>
Expand Down
Loading

0 comments on commit b49d54c

Please sign in to comment.