Skip to content

Commit 209c188

Browse files
authored
Merge pull request #5 from xxsnakerxx/switch-to-biome
Switch to `biome`
2 parents 4c4309f + 68f2bb8 commit 209c188

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2761
-5460
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
branches:
55
- main
66
pull_request:
7-
branches:
8-
- main
97
merge_group:
108
types:
119
- checks_requested

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@ To run the example app on Web:
4949
pnpm example web
5050
```
5151

52-
Make sure your code passes TypeScript and ESLint. Run the following to verify:
52+
Make sure your code passes TypeScript and Biome. Run the following to verify:
5353

5454
```sh
5555
pnpm typecheck
5656
pnpm lint
5757
```
5858

59-
To fix formatting errors, run the following:
59+
To fix lint and formatting errors, run the following:
6060

6161
```sh
62-
pnpm lint --fix
62+
pnpm lint:fix
6363
```
6464

6565
Remember to add tests for your change if possible. Run the unit tests by:
@@ -83,9 +83,9 @@ Our pre-commit hooks verify that your commit message matches this format when co
8383

8484
### Linting and tests
8585

86-
[ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
86+
[Biome](https://biomejs.dev/), [TypeScript](https://www.typescriptlang.org/)
8787

88-
We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
88+
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.
8989

9090
Our pre-commit hooks verify that the linter and tests pass when committing.
9191

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

106106
- `pnpm install`: setup project by installing dependencies.
107107
- `pnpm typecheck`: type-check files with TypeScript.
108-
- `pnpm lint`: lint files with ESLint.
108+
- `pnpm lint`: lint and check formatting with Biome.
109109
- `pnpm test`: run unit tests with Jest.
110110
- `pnpm example start`: start the Metro server for the example app.
111111
- `pnpm example android`: run the example app on Android.

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ['module:react-native-builder-bob/babel-preset'],
2+
presets: ["module:react-native-builder-bob/babel-preset"],
33
};

biome.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"vcs": {
4+
"clientKind": "git",
5+
"defaultBranch": "main",
6+
"enabled": true,
7+
"useIgnoreFile": true
8+
}
9+
}

eslint.config.mjs

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

example/app.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
{
2-
"expo": {
3-
"name": "example",
4-
"slug": "example",
5-
"version": "1.0.0",
6-
"orientation": "portrait",
7-
"icon": "./assets/icon.png",
8-
"userInterfaceStyle": "light",
9-
"newArchEnabled": true,
10-
"splash": {
11-
"image": "./assets/splash-icon.png",
12-
"resizeMode": "contain",
13-
"backgroundColor": "#ffffff"
14-
},
15-
"ios": {
16-
"supportsTablet": true,
17-
"bundleIdentifier": "alertqueue.example"
18-
},
19-
"android": {
20-
"adaptiveIcon": {
21-
"foregroundImage": "./assets/adaptive-icon.png",
22-
"backgroundColor": "#ffffff"
23-
},
24-
"package": "alertqueue.example"
25-
},
26-
"web": {
27-
"favicon": "./assets/favicon.png"
28-
}
29-
}
2+
"expo": {
3+
"name": "React Native Alert Queue",
4+
"slug": "rn.alert.queue.example",
5+
"version": "1.0.0",
6+
"orientation": "portrait",
7+
"icon": "./assets/icon.png",
8+
"userInterfaceStyle": "light",
9+
"newArchEnabled": true,
10+
"splash": {
11+
"image": "./assets/splash-icon.png",
12+
"resizeMode": "contain",
13+
"backgroundColor": "#ffffff"
14+
},
15+
"ios": {
16+
"supportsTablet": true,
17+
"bundleIdentifier": "rn.alert.queue.example"
18+
},
19+
"android": {
20+
"adaptiveIcon": {
21+
"foregroundImage": "./assets/adaptive-icon.png",
22+
"backgroundColor": "#ffffff"
23+
},
24+
"package": "rn.alert.queue.example"
25+
},
26+
"web": {
27+
"favicon": "./assets/favicon.png"
28+
}
29+
}
3030
}

example/babel.config.js

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

5-
const root = path.resolve(__dirname, '..');
5+
const root = path.resolve(__dirname, "..");
66

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

10-
return getConfig(
11-
{
12-
presets: ['babel-preset-expo'],
13-
},
14-
{ root, pkg }
15-
);
10+
return getConfig(
11+
{
12+
presets: ["babel-preset-expo"],
13+
},
14+
{ root, pkg },
15+
);
1616
};

example/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { registerRootComponent } from 'expo';
1+
import { registerRootComponent } from "expo";
22

3-
import App from './src/App';
3+
import App from "./src/App";
44

55
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
66
// It also ensures that whether you load the app in Expo Go or in a native build,

example/metro.config.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
const path = require('path');
2-
const { getDefaultConfig } = require('@expo/metro-config');
3-
const { mergeConfig } = require('@react-native/metro-config');
1+
const path = require("node:path");
2+
const { getDefaultConfig } = require("@expo/metro-config");
3+
const { mergeConfig } = require("@react-native/metro-config");
44

55
const defaultConfig = getDefaultConfig(__dirname);
66

77
const projectRoot = __dirname;
8-
const monorepoRoot = path.resolve(projectRoot, '..');
8+
const monorepoRoot = path.resolve(projectRoot, "..");
99

1010
/**
1111
* Metro configuration
@@ -14,14 +14,14 @@ const monorepoRoot = path.resolve(projectRoot, '..');
1414
* @type {import('@react-native/metro-config').MetroConfig}
1515
*/
1616
const config = {
17-
watchFolders: [monorepoRoot],
18-
resolver: {
19-
nodeModulesPaths: [
20-
path.resolve(projectRoot, 'node_modules'),
21-
path.resolve(monorepoRoot, 'node_modules'),
22-
],
23-
unstable_enablePackageExports: true,
24-
},
17+
watchFolders: [monorepoRoot],
18+
resolver: {
19+
nodeModulesPaths: [
20+
path.resolve(projectRoot, "node_modules"),
21+
path.resolve(monorepoRoot, "node_modules"),
22+
],
23+
unstable_enablePackageExports: true,
24+
},
2525
};
2626

2727
module.exports = mergeConfig(defaultConfig, config);

example/package.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
{
2-
"name": "react-native-alert-queue-example",
3-
"version": "1.0.0",
4-
"main": "index.js",
5-
"scripts": {
6-
"start": "expo start",
7-
"android": "expo start --android",
8-
"ios": "expo start --ios",
9-
"web": "expo start --web"
10-
},
11-
"dependencies": {
12-
"react-native-alert-queue": "workspace:*",
13-
"@expo/metro-runtime": "~6.1.2",
14-
"expo": "~54.0.32",
15-
"expo-status-bar": "~3.0.9",
16-
"react": "19.1.0",
17-
"react-dom": "19.1.0",
18-
"react-native": "0.81.5",
19-
"react-native-reanimated": "~4.1.1",
20-
"react-native-safe-area-context": "~5.6.0",
21-
"react-native-web": "^0.21.0",
22-
"react-native-worklets": "0.5.1"
23-
},
24-
"devDependencies": {
25-
"@babel/core": "^7.20.0",
26-
"@react-native/metro-config": "0.81.5",
27-
"react-native-builder-bob": "^0.40.17"
28-
},
29-
"private": true
2+
"name": "react-native-alert-queue-example",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"scripts": {
6+
"start": "expo start",
7+
"android": "expo start --android",
8+
"ios": "expo start --ios",
9+
"web": "expo start --web"
10+
},
11+
"dependencies": {
12+
"react-native-alert-queue": "workspace:*",
13+
"@expo/metro-runtime": "~6.1.2",
14+
"expo": "~54.0.33",
15+
"expo-status-bar": "~3.0.9",
16+
"react": "19.1.0",
17+
"react-dom": "19.1.0",
18+
"react-native": "0.81.5",
19+
"react-native-reanimated": "~4.1.1",
20+
"react-native-safe-area-context": "~5.6.2",
21+
"react-native-web": "^0.21.2",
22+
"react-native-worklets": "0.5.1"
23+
},
24+
"devDependencies": {
25+
"@babel/core": "^7.29.0",
26+
"@react-native/metro-config": "0.81.5",
27+
"react-native-builder-bob": "^0.40.18"
28+
},
29+
"private": true
3030
}

0 commit comments

Comments
 (0)