Skip to content

Commit

Permalink
[chore] migrate from eslint/prettier to biome (#955)
Browse files Browse the repository at this point in the history
* feat: migrate to biome

* doc: fix contributing

* fix: type

* resolve conflict and format

* fix: remove built files

* fix: remove built files

* fix: remove built files

* fix: format"
  • Loading branch information
Naturalclar authored Nov 8, 2024
1 parent 205c4bb commit 7b5f75d
Show file tree
Hide file tree
Showing 20 changed files with 788 additions and 2,517 deletions.
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ To edit the Kotlin files, open `example/android` in Android studio and find the
As of the latest update, `com.reactnativemenu.MenuViewManager` has been refactored into an abstract base class, `MenuViewManagerBase`. Any React Native version-dependent changes should be implemented in the specific version folders under `reactNativeVersionPatch`.

For consistency:

- When making version-specific modifications, ensure you update the appropriate implementation of `MenuViewManager`:
- `src/reactNativeVersionPatch/75/MenuViewManager.kt` for React Native < 0.76
- `src/reactNativeVersionPatch/latest/MenuViewManager.kt` for React Native >= 0.76
Expand All @@ -81,9 +82,9 @@ Our pre-commit hooks verify that your commit message matches this format when co

### Linting and tests

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

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.
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.

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

Expand All @@ -93,7 +94,7 @@ The `package.json` file contains various scripts for common tasks:

- `yarn bootstrap`: setup project by installing all dependencies and pods.
- `yarn typescript`: type-check files with TypeScript.
- `yarn lint`: lint files with ESLint.
- `yarn lint`: lint files with Biome.
- `yarn test`: run unit tests with Jest.
- `yarn start`: start the Metro server for the example app.
- `yarn android`: run the example app on Android.
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ['module:@react-native/babel-preset'],
presets: ["module:@react-native/babel-preset"],
};
30 changes: 30 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": ["lib"]
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
}
}
45 changes: 15 additions & 30 deletions example/app.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
{
"name": "MenuExample",
"displayName": "MenuExample",
"components": [
{
"appKey": "MenuExample",
"displayName": "MenuExample"
}
],
"resources": {
"android": [
"dist/res",
"dist/main.android.jsbundle"
],
"ios": [
"dist/assets",
"dist/main.ios.jsbundle"
],
"macos": [
"dist/assets",
"dist/main.macos.jsbundle"
],
"visionos": [
"dist/assets",
"dist/main.visionos.jsbundle"
],
"windows": [
"dist/assets",
"dist/main.windows.bundle"
]
}
"name": "MenuExample",
"displayName": "MenuExample",
"components": [
{
"appKey": "MenuExample",
"displayName": "MenuExample"
}
],
"resources": {
"android": ["dist/res", "dist/main.android.jsbundle"],
"ios": ["dist/assets", "dist/main.ios.jsbundle"],
"macos": ["dist/assets", "dist/main.macos.jsbundle"],
"visionos": ["dist/assets", "dist/main.visionos.jsbundle"],
"windows": ["dist/assets", "dist/main.windows.bundle"]
}
}
2 changes: 1 addition & 1 deletion example/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ['module:@react-native/babel-preset'],
presets: ["module:@react-native/babel-preset"],
};
6 changes: 3 additions & 3 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AppRegistry } from 'react-native';
import { App } from './src/App';
import { name as appName } from './app.json';
import { AppRegistry } from "react-native";
import { App } from "./src/App";
import { name as appName } from "./app.json";

AppRegistry.registerComponent(appName, () => App);
Loading

0 comments on commit 7b5f75d

Please sign in to comment.