Skip to content

Commit

Permalink
Run linter, ignore artifact-metas
Browse files Browse the repository at this point in the history
  • Loading branch information
kjy5 committed Mar 12, 2024
1 parent cb56ac1 commit d35d388
Show file tree
Hide file tree
Showing 15 changed files with 284 additions and 769 deletions.
72 changes: 36 additions & 36 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import type { StorybookConfig } from "@storybook/react-vite";

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-onboarding",
"@storybook/addon-interactions",
"@storybook/addon-styling",
"@storybook/addon-themes",
],
staticDirs: ["../public"],
framework: {
name: "@storybook/react-vite",
options: {},
},
typescript: {
reactDocgen: "react-docgen-typescript",
reactDocgenTypescriptOptions: {
// Speeds up Storybook build time
compilerOptions: {
allowSyntheticDefaultImports: false,
esModuleInterop: false,
},
// Makes union prop types like variant and size appear as select controls
shouldExtractLiteralValuesFromEnum: true,
// Makes string and boolean types that can be undefined appear as inputs and switches
shouldRemoveUndefinedFromOptional: true,
// Filter out third-party props from node_modules except @mui packages
propFilter: (prop) =>
prop.parent
? !/node_modules\/(?!@mui)/.test(prop.parent.fileName)
: true,
},
},
docs: {
autodocs: "tag",
},
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-onboarding",
"@storybook/addon-interactions",
"@storybook/addon-styling",
"@storybook/addon-themes",
],
staticDirs: ["../public"],
framework: {
name: "@storybook/react-vite",
options: {},
},
typescript: {
reactDocgen: "react-docgen-typescript",
reactDocgenTypescriptOptions: {
// Speeds up Storybook build time
compilerOptions: {
allowSyntheticDefaultImports: false,
esModuleInterop: false,
},
// Makes union prop types like variant and size appear as select controls
shouldExtractLiteralValuesFromEnum: true,
// Makes string and boolean types that can be undefined appear as inputs and switches
shouldRemoveUndefinedFromOptional: true,
// Filter out third-party props from node_modules except @mui packages
propFilter: (prop) =>
prop.parent
? !/node_modules\/(?!@mui)/.test(prop.parent.fileName)
: true,
},
},
docs: {
autodocs: "tag",
},
};
export default config;
52 changes: 26 additions & 26 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,38 @@ import { withThemeFromJSXProvider } from "@storybook/addon-themes";
import { darkTheme, lightTheme } from "../src/themes";

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

const decorators = [
withThemeFromJSXProvider({
themes: {
light: lightTheme,
dark: darkTheme,
},
defaultTheme: "dark",
Provider: ThemeProvider,
GlobalStyles: CssBaseline,
}),
withThemeFromJSXProvider({
themes: {
light: lightTheme,
dark: darkTheme,
},
defaultTheme: "dark",
Provider: ThemeProvider,
GlobalStyles: CssBaseline,
}),
];

const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
expanded: true, // Adds the description and default columns
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
expanded: true, // Adds the description and default columns
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
};

export { decorators, parameters };
Expand Down
30 changes: 15 additions & 15 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"linter": {
"rules": {
"recommended": true
}
},
"formatter": {
"indentStyle": "space",
"ignore": ["src/models/artifact-metas.json"]
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
}
80 changes: 40 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
{
"name": "honors-portfolio",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "biome lint .",
"format": "biome format --write .",
"check": "biome check --apply .",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.15.12",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@biomejs/biome": "^1.6.0",
"@fontsource/roboto": "^5.0.12",
"@mui/icons-material": "^5.15.12",
"@storybook/addon-essentials": "^7.6.17",
"@storybook/addon-interactions": "^7.6.17",
"@storybook/addon-links": "^7.6.17",
"@storybook/addon-onboarding": "^1.0.11",
"@storybook/addon-themes": "^7.6.17",
"@storybook/blocks": "^7.6.17",
"@storybook/react": "^7.6.17",
"@storybook/react-vite": "^7.6.17",
"@storybook/test": "^7.6.17",
"@types/react": "^18.2.64",
"@types/react-dom": "^18.2.21",
"@vitejs/plugin-react-swc": "^3.6.0",
"storybook": "^7.6.17",
"typescript": "^5.4.2",
"vite": "^5.1.5"
}
"name": "honors-portfolio",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "biome lint .",
"format": "biome format --write .",
"check": "biome check --apply .",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.15.12",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@biomejs/biome": "^1.6.0",
"@fontsource/roboto": "^5.0.12",
"@mui/icons-material": "^5.15.12",
"@storybook/addon-essentials": "^7.6.17",
"@storybook/addon-interactions": "^7.6.17",
"@storybook/addon-links": "^7.6.17",
"@storybook/addon-onboarding": "^1.0.11",
"@storybook/addon-themes": "^7.6.17",
"@storybook/blocks": "^7.6.17",
"@storybook/react": "^7.6.17",
"@storybook/react-vite": "^7.6.17",
"@storybook/test": "^7.6.17",
"@types/react": "^18.2.64",
"@types/react-dom": "^18.2.21",
"@vitejs/plugin-react-swc": "^3.6.0",
"storybook": "^7.6.17",
"typescript": "^5.4.2",
"vite": "^5.1.5"
}
}
34 changes: 17 additions & 17 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ import { Box, Container, Stack, Typography } from "@mui/material";
* @constructor
*/
function App() {
return (
<Box sx={{ m: 2 }}>
<Container>
<Stack spacing={1}>
<Typography variant={"h1"}>👋 Hello!</Typography>
<Typography variant={"h2"}>
Welcome and thanks for visiting my honors portfolio website!
</Typography>
<Typography variant={"body1"}>
The website is currently being updated. Feel free to scroll around
and see the current progress, or come back later when it&apos;s all
done!
</Typography>
</Stack>
</Container>
</Box>
);
return (
<Box sx={{ m: 2 }}>
<Container>
<Stack spacing={1}>
<Typography variant={"h1"}>👋 Hello!</Typography>
<Typography variant={"h2"}>
Welcome and thanks for visiting my honors portfolio website!
</Typography>
<Typography variant={"body1"}>
The website is currently being updated. Feel free to scroll around
and see the current progress, or come back later when it&apos;s all
done!
</Typography>
</Stack>
</Container>
</Box>
);
}

export default App;
16 changes: 8 additions & 8 deletions src/components/link-card.stories.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react";
import artifactMetas from "../utils/artifact-metas.ts";
import LinkCard from "./link-card.tsx";

const meta: Meta<typeof LinkCard> = {
component: LinkCard,
component: LinkCard,
};
export default meta;

type Story = StoryObj<typeof LinkCard>;

export const Default: Story = {
args: {
linkMeta: artifactMetas[7].links[0],
},
args: {
linkMeta: artifactMetas[7].links[0],
},
};

export const NoImage: Story = {
args: {
linkMeta: artifactMetas[9].links[0],
},
args: {
linkMeta: artifactMetas[9].links[0],
},
};
Loading

0 comments on commit d35d388

Please sign in to comment.