Skip to content

Commit

Permalink
Fix lint and storybook code
Browse files Browse the repository at this point in the history
  • Loading branch information
victortrinh2 committed Nov 12, 2024
1 parent 8e29945 commit 9154c59
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 132 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isNil } from "@components/shared/index.ts";
import prettier from "prettier/standalone";
import prettierBabel from "prettier/parser-babel";
import prettierPostCss from "prettier/parser-postcss";
import * as prettier from "prettier-local/standalone";
import babel from "prettier-local/parser-babel";
import postcss from "prettier-local/parser-postcss";

const PrettierParser = {
"javascript": "babel",
Expand All @@ -16,7 +16,7 @@ export function formatCode(code: string, language: string) {
if (!isNil(parser)) {
return prettier.format(code, {
parser: parser,
plugins: [prettierBabel, prettierPostCss],
plugins: [babel, postcss],
tabWidth: 4,
arrowParens: "avoid",
printWidth: 100,
Expand Down
2 changes: 1 addition & 1 deletion .storybook/components/snippet/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "./useFormattedCode.ts";
export * from "./formatCode.ts";
2 changes: 1 addition & 1 deletion .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { viewport } from "./storybook-addon/index.ts";
import { withBackgroundMatchingColorScheme, withCenteredCanvas, ThemedDocsContainer, withThemeProvider } from "./decorators/index.ts";
import { isChromatic } from "./env.ts";
import { Themes } from "./styles/themes.ts";
import { formatCode } from "./components/snippet/useFormattedCode.ts";
import { formatCode } from "./components/snippet/index.ts";
import type { Preview } from "@storybook/react";
import "./styles/index.ts";

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"jest-environment-jsdom": "29.7.0",
"meow": "9.0.0",
"netlify-cli": "17.37.2",
"prettier": "2.5.1",
"prettier-local": "npm:prettier@2.5.1",
"prism-react-renderer": "1.2.1",
"react": "18.3.1",
"react-dom": "18.3.1",
Expand All @@ -109,8 +109,8 @@
"storybook": "8.4.2",
"stylelint": "^16.10.0",
"svgo": "3.3.2",
"ts-node": "10.9.2",
"ts-jest": "29.2.5",
"ts-node": "10.9.2",
"tsconfig-paths-webpack-plugin": "4.1.0",
"tsup": "8.3.5",
"typescript": "5.4.5"
Expand Down
Loading

0 comments on commit 9154c59

Please sign in to comment.