Skip to content

Commit bedaf25

Browse files
authored
Merge pull request #209 from gmsgowtham/biomejs
chore(deps): migrate to biomejs
2 parents b676164 + ac98bd3 commit bedaf25

File tree

8 files changed

+66
-70
lines changed

8 files changed

+66
-70
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ Our pre-commit hooks verify that your commit message matches this format when co
7575

7676
### Linting and tests
7777

78-
[Rome](https://docs.rome.tools), [TypeScript](https://www.typescriptlang.org/)
78+
[Biome](https://biomejs.dev), [TypeScript](https://www.typescriptlang.org/)
7979

80-
We use [TypeScript](https://www.typescriptlang.org/) for type checking, [Rome](https://docs.rome.tools/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
80+
We use [TypeScript](https://www.typescriptlang.org/) for type checking, [Biome](https://biomejs.dev/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
8181

8282
Our pre-commit hooks verify that the linter and tests pass when committing.
8383

@@ -97,7 +97,7 @@ The `package.json` file contains various scripts for common tasks:
9797

9898
- `yarn bootstrap`: setup project by installing all dependencies and pods.
9999
- `yarn typecheck`: type-check files with TypeScript.
100-
- `yarn lint`: lint files with Rome.
100+
- `yarn lint`: lint files with Biome.
101101
- `yarn test`: run unit tests with Jest.
102102
- `yarn example start`: start the Metro server for the example app.
103103
- `yarn example android`: run the example app on Android.

rome.json renamed to biome.json

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
{
2-
"$schema": "https://docs.rome.tools/schemas/12.1.0/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/1.3.1/schema.json",
33
"organizeImports": {
4-
"enabled": false
4+
"enabled": true
55
},
66
"linter": {
77
"enabled": true,
88
"rules": {
99
"recommended": true
10-
},
11-
"ignore": [
12-
"dist",
13-
"node_modules",
14-
"example/node_modules",
15-
"example/.expo",
16-
"coverage"
17-
]
10+
}
1811
},
1912
"formatter": {
13+
"enabled": true
14+
},
15+
"files": {
2016
"ignore": [
2117
"dist",
2218
"node_modules",

lefthook.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ pre-commit:
44
lint:
55
files: git diff --name-only @{push}
66
glob: "*.{js,ts,jsx,tsx}"
7-
run: yarn run rome check {staged_files}
7+
run: yarn run biome check {staged_files}
88
format:
99
files: git diff --name-only @{push}
1010
glob: "*.{js,ts,jsx,tsx}"
11-
run: yarn run rome format {staged_files} --write && git add {staged_files}
11+
run: yarn run biome format {staged_files} --write && git add {staged_files}
1212
types:
1313
files: git diff --name-only @{push}
14-
glob: "*.{js,ts, jsx, tsx}"
14+
glob: "*.{js,ts,jsx, tsx}"
1515
run: npx tsc --noEmit
1616
commit-msg:
1717
parallel: true

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
"scripts": {
3030
"test": "jest",
3131
"typecheck": "tsc --noEmit --project tsconfig.build.json",
32-
"lint": "rome check ./",
33-
"format": "rome format ./ --write",
32+
"lint": "biome check ./ --apply-unsafe",
33+
"format": "biome format ./ --write",
3434
"prepare": "yarn build",
3535
"build": "bob build",
3636
"release": "yarn build && release-it",
@@ -58,6 +58,7 @@
5858
"devDependencies": {
5959
"@babel/core": "7.23.2",
6060
"@babel/preset-env": "7.23.2",
61+
"@biomejs/biome": "1.3.1",
6162
"@commitlint/config-conventional": "18.1.0",
6263
"@evilmartians/lefthook": "1.5.2",
6364
"@release-it/conventional-changelog": "7.0.2",
@@ -79,7 +80,6 @@
7980
"react-native-builder-bob": "0.23.1",
8081
"react-test-renderer": "18.2.0",
8182
"release-it": "16.2.1",
82-
"rome": "12.1.3",
8383
"typescript": "5.2.2"
8484
},
8585
"resolutions": {

src/lib/CodeHighlighter.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import React, { useMemo, type FunctionComponent, type ReactNode } from "react";
1+
import React, { type FunctionComponent, type ReactNode, useMemo } from "react";
22
import {
3-
Text,
4-
View,
53
ScrollView,
6-
type ViewStyle,
7-
type TextStyle,
4+
type ScrollViewProps,
85
type StyleProp,
96
StyleSheet,
10-
type ScrollViewProps,
7+
Text,
8+
type TextStyle,
9+
View,
10+
type ViewStyle,
1111
} from "react-native";
1212
import SyntaxHighlighter, {
1313
type SyntaxHighlighterProps,
1414
} from "react-syntax-highlighter";
1515
import { trimNewlines } from "trim-newlines";
1616
import {
17-
getRNStylesFromHljsStyle,
1817
type HighlighterStyleSheet,
1918
type ReactStyle,
19+
getRNStylesFromHljsStyle,
2020
} from "./../utils/styles";
2121

2222
export interface CodeHighlighterProps extends SyntaxHighlighterProps {

src/lib/__tests__/CodeHighlighter.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import CodeHighlighter from "../CodeHighlighter";
21
import { render, screen } from "@testing-library/react-native";
32
import { atomOneDarkReasonable as hljsStyle } from "react-syntax-highlighter/dist/esm/styles/hljs";
3+
import CodeHighlighter from "../CodeHighlighter";
44

55
describe(CodeHighlighter, () => {
66
it("render", async () => {

src/utils/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import transform, { type StyleTuple } from "css-to-react-native";
12
import type { CSSProperties } from "react";
23
import type { TextStyle } from "react-native";
3-
import transform, { type StyleTuple } from "css-to-react-native";
44

55
export type HighlighterStyleSheet = { [key: string]: TextStyle };
66
export type ReactStyle = Record<string, CSSProperties>;

yarn.lock

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,6 +2208,48 @@
22082208
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
22092209
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
22102210

2211+
"@biomejs/biome@1.3.1":
2212+
version "1.3.1"
2213+
resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-1.3.1.tgz#6ab36d619e04ebd22ca96a7ea3386acd3bddd1d8"
2214+
integrity sha512-ufGCBj8ZNbF+vZDZscqvvLIGsh8M4BduQoJ1X3nm8c9Dupp8gzAKibZSWDLLcgnsAVeKEmWwY6r3Wv/JIa0LgA==
2215+
optionalDependencies:
2216+
"@biomejs/cli-darwin-arm64" "1.3.1"
2217+
"@biomejs/cli-darwin-x64" "1.3.1"
2218+
"@biomejs/cli-linux-arm64" "1.3.1"
2219+
"@biomejs/cli-linux-x64" "1.3.1"
2220+
"@biomejs/cli-win32-arm64" "1.3.1"
2221+
"@biomejs/cli-win32-x64" "1.3.1"
2222+
2223+
"@biomejs/cli-darwin-arm64@1.3.1":
2224+
version "1.3.1"
2225+
resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.3.1.tgz#170b0063686112dc667f1b40170d83da19216241"
2226+
integrity sha512-m3cBroQftLFYFh3to6RO4ooLqZsE2K9yf5xOlDjm6D4Vrgq85XFwDOxjjJyGGDjDPQ55xGunm80qmGr8jTjiyA==
2227+
2228+
"@biomejs/cli-darwin-x64@1.3.1":
2229+
version "1.3.1"
2230+
resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.3.1.tgz#170569dbdc874e2b926790dbf66f32bf05ea0a85"
2231+
integrity sha512-i2yDivc/HHBRFJMoRUUPsFs9pKK0NnS/8tQg/uqNsAkLMF9OKZCCxtUJPmpUBHpdQ2f39An1cVpFmCIEv0uYJQ==
2232+
2233+
"@biomejs/cli-linux-arm64@1.3.1":
2234+
version "1.3.1"
2235+
resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.3.1.tgz#8c26ad89eb8bab3a680ede83430e593ceed4ac0a"
2236+
integrity sha512-H56MB7Mf59snzG+nLpfS2j3jXsJ+a6aQOBeRiT0rgn44FZ63yI9jWNIgN1+Xylsa8shmwtquOkoxLS/4KKt0Qg==
2237+
2238+
"@biomejs/cli-linux-x64@1.3.1":
2239+
version "1.3.1"
2240+
resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-1.3.1.tgz#47604e949f4cb9c4343e03a088cd86f7768a4359"
2241+
integrity sha512-8ENayCpYXXC77a7AxDNjC+pPKMYteLzysxhkCCZ7Gd2sWtrH8iMM45JL8wQJhoHz5NT3+qgsfGafiNuxeVAVlg==
2242+
2243+
"@biomejs/cli-win32-arm64@1.3.1":
2244+
version "1.3.1"
2245+
resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.3.1.tgz#0a32fee3f71971854df5bf126250661dd09b2465"
2246+
integrity sha512-gAx/E949/1/jQDwG9nTspVtjikBI/y7RbbUwwBVABF1bcAUC63VhrHfKJRbM7VTXMlZ7n9YrxkyMww8vf40qcQ==
2247+
2248+
"@biomejs/cli-win32-x64@1.3.1":
2249+
version "1.3.1"
2250+
resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-1.3.1.tgz#dc5d5f4198333de084ee35773a3f8681847cd2d0"
2251+
integrity sha512-+08eKmEdVM7d4UxY/tff2aPXbeUNNp6wwH7v0FbrE+25mH9lhELgylEk4+k6OLXOcDT7KDAduzP2f9CuM/Aj9w==
2252+
22112253
"@commitlint/cli@^18.2.0":
22122254
version "18.2.0"
22132255
resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-18.2.0.tgz#c2dc8f0a834b5c4befa48cad6396f694f28d2b5f"
@@ -3127,36 +3169,6 @@
31273169
conventional-recommended-bump "^8.0.0"
31283170
semver "^7.5.4"
31293171

3130-
"@rometools/cli-darwin-arm64@12.1.3":
3131-
version "12.1.3"
3132-
resolved "https://registry.yarnpkg.com/@rometools/cli-darwin-arm64/-/cli-darwin-arm64-12.1.3.tgz#b00fe225e34047c4dac63588e237b11ebec47694"
3133-
integrity sha512-AmFTUDYjBuEGQp/Wwps+2cqUr+qhR7gyXAUnkL5psCuNCz3807TrUq/ecOoct5MIavGJTH6R4aaSL6+f+VlBEg==
3134-
3135-
"@rometools/cli-darwin-x64@12.1.3":
3136-
version "12.1.3"
3137-
resolved "https://registry.yarnpkg.com/@rometools/cli-darwin-x64/-/cli-darwin-x64-12.1.3.tgz#e5bbf02afb1aab7447e743092245dea992b4b29f"
3138-
integrity sha512-k8MbWna8q4LRlb005N2X+JS1UQ+s3ZLBBvwk4fP8TBxlAJXUz17jLLu/Fi+7DTTEmMhM84TWj4FDKW+rNar28g==
3139-
3140-
"@rometools/cli-linux-arm64@12.1.3":
3141-
version "12.1.3"
3142-
resolved "https://registry.yarnpkg.com/@rometools/cli-linux-arm64/-/cli-linux-arm64-12.1.3.tgz#e75b01b74c134edc811e21fa7e1e440602930d59"
3143-
integrity sha512-X/uLhJ2/FNA3nu5TiyeNPqiD3OZoFfNfRvw6a3ut0jEREPvEn72NI7WPijH/gxSz55znfQ7UQ6iM4DZumUknJg==
3144-
3145-
"@rometools/cli-linux-x64@12.1.3":
3146-
version "12.1.3"
3147-
resolved "https://registry.yarnpkg.com/@rometools/cli-linux-x64/-/cli-linux-x64-12.1.3.tgz#2b9f4a68079783f275d4d27df83e4fa2220ec6fc"
3148-
integrity sha512-csP17q1eWiUXx9z6Jr/JJPibkplyKIwiWPYNzvPCGE8pHlKhwZj3YHRuu7Dm/4EOqx0XFIuqqWZUYm9bkIC8xg==
3149-
3150-
"@rometools/cli-win32-arm64@12.1.3":
3151-
version "12.1.3"
3152-
resolved "https://registry.yarnpkg.com/@rometools/cli-win32-arm64/-/cli-win32-arm64-12.1.3.tgz#714acb67ac4ea4c15e2bc6aea4dd290c76c8efc6"
3153-
integrity sha512-RymHWeod57EBOJY4P636CgUwYA6BQdkQjh56XKk4pLEHO6X1bFyMet2XL7KlHw5qOTalzuzf5jJqUs+vf3jdXQ==
3154-
3155-
"@rometools/cli-win32-x64@12.1.3":
3156-
version "12.1.3"
3157-
resolved "https://registry.yarnpkg.com/@rometools/cli-win32-x64/-/cli-win32-x64-12.1.3.tgz#b4f53491d2ca8f1234b3613b7cc73418ad8d76bb"
3158-
integrity sha512-yHSKYidqJMV9nADqg78GYA+cZ0hS1twANAjiFibQdXj9aGzD+s/IzIFEIi/U/OBLvWYg/SCw0QVozi2vTlKFDQ==
3159-
31603172
"@sideway/address@^4.1.3":
31613173
version "4.1.4"
31623174
resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0"
@@ -9110,18 +9122,6 @@ rimraf@~2.6.2:
91109122
dependencies:
91119123
glob "^7.1.3"
91129124

9113-
rome@12.1.3:
9114-
version "12.1.3"
9115-
resolved "https://registry.yarnpkg.com/rome/-/rome-12.1.3.tgz#4d4d62cad16216843680bd3ca11a4c248134902a"
9116-
integrity sha512-e+ff72hxDpe/t5/Us7YRBVw3PBET7SeczTQNn6tvrWdrCaAw3qOukQQ+tDCkyFtS4yGsnhjrJbm43ctNbz27Yg==
9117-
optionalDependencies:
9118-
"@rometools/cli-darwin-arm64" "12.1.3"
9119-
"@rometools/cli-darwin-x64" "12.1.3"
9120-
"@rometools/cli-linux-arm64" "12.1.3"
9121-
"@rometools/cli-linux-x64" "12.1.3"
9122-
"@rometools/cli-win32-arm64" "12.1.3"
9123-
"@rometools/cli-win32-x64" "12.1.3"
9124-
91259125
run-applescript@^5.0.0:
91269126
version "5.0.0"
91279127
resolved "https://registry.yarnpkg.com/run-applescript/-/run-applescript-5.0.0.tgz#e11e1c932e055d5c6b40d98374e0268d9b11899c"

0 commit comments

Comments
 (0)