Skip to content

Commit 759dfa0

Browse files
committed
fix: quick taps not dismissing and added biome as default linter
1 parent 99fcc5d commit 759dfa0

34 files changed

Lines changed: 2963 additions & 3430 deletions

biome.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.4.5/schema.json",
3+
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
4+
"formatter": { "enabled": true, "indentStyle": "space" },
5+
"linter": {
6+
"enabled": true,
7+
"rules": {
8+
"recommended": true
9+
},
10+
"includes": [
11+
"**",
12+
"src/**",
13+
"!node_modules/**",
14+
"!build/**",
15+
"!android/**",
16+
"!ios/**",
17+
"!**/*.min.js",
18+
"!**/*.bundle.js"
19+
]
20+
},
21+
"javascript": {
22+
"formatter": { "quoteStyle": "single" }
23+
},
24+
"assist": {
25+
"enabled": true,
26+
"actions": { "source": { "organizeImports": "on" } }
27+
}
28+
}

eslint.config.mjs

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

example/babel.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
const path = require('path');
1+
const path = require('node:path');
22
const { getConfig } = require('react-native-builder-bob/babel-config');
33
const pkg = require('../package.json');
44

55
const root = path.resolve(__dirname, '..');
66

7-
module.exports = function (api) {
7+
module.exports = (api) => {
88
api.cache(true);
99

1010
return getConfig(
1111
{
1212
presets: ['babel-preset-expo'],
1313
},
14-
{ root, pkg }
14+
{ root, pkg },
1515
);
1616
};

example/metro.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const path = require('path');
1+
const path = require('node:path');
22
const { getDefaultConfig } = require('@expo/metro-config');
33
const { withMetroConfig } = require('react-native-monorepo-config');
44

example/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
"web": "expo start --web"
1010
},
1111
"dependencies": {
12-
"@expo/metro-runtime": "~6.1.2",
13-
"expo": "^54.0.17",
14-
"expo-status-bar": "~3.0.8",
15-
"react": "19.1.0",
16-
"react-dom": "19.1.0",
17-
"react-native": "0.81.4",
18-
"react-native-safe-area-context": "^5.6.1",
12+
"@expo/metro-runtime": "~55.0.6",
13+
"expo": "^55.0.4",
14+
"expo-status-bar": "~55.0.4",
15+
"react": "19.2.0",
16+
"react-dom": "19.2.0",
17+
"react-native": "0.83.2",
18+
"react-native-safe-area-context": "^5.7.0",
1919
"react-native-web": "~0.21.2"
2020
},
2121
"private": true,
2222
"devDependencies": {
23-
"react-native-builder-bob": "^0.40.13",
24-
"react-native-monorepo-config": "^0.2.2"
23+
"react-native-builder-bob": "^0.40.18",
24+
"react-native-monorepo-config": "^0.3.3"
2525
}
2626
}

example/src/App.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import React, { useCallback, useState } from 'react';
1+
import type React from 'react';
2+
import { useCallback, useState } from 'react';
23
import {
34
Pressable,
45
ScrollView,
56
StatusBar,
67
StyleSheet,
78
Text,
8-
View,
99
useWindowDimensions,
10+
View,
1011
} from 'react-native';
11-
import { SafeAreaView } from 'react-native-safe-area-context';
12-
import { ToastProvider, useToast } from 'react-native-rooster';
1312
import type { ToastType } from 'react-native-rooster';
13+
import { ToastProvider, useToast } from 'react-native-rooster';
14+
import { SafeAreaView } from 'react-native-safe-area-context';
1415

1516
type ButtonConfig = {
1617
label: string;
@@ -49,7 +50,7 @@ const ToastDemo: React.FC = () => {
4950
const { width } = useWindowDimensions();
5051
const isWide = width >= 768;
5152
const [verticalPosition, setVerticalPosition] = useState<'top' | 'bottom'>(
52-
'bottom'
53+
'bottom',
5354
);
5455
const [horizontalPosition, setHorizontalPosition] = useState<
5556
'left' | 'center' | 'right'
@@ -58,7 +59,7 @@ const ToastDemo: React.FC = () => {
5859
const updatePosition = useCallback(
5960
(
6061
nextVertical: 'top' | 'bottom',
61-
nextHorizontal: 'left' | 'center' | 'right'
62+
nextHorizontal: 'left' | 'center' | 'right',
6263
) => {
6364
setToastConfig({
6465
position: {
@@ -67,7 +68,7 @@ const ToastDemo: React.FC = () => {
6768
},
6869
});
6970
},
70-
[setToastConfig]
71+
[setToastConfig],
7172
);
7273

7374
const handlePress = useCallback(
@@ -99,23 +100,23 @@ const ToastDemo: React.FC = () => {
99100
message: 'Everything is fully customisable.',
100101
});
101102
},
102-
[addToast]
103+
[addToast],
103104
);
104105

105106
const handleVerticalChange = useCallback(
106107
(option: ToggleOption<'top' | 'bottom'>) => {
107108
setVerticalPosition(option.value);
108109
updatePosition(option.value, horizontalPosition);
109110
},
110-
[horizontalPosition, updatePosition]
111+
[horizontalPosition, updatePosition],
111112
);
112113

113114
const handleHorizontalChange = useCallback(
114115
(option: ToggleOption<'left' | 'center' | 'right'>) => {
115116
setHorizontalPosition(option.value);
116117
updatePosition(verticalPosition, option.value);
117118
},
118-
[updatePosition, verticalPosition]
119+
[updatePosition, verticalPosition],
119120
);
120121

121122
return (

lefthook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pre-commit:
33
commands:
44
lint:
55
glob: "*.{js,ts,jsx,tsx}"
6-
run: npx eslint {staged_files}
6+
run: npm run lint
77
types:
88
glob: "*.{js,ts, jsx, tsx}"
99
run: npx tsc

package.json

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"example": "yarn workspace react-native-rooster-example",
3636
"test": "jest",
3737
"typecheck": "tsc",
38-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
38+
"lint": "biome check --write --unsafe; biome format --write",
3939
"clean": "del-cli lib",
4040
"prepare": "bob build",
4141
"release": "release-it --only-version"
@@ -60,31 +60,32 @@
6060
},
6161
"sideEffects": false,
6262
"devDependencies": {
63-
"@commitlint/config-conventional": "^20.0.0",
64-
"@eslint/compat": "^1.4.0",
65-
"@eslint/eslintrc": "^3.3.1",
66-
"@eslint/js": "^9.38.0",
67-
"@evilmartians/lefthook": "^2.0.0",
68-
"@react-native/babel-preset": "0.82.1",
69-
"@react-native/eslint-config": "^0.82.1",
70-
"@release-it/conventional-changelog": "^10.0.1",
63+
"@biomejs/biome": "^2.4.5",
64+
"@commitlint/config-conventional": "^20.4.2",
65+
"@eslint/compat": "^2.0.2",
66+
"@eslint/eslintrc": "^3.3.4",
67+
"@eslint/js": "^10.0.1",
68+
"@evilmartians/lefthook": "^2.1.2",
69+
"@react-native/babel-preset": "0.84.1",
70+
"@react-native/eslint-config": "^0.84.1",
71+
"@release-it/conventional-changelog": "^10.0.5",
7172
"@testing-library/react-native": "^13.3.3",
7273
"@types/jest": "^30.0.0",
73-
"@types/react": "^19.2.2",
74+
"@types/react": "^19.2.14",
7475
"babel-plugin-react-compiler": "^1.0.0",
75-
"commitlint": "^20.1.0",
76+
"commitlint": "^20.4.2",
7677
"del-cli": "^7.0.0",
77-
"eslint": "^9.38.0",
78+
"eslint": "^10.0.2",
7879
"eslint-config-prettier": "^10.1.8",
79-
"eslint-plugin-prettier": "^5.5.4",
80+
"eslint-plugin-prettier": "^5.5.5",
8081
"jest": "^30.2.0",
81-
"prettier": "^3.6.2",
82-
"react": "19.1.1",
83-
"react-native": "0.82.1",
84-
"react-native-builder-bob": "^0.40.13",
85-
"react-native-safe-area-context": "^5.6.1",
86-
"react-test-renderer": "19.1.1",
87-
"release-it": "^19.0.5",
82+
"prettier": "^3.8.1",
83+
"react": "^19.2.4",
84+
"react-native": "0.83.2",
85+
"react-native-builder-bob": "^0.40.18",
86+
"react-native-safe-area-context": "^5.7.0",
87+
"react-test-renderer": "19.2.4",
88+
"release-it": "^19.2.4",
8889
"typescript": "^5.9.3"
8990
},
9091
"peerDependencies": {

src/__tests__/fontSizeConfig.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { render } from '@testing-library/react-native';
2-
import ToastProvider from '../providers/ToastProvider';
32
import useToast from '../hooks/useToast';
3+
import ToastProvider from '../providers/ToastProvider';
44

55
/**
66
* Test suite for font size configuration via initialConfig
@@ -23,7 +23,7 @@ describe('Font Size Configuration', () => {
2323
}}
2424
>
2525
<TestComponent />
26-
</ToastProvider>
26+
</ToastProvider>,
2727
);
2828
}).not.toThrow();
2929
});
@@ -45,7 +45,7 @@ describe('Font Size Configuration', () => {
4545
const { UNSAFE_root } = render(
4646
<ToastProvider initialConfig={initialConfig}>
4747
<TestComponent />
48-
</ToastProvider>
48+
</ToastProvider>,
4949
);
5050

5151
expect(UNSAFE_root).toBeTruthy();
@@ -62,7 +62,7 @@ describe('Font Size Configuration', () => {
6262
render(
6363
<ToastProvider>
6464
<TestComponent />
65-
</ToastProvider>
65+
</ToastProvider>,
6666
);
6767
}).not.toThrow();
6868
});

src/__tests__/index.test.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
import { act, render, waitFor } from '@testing-library/react-native';
12
import React, { useImperativeHandle } from 'react';
2-
import { render, act, waitFor } from '@testing-library/react-native';
3-
4-
import ToastProvider from '../providers/ToastProvider';
53
import useToast from '../hooks/useToast';
4+
import ToastProvider from '../providers/ToastProvider';
65
import type { ToastContextProps } from '../types';
76

87
jest.mock('react-native-safe-area-context', () => ({
@@ -56,7 +55,7 @@ describe('ToastProvider integration', () => {
5655
const { queryByText } = render(
5756
<ToastProvider>
5857
<Harness ref={ref} />
59-
</ToastProvider>
58+
</ToastProvider>,
6059
);
6160

6261
act(() => {
@@ -79,7 +78,7 @@ describe('ToastProvider integration', () => {
7978
const { queryByText } = render(
8079
<ToastProvider>
8180
<Harness ref={ref} />
82-
</ToastProvider>
81+
</ToastProvider>,
8382
);
8483

8584
act(() => {

0 commit comments

Comments
 (0)