feat(client): add Timestamp component, ESLint 10 + Prettier, and code quality fixes

- add Timestamp component with moment relative time and ISO tooltip
- add Timestamp stories (JustNow, MinutesAgo, HoursAgo, DaysAgo, MonthsAgo)
- add ESLint 10 with typescript-eslint, react-hooks, react-refresh, prettier
- add Prettier config with singleQuote, semi, trailingComma all, printWidth 100
- add lint, lint:fix, format, test:storybook scripts to package.json
- fix react-hooks/set-state-in-effect in all page components
- auto-fix 113 Prettier formatting issues across src and .storybook
This commit is contained in:
2026-04-09 10:25:15 +03:00
parent 50b942801f
commit 32beec2229
29 changed files with 1175 additions and 280 deletions
+9 -9
View File
@@ -1,6 +1,6 @@
import React from 'react'
import type { Preview } from '@storybook/react-vite'
import '../src/ui/tokens.css'
import React from 'react';
import type { Preview } from '@storybook/react-vite';
import '../src/ui/tokens.css';
const preview: Preview = {
globalTypes: {
@@ -12,7 +12,7 @@ const preview: Preview = {
icon: 'circlehollow',
items: [
{ value: 'light', icon: 'sun', title: 'Light' },
{ value: 'dark', icon: 'moon', title: 'Dark' },
{ value: 'dark', icon: 'moon', title: 'Dark' },
],
dynamicTitle: true,
},
@@ -20,13 +20,13 @@ const preview: Preview = {
},
decorators: [
(Story, context) => {
const theme = (context.globals['theme'] as string) ?? 'light'
document.documentElement.setAttribute('data-theme', theme)
const theme = (context.globals['theme'] as string) ?? 'light';
document.documentElement.setAttribute('data-theme', theme);
return (
<div style={{ background: 'var(--color-bg)', minHeight: '100vh', padding: 0 }}>
<Story />
</div>
)
);
},
],
parameters: {
@@ -40,6 +40,6 @@ const preview: Preview = {
test: 'todo',
},
},
}
};
export default preview
export default preview;