Skip to content

Commit 61ff047

Browse files
committed
Merge branch 'jy/formatting' into 'develop'
Pre-commit formatting See merge request polycentric/polycentric!530
2 parents 6aa1d76 + f6bccb1 commit 61ff047

26 files changed

Lines changed: 429 additions & 121 deletions

File tree

.lintstagedrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"*": "biome check --write --files-ignore-unknown=true",
3+
"{packages,services}/**/*.rs": "rustfmt --edition 2024"
4+
}

.prettierignore

Lines changed: 0 additions & 27 deletions
This file was deleted.

.prettierrc.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ rustup target add wasm32-unknown-unknown
3535
pnpm install
3636
pnpm build
3737

38+
# Setup the git pre-commit hooks
39+
pnpm prepare
40+
3841
# Start the server process
3942
docker compose up -d --build
4043

apps/polycentric/src/common/components/primitives/TextInput.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ import {
1515
} from '@/src/common/theme';
1616
import { BlurView } from 'expo-blur';
1717

18-
export interface TextInputProps extends Omit<
19-
RNTextInputProps,
20-
'placeholderTextColor'
21-
> {
18+
export interface TextInputProps
19+
extends Omit<RNTextInputProps, 'placeholderTextColor'> {
2220
variant?: 'default' | 'plain';
2321
placeholderTextColor?: PaletteColorToken;
2422
disabled?: boolean;

apps/polycentric/src/common/lib/polycentric-hooks/PolycentricProvider.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -173,19 +173,19 @@ export function PolycentricProvider({
173173
// re-refreshes once new events have been pulled in.
174174
useFollows.getState().refresh(c);
175175
useReposts.getState().refresh(c);
176-
(useReactions.getState().refresh(c),
177-
void c
178-
.sync()
179-
.then(() =>
180-
Promise.all([
181-
useFollows.getState().refresh(c),
182-
useReposts.getState().refresh(c),
183-
useReactions.getState().refresh(c),
184-
]),
185-
)
186-
.catch((syncError) => {
187-
console.warn('Initial Polycentric sync failed:', syncError);
188-
}));
176+
useReactions.getState().refresh(c);
177+
void c
178+
.sync()
179+
.then(() =>
180+
Promise.all([
181+
useFollows.getState().refresh(c),
182+
useReposts.getState().refresh(c),
183+
useReactions.getState().refresh(c),
184+
]),
185+
)
186+
.catch((syncError) => {
187+
console.warn('Initial Polycentric sync failed:', syncError);
188+
});
189189
}
190190

191191
setIsLoading(false);

biome.json

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.4.16/schema.json",
3+
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
4+
"files": {
5+
"ignoreUnknown": false,
6+
"includes": [
7+
"**",
8+
"!**/LICENSE",
9+
"!**/public",
10+
"!**/pnpm-lock.yaml",
11+
"!**/justfile",
12+
"!**/README.md",
13+
"!legacy",
14+
"!turbo.jsonc",
15+
"!apps/polycentric/build",
16+
"!apps/polycentric/android",
17+
"!apps/polycentric/ios",
18+
"!packages/react-native/android",
19+
"!packages/react-native/ios",
20+
"!packages/react-native/lib",
21+
"!packages/react-native/src/generated",
22+
"!packages/react-native/src/Native*",
23+
"!packages/react-native/src/uniffi-init.tsx",
24+
"!apps/polycentric/.expo",
25+
"!apps/polycentric/expo-env.d.ts",
26+
"!packages/rs-core",
27+
"!packages/rs-core-wasm-browser",
28+
"!packages/rs-core-wasm-node",
29+
"!packages/js-core/src/proto/polycentric.ts",
30+
"!packages/js-core/src/proto/polycentric/v2",
31+
"!**/rust_modules"
32+
]
33+
},
34+
"formatter": {
35+
"enabled": true,
36+
"formatWithErrors": false,
37+
"indentStyle": "space",
38+
"indentWidth": 2,
39+
"lineEnding": "lf",
40+
"lineWidth": 80,
41+
"attributePosition": "auto",
42+
"bracketSameLine": false,
43+
"bracketSpacing": true,
44+
"expand": "auto",
45+
"useEditorconfig": true
46+
},
47+
"linter": { "enabled": false, "rules": { "recommended": true } },
48+
"javascript": {
49+
"formatter": {
50+
"jsxQuoteStyle": "double",
51+
"quoteProperties": "asNeeded",
52+
"trailingCommas": "all",
53+
"semicolons": "always",
54+
"arrowParentheses": "always",
55+
"bracketSameLine": false,
56+
"quoteStyle": "single",
57+
"attributePosition": "auto",
58+
"bracketSpacing": true
59+
}
60+
},
61+
"html": {
62+
"formatter": {
63+
"indentScriptAndStyle": false,
64+
"selfCloseVoidElements": "always"
65+
}
66+
},
67+
"assist": {
68+
"enabled": true,
69+
"actions": { "source": { "organizeImports": "off" } }
70+
}
71+
}

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"scripts": {
66
"dev": "turbo run dev",
77
"build": "turbo run build",
8-
"format": "prettier --check .",
9-
"format:fix": "prettier --write .",
8+
"format": "biome check",
9+
"format:fix": "biome check --write",
1010
"generate": "turbo run generate",
1111
"lint": "turbo run lint",
1212
"lint:fix": "turbo run lint:fix",
@@ -16,12 +16,15 @@
1616
"ubrn:android": "pnpm -C packages/react-native ubrn:android",
1717
"ubrn:ios": "sh -c 'if [ \"$(uname -s)\" = Darwin ]; then pnpm -C packages/react-native ubrn:ios; else echo Skipping ubrn:ios: macOS-only build; fi'",
1818
"ubrn": "pnpm ubrn:android && pnpm ubrn:ios",
19-
"ubrn:clean": "pnpm -C packages/react-native ubrn:clean && pnpm -C packages/rs-core-uniffi-web clean"
19+
"ubrn:clean": "pnpm -C packages/react-native ubrn:clean && pnpm -C packages/rs-core-uniffi-web clean",
20+
"prepare": "husky"
2021
},
2122
"devDependencies": {
23+
"@biomejs/biome": "^2.4.16",
2224
"@types/react": "~19.2.10",
2325
"eslint": "^9.38.0",
24-
"prettier": "^3.8.0",
26+
"husky": "^9.1.7",
27+
"lint-staged": "^17.0.7",
2528
"turbo": "^2.6.1",
2629
"typescript-eslint": "^8.46.2"
2730
},

packages/js-browser/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
"default": "./src/index.ts"
2222
}
2323
},
24-
"files": [
25-
"dist"
26-
],
24+
"files": ["dist"],
2725
"scripts": {
2826
"build": "tsc -b && webpack",
2927
"dev": "tsc -b && webpack --watch",

packages/js-core/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
"import": "./dist/index.es.js"
1212
}
1313
},
14-
"files": [
15-
"dist"
16-
],
14+
"files": ["dist"],
1715
"scripts": {
1816
"generate": "mkdir -p ./src/proto && protoc --ts_out=./src/proto --proto_path=../../protos --experimental_allow_proto3_optional ../../protos/polycentric.proto ../../protos/polycentric/v2/keypair.proto ../../protos/polycentric/v2/event_key.proto ../../protos/polycentric/v2/identity.proto ../../protos/polycentric/v2/content.proto ../../protos/polycentric/v2/events.proto ../../protos/polycentric/v2/feeds.proto ../../protos/polycentric/v2/server.proto ../../protos/polycentric/v2/pairing_service.proto ../../protos/polycentric/v2/notifications.proto",
1917
"build": "tsc -b && webpack",

0 commit comments

Comments
 (0)