Skip to content

Commit

Permalink
🎨 Use verbatimModuleSyntax
Browse files Browse the repository at this point in the history
  • Loading branch information
BeiyanYunyi committed Jun 26, 2023
1 parent b9ab590 commit 44876b3
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 23 deletions.
11 changes: 10 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import { Component, createEffect, createMemo, For, Index, Match, Show, Switch } from 'solid-js';
import {
For,
Index,
Match,
Show,
Switch,
createEffect,
createMemo,
type Component,
} from 'solid-js';
import { Portal } from 'solid-js/web';
import { version } from '../package.json';
import CommentBox from './components/CommentBox';
Expand Down
2 changes: 1 addition & 1 deletion src/ComponentEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type { Component } from 'solid-js';
import App from './App';
import configProvider from './controllers/configProvider';
import SodesuInitOptions from './types/SodesuInitOptions';
import type SodesuInitOptions from './types/SodesuInitOptions';

const ComponentEntry: Component<Omit<SodesuInitOptions, 'el'>> = (prop) => {
const { path = window.location.pathname } = prop;
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommentBox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, createMemo, Show } from 'solid-js';
import { Show, createMemo, type Component } from 'solid-js';
import commentBoxState, { submitComment } from '../controllers/commentBoxState';
import configProvider from '../controllers/configProvider';
import userInfoState, { openProfile } from '../controllers/userInfoState';
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommentBoxFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Show } from 'solid-js';
import { Show, type Component } from 'solid-js';
import commentBoxState, { submitComment } from '../controllers/commentBoxState';
import configProvider from '../controllers/configProvider';
import userInfoState, { userLogin, userLogout } from '../controllers/userInfoState';
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommentCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createDateNow } from '@solid-primitives/date';
import { Component, createMemo, Index, Show } from 'solid-js';
import { Index, Show, createMemo, type Component } from 'solid-js';
import commentBoxState from '../controllers/commentBoxState';
import type { ReactiveComment } from '../controllers/commentListState';
import configProvider from '../controllers/configProvider';
Expand Down
4 changes: 2 additions & 2 deletions src/components/CommentCardActions.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { deleteComment } from '@waline/client/dist/api';
import { Component, createMemo, Show } from 'solid-js';
import { type Component, createMemo, Show } from 'solid-js';
import commentBoxState, { clearReplyState } from '../controllers/commentBoxState';
import {
deleteComment as deleteCommentFront,
ReactiveComment,
type ReactiveComment,
} from '../controllers/commentListState';
import configProvider from '../controllers/configProvider';
import likeState, { handleLike } from '../controllers/likeState';
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommentMeta.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Show } from 'solid-js';
import { Show, type Component } from 'solid-js';

const CommentMeta: Component<{ addr?: string; browser?: string; os?: string }> = (props) => (
<div aria-hidden>
Expand Down
2 changes: 1 addition & 1 deletion src/components/UserMeta.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, createMemo, For } from 'solid-js';
import { For, createMemo, type Component } from 'solid-js';
import { userMetaState } from '../controllers/commentBoxState';
import configProvider from '../controllers/configProvider';

Expand Down
4 changes: 2 additions & 2 deletions src/controllers/commentBoxState.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { WalineCommentData } from '@waline/client';
import { type WalineCommentData } from '@waline/client';
import { addComment, updateComment } from '@waline/client/dist/api';
import { createEffect, createMemo, createRoot, createSignal } from 'solid-js';
import { getWordNumber } from '../waline/utils/wordCount';
import commentListState, { makeDataReactive, ReactiveComment } from './commentListState';
import commentListState, { makeDataReactive, type ReactiveComment } from './commentListState';
import configProvider from './configProvider';
import userInfoState from './userInfoState';

Expand Down
2 changes: 1 addition & 1 deletion src/controllers/commentListState.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { WalineComment, WalineCommentSorting, WalineCommentStatus } from '@waline/client';
import { getComment } from '@waline/client/dist/api';
import { Accessor, createRoot, createSignal, Setter } from 'solid-js';
import { createRoot, createSignal, type Accessor, type Setter } from 'solid-js';
import configProvider from './configProvider';
// eslint-disable-next-line import/no-cycle
import userInfoState from './userInfoState';
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/configProvider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createEffect, createMemo, createRoot, createSignal, onMount } from 'solid-js';
import SodesuInitOptions, { SodesuConfig, SodesuProps } from '../types/SodesuInitOptions';
import type SodesuInitOptions from '../types/SodesuInitOptions';
import type { SodesuConfig, SodesuProps } from '../types/SodesuInitOptions';
import { commentCount } from '../waline/comment';
import { pageviewCount } from '../waline/pageview';
import { getConfig } from '../waline/utils/config';
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/likeState.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createStorageSignal } from '@solid-primitives/storage';
import { updateComment } from '@waline/client/dist/api';
import { createRoot } from 'solid-js';
import { ReactiveComment } from './commentListState';
import { type ReactiveComment } from './commentListState';
import configProvider from './configProvider';
import userInfoState from './userInfoState';

Expand Down
2 changes: 1 addition & 1 deletion src/controllers/userInfoState.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createStorageSignal } from '@solid-primitives/storage';
import { login, UserInfo } from '@waline/client/dist/api';
import { login, type UserInfo } from '@waline/client/dist/api';
import { createMemo, createRoot, onCleanup, onMount } from 'solid-js';
// eslint-disable-next-line import/no-cycle
import { refresh } from './commentListState';
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render } from 'solid-js/web';
import App from './App';
import configProvider from './controllers/configProvider';
import SodesuInitOptions from './types/SodesuInitOptions';
import type SodesuInitOptions from './types/SodesuInitOptions';

const Sodesu = {
init: (opt: SodesuInitOptions) => {
Expand Down
8 changes: 2 additions & 6 deletions src/waline/utils/date.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WalineDateLocale } from '../typings';
import type { WalineDateLocale } from '../typings';

const padWithZeros = (vNumber: number, width: number): string => {
let numAsString = vNumber.toString();
Expand All @@ -18,11 +18,7 @@ export const dateFormat = (date: Date): string => {
return `${vYear}-${vMonth}-${vDay}`;
};

export const getTimeAgo = (
date: Date | string,
now: Date,
locale: WalineDateLocale
): string => {
export const getTimeAgo = (date: Date | string, now: Date, locale: WalineDateLocale): string => {
if (!date) return '';

const time =
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"types": ["vite/client"],
"isolatedModules": true,
"skipLibCheck": true,
"resolveJsonModule": true
"resolveJsonModule": true,
"verbatimModuleSyntax": true
},
"exclude": ["dist"]
}

0 comments on commit 44876b3

Please sign in to comment.