Skip to content

Commit ba1ce25

Browse files
committed
fix: lint and type fixes.
1 parent 7f7fe2d commit ba1ce25

File tree

9 files changed

+136
-51
lines changed

9 files changed

+136
-51
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: CI
55
on:
66
push:
77
branches:
8-
- '**'
8+
- "**"
99

1010
jobs:
1111
build:
@@ -18,3 +18,4 @@ jobs:
1818
- run: bun install --frozen-lockfile
1919
- run: bun run build
2020
- run: bun run check
21+
- run: bun run lint

apps/site/components/demos/base-demo.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { Tabs } from "@kobalte/core/tabs"
33
import { clsx } from "clsx"
44
import {
5+
type Component,
56
type ComponentProps,
67
children,
78
createSignal,
@@ -12,7 +13,6 @@ import {
1213
onMount,
1314
Show,
1415
splitProps,
15-
type Component,
1616
} from "solid-js"
1717
import { MDXContent } from "@/components/mdx-content"
1818
import { cn } from "@/utils/cn"
@@ -169,7 +169,14 @@ function Demo(props: FlowProps<Props>) {
169169
</Tabs.Content>
170170
</Show>
171171
<Show when={_props.code}>
172-
<Tabs.Content value="code" class={clsx("min-h-25 relative overflow-hidden text-sm", active() !== "code" && "hidden")} forceMount>
172+
<Tabs.Content
173+
value="code"
174+
class={clsx(
175+
"relative min-h-25 overflow-hidden text-sm",
176+
active() !== "code" && "hidden"
177+
)}
178+
forceMount
179+
>
173180
<MDXContent code={_props.code!} />
174181
</Tabs.Content>
175182
</Show>
@@ -368,7 +375,10 @@ export function Collapsible(props: CollapsibleProps) {
368375
return (
369376
<div
370377
style={{ height: heightStyle() }}
371-
class={cn("overflow-hidden transition-[width,height] duration-350 ease-in-out", local.containerClass)}
378+
class={cn(
379+
"overflow-hidden transition-[width,height] duration-350 ease-in-out",
380+
local.containerClass
381+
)}
372382
aria-hidden={!local.open}
373383
{...others}
374384
>

apps/site/components/markdown.context.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ import { IconCopy } from "../icons/copy"
55

66
export function createPre(options: {
77
copyButtonClass?: string
8-
copyButtonPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
8+
copyButtonPosition?: "top-left" | "top-right" | "bottom-left" | "bottom-right"
99
}) {
1010
return (props: { children?: any; class?: string; className?: string }) => (
11-
<Pre {...props} copyButtonClass={options.copyButtonClass} copyButtonPosition={options.copyButtonPosition} />
11+
<Pre
12+
{...props}
13+
copyButtonClass={options.copyButtonClass}
14+
copyButtonPosition={options.copyButtonPosition}
15+
/>
1216
)
1317
}
1418

@@ -17,7 +21,7 @@ const Pre = (props: {
1721
class?: string
1822
className?: string
1923
copyButtonClass?: string
20-
copyButtonPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
24+
copyButtonPosition?: "top-left" | "top-right" | "bottom-left" | "bottom-right"
2125
}) => {
2226
const [ref, setRef] = createSignal<HTMLPreElement>()
2327
const [copied, setCopied] = createSignal(false)
@@ -32,20 +36,20 @@ const Pre = (props: {
3236
}
3337

3438
const positionClasses = {
35-
'top-left': 'top-2 left-2',
36-
'top-right': 'top-2 right-2',
37-
'bottom-left': 'bottom-2 left-2',
38-
'bottom-right': 'bottom-2 right-2'
39+
"top-left": "top-2 left-2",
40+
"top-right": "top-2 right-2",
41+
"bottom-left": "bottom-2 left-2",
42+
"bottom-right": "bottom-2 right-2",
3943
}
4044

4145
return (
42-
<div class="group relative w-full h-full flex items-center p-3">
46+
<div class="group relative flex h-full w-full items-center p-3">
4347
<pre ref={setRef} {...props} class={props.class || props.className}>
4448
{props.children}
4549
</pre>
4650

4751
<button
48-
class={`absolute rounded bg-neutral-800/50 p-1.5 text-neutral-300 opacity-0 transition-opacity hover:bg-neutral-700/50 hover:text-white group-hover:opacity-100 ${positionClasses[props.copyButtonPosition || 'bottom-right']} ${props.copyButtonClass || ''}`}
52+
class={`absolute rounded bg-neutral-800/50 p-1.5 text-neutral-300 opacity-0 transition-opacity hover:bg-neutral-700/50 hover:text-white group-hover:opacity-100 ${positionClasses[props.copyButtonPosition || "bottom-right"]} ${props.copyButtonClass || ""}`}
4953
onClick={onCopy}
5054
aria-label="Copy code"
5155
>
@@ -57,8 +61,6 @@ const Pre = (props: {
5761
)
5862
}
5963

60-
61-
6264
const mdComponents = {
6365
pre: Pre,
6466
}

apps/site/pages/+Page.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { Format } from "number-flow"
22
import NumberFlow from "solid-number-flow"
33
import ContinuousDemo from "@/components/demos/continuous"
44
import GroupDemo from "@/components/demos/group"
5+
import theme from "@/highlighter-theme.json"
56
import pkgJSON from "../../../packages/solid-number-flow/package.json"
67
import IsolateDemo from "../components/demos/isolate"
78
import StylingDemo from "../components/demos/styling"
@@ -14,8 +15,6 @@ import { IconGithub } from "../icons/github"
1415
import { IconShuffle } from "../icons/shuffle"
1516
import { IconSolidJS } from "../icons/solidjs"
1617

17-
import theme from "@/highlighter-theme.json"
18-
1918
const NUMBERS = [321, -3243.6, 42, 398.43, -3243.5, 1435237.2, 12348.43, -3243.6, 54323.2]
2019
const LOCALES = ["fr-FR", "en-US", "fr-FR", "en-US", "en-US", "zh-CN", "en-US", "en-US", "fr-FR"]
2120
const FORMATS = [
@@ -134,9 +133,8 @@ export default function HomePage() {
134133
</p>
135134
</div>
136135

137-
138-
<div class="mx-auto w-full max-w-xl px-5 mb-5">
139-
<div class="rounded-lg border border-zinc-800 bg-zinc-900 h-12 flex items-center">
136+
<div class="mx-auto mb-5 w-full max-w-xl px-5">
137+
<div class="flex h-12 items-center rounded-lg border border-zinc-800 bg-zinc-900">
140138
<MDXContent code={NpmInstall} />
141139
</div>
142140
</div>

apps/site/solidjsx-types.d.ts

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/* eslint-disable import/no-unresolved */
2+
/**
3+
* An MDX file which exports a JSX component.
4+
*/
5+
declare module "*.mdx" {
6+
import type { JSX, ParentProps } from "solid-js"
7+
8+
type MDXComponents = {
9+
[key in string]: key extends keyof JSX.IntrinsicElements
10+
? ((properties: JSX.IntrinsicElements[key]) => JSX.Element) | keyof JSX.IntrinsicElements
11+
: (properties: ParentProps) => JSX.Element
12+
}
13+
14+
type CustomComponents = Record<string, (properties: ParentProps) => JSX.Element>
15+
16+
interface MDXProperties {
17+
components?: Partial<MDXComponents>
18+
children?: JSX.Element
19+
[key: string]: unknown
20+
}
21+
22+
/**
23+
* An function component which renders the MDX content using JSX.
24+
*
25+
* @param props This value is be available as the named variable `props` inside the MDX component.
26+
* @returns A JSX element. The meaning of this may depend on the project configuration. I.e. it
27+
* could be a React, Preact, or Vuex element.
28+
*/
29+
export default function Component(properties: MDXProperties): JSX.Element
30+
}
31+
32+
/**
33+
* A markdown file which exports a JSX component.
34+
*/
35+
declare module "*.md" {
36+
export { default } from "*.mdx"
37+
}
38+
39+
/**
40+
* A markdown file which exports a JSX component.
41+
*/
42+
declare module "*.markdown" {
43+
export { default } from "*.mdx"
44+
}
45+
46+
/**
47+
* A markdown file which exports a JSX component.
48+
*/
49+
declare module "*.mdown" {
50+
export { default } from "*.mdx"
51+
}
52+
53+
/**
54+
* A markdown file which exports a JSX component.
55+
*/
56+
declare module "*.mkdn" {
57+
export { default } from "*.mdx"
58+
}
59+
60+
/**
61+
* A markdown file which exports a JSX component.
62+
*/
63+
declare module "*.mkd" {
64+
export { default } from "*.mdx"
65+
}
66+
67+
/**
68+
* A markdown file which exports a JSX component.
69+
*/
70+
declare module "*.mdwn" {
71+
export { default } from "*.mdx"
72+
}
73+
74+
/**
75+
* A markdown file which exports a JSX component.
76+
*/
77+
declare module "*.mkdown" {
78+
export { default } from "*.mdx"
79+
}
80+
81+
/**
82+
* A markdown file which exports a JSX component.
83+
*/
84+
declare module "*.ron" {
85+
export { default } from "*.mdx"
86+
}

apps/site/tsconfig.json

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
{
22
"compilerOptions": {
33
"strict": true,
4-
"target": "ESNext",
5-
"module": "ESNext",
6-
"lib": ["DOM", "DOM.Iterable", "ESNext"],
7-
"moduleResolution": "bundler",
8-
"resolveJsonModule": true,
4+
"allowJs": true,
5+
"checkJs": true,
96
"esModuleInterop": true,
10-
"noEmit": true,
11-
"isolatedModules": true,
12-
"skipLibCheck": true,
13-
"allowSyntheticDefaultImports": true,
147
"forceConsistentCasingInFileNames": true,
15-
"noUncheckedIndexedAccess": true,
16-
"jsx": "preserve",
17-
"jsxImportSource": "solid-js",
18-
"types": ["vite/client"],
19-
"baseUrl": ".",
8+
"resolveJsonModule": true,
9+
"skipLibCheck": true,
10+
"sourceMap": true,
11+
"module": "ESNext",
12+
"noEmit": true,
13+
"moduleResolution": "Bundler",
14+
"target": "ES2022",
15+
"lib": ["DOM", "DOM.Iterable", "ESNext"],
2016
"paths": {
2117
"@/*": ["./*"]
22-
}
18+
},
19+
"types": ["vite/client", "vike-solid/client"],
20+
"jsx": "preserve",
21+
"jsxImportSource": "solid-js"
2322
},
24-
"exclude": ["node_modules", "dist", "./dev", "_context"]
23+
"exclude": ["dist"]
2524
}

apps/site/vite-env.d.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1 @@
11
/// <reference types="vite/client" />
2-
3-
declare module "*.mdx" {
4-
import type { Component } from "solid-js"
5-
const Component: Component
6-
export default Component
7-
}
8-
9-
declare module "*.md" {
10-
import type { Component } from "solid-js"
11-
const Component: Component
12-
export default Component
13-
}

apps/site/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import mdx from "@mdx-js/rollup"
2+
import rehypeShiki from "@shikijs/rehype"
13
import tailwindcss from "@tailwindcss/vite"
24
import vike from "vike/plugin"
35
// Vike
46
import vikeSolid from "vike-solid/vite"
57
import { defineConfig } from "vite"
68
import tsConfigPaths from "vite-tsconfig-paths"
7-
import mdx from "@mdx-js/rollup"
8-
import rehypeShiki from "@shikijs/rehype"
99
import theme from "./highlighter-theme.json"
1010

1111
export default defineConfig({

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"lint": "bun run --filter '*' lint",
1515
"lint:fix": "bun run --filter '*' lint:fix",
1616
"check": "bun run --filter '*' check",
17-
"publish-ci": "bun run lint && bun run build && changeset publish"
17+
"publish-ci": "bun run lint && bun run build && changeset publish",
18+
"clean": "rm -rf node_modules && rm -rf apps/*/node_modules && rm -rf packages/*/node_modules"
1819
},
1920
"workspaces": {
2021
"packages": [

0 commit comments

Comments
 (0)