- 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
24 lines
766 B
TypeScript
24 lines
766 B
TypeScript
import type { StorybookConfig } from '@storybook/react-vite';
|
|
|
|
import { dirname } from 'path';
|
|
|
|
import { fileURLToPath } from 'url';
|
|
|
|
/**
|
|
* This function is used to resolve the absolute path of a package.
|
|
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
|
|
*/
|
|
function getAbsolutePath(value: string) {
|
|
return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)));
|
|
}
|
|
const config: StorybookConfig = {
|
|
stories: ['./stories/**/*.mdx', './stories/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
|
addons: [
|
|
getAbsolutePath('@storybook/addon-vitest'),
|
|
getAbsolutePath('@storybook/addon-a11y'),
|
|
getAbsolutePath('@storybook/addon-docs'),
|
|
],
|
|
framework: getAbsolutePath('@storybook/react-vite'),
|
|
};
|
|
export default config;
|