From 3a75a371bd6fd7d898137a85982aa213d7581bc1 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 12 Jul 2024 11:02:48 -0400 Subject: [PATCH] attempt to "commonize" prettier config (#2424) * attempt to "commonize" prettier config * Update .prettierrc.json * Update .prettierrc.json * Update .prettierrc.json * Update .prettierrc.json * Update .prettierrc.json * md * yaml config * tweak --- .prettierrc.json | 15 --------------- .prettierrc.yaml | 14 ++++++++++++++ packages/api-react/README.md | 18 +++++++++--------- 3 files changed, 23 insertions(+), 24 deletions(-) delete mode 100755 .prettierrc.json create mode 100644 .prettierrc.yaml diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100755 index 77ade18563..0000000000 --- a/.prettierrc.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "printWidth": 120, - "singleQuote": true, - "overrides": [ - { - "files": ["*.yaml", "*.yml", "*.toml", "*.json", "*.ini"], - "options": { - "tabWidth": 2, - "singleQuote": false, - "experimentalTernaries": true, - "useTabs": false - } - } - ] -} diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 0000000000..27a0fcfbbf --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,14 @@ +overrides: + - files: ["*.yaml", "*.yml", "*.toml", "*.json", "*.ini"] + options: + tabWidth: 2 + singleQuote: false + experimentalTernaries: true + useTabs: false + - files: ["*.md"] + options: + singleQuote: false + - files: ["*.js", "*.jsx", "*.ts", "*.tsx", "*.cjs", "*.mjs"] + options: + printWidth: 120 + singleQuote: true diff --git a/packages/api-react/README.md b/packages/api-react/README.md index fa7587c322..46205327d5 100644 --- a/packages/api-react/README.md +++ b/packages/api-react/README.md @@ -20,10 +20,10 @@ It is designed to simplify common cases for loading data in a web application, e ### **`PublicKeys.tsx`** ```tsx -import React from 'react'; -import { useGetPublicKeysQuery } from '@chia-network/api-react'; -import { Loading } from '@chia-network/core'; -import Suspender from 'react-suspender'; +import React from "react"; +import { useGetPublicKeysQuery } from "@chia-network/api-react"; +import { Loading } from "@chia-network/core"; +import Suspender from "react-suspender"; export default function PublicKeys() { const { data: publicKeys, isLoading, error } = useGetPublicKeysQuery(); @@ -49,14 +49,14 @@ export default function PublicKeys() { ### **`Application.tsx`** ```tsx -import React, { Suspense } from 'react'; -import Websocket from 'ws'; // or read this value from electron main application -import { store, api } from '@chia-network/api-react'; -import PublicKeys from './PublicKeys'; +import React, { Suspense } from "react"; +import Websocket from "ws"; // or read this value from electron main application +import { store, api } from "@chia-network/api-react"; +import PublicKeys from "./PublicKeys"; // prepare api api.initializeConfig({ - url: 'wss://127.0.0.1:54000', + url: "wss://127.0.0.1:54000", cert: fs.readFileSync(certPath).toString(), // or read this value from electron main application key: fs.readFileSync(keyPath).toString(), // or read this value from electron main application webSocket: Websocket,