Skip to content

Commit e5942ab

Browse files
authored
fix: Migrate from ESLint to Biome for code formatting and linting (#12)
* refactor: migrate from ESLint to Biome for code formatting and linting * chore: update JSX config and remove unnecessary React imports * chore: exclude ios and android directories from biome linting * style: fix indentation in NitroImageViewConfig.json from tabs to spaces * chore: upgrade Biome to 2.1.1 * ci: update Biome configuration files * style: format NitroImageViewConfig.json indentation with tabs * fix: update lint-ci script to use biome check instead of biome lint * ci: add GitHub Actions workflow for Biome linting * chore: exclude 'lib' directory from biome linting and formatting * style: format array syntax in biome.json configuration * style: convert all indentation from tabs to 4 spaces * chore: exclude nitrogen/generated directory from biome linting * style: format * style: undo lint over nitrogen/generated
1 parent 82f2c15 commit e5942ab

33 files changed

+854
-1176
lines changed

.github/workflows/lint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Lint with Biome
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
lint:
14+
name: Run Biome Linter
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup Bun
20+
uses: oven-sh/setup-bun@v2
21+
22+
- name: Install dependencies
23+
run: bun install
24+
25+
- name: Run Biome
26+
run: bun lint-ci
27+
env:
28+
CI: true

babel.config.js

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

biome.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.1.1/schema.json",
3+
"vcs": {
4+
"enabled": false,
5+
"clientKind": "git",
6+
"useIgnoreFile": false
7+
},
8+
"files": {
9+
"ignoreUnknown": false,
10+
"includes": [
11+
"**",
12+
"!lib/**",
13+
"!**/ios/**",
14+
"!**/android/**",
15+
"!nitrogen/generated/**"
16+
]
17+
},
18+
"formatter": {
19+
"enabled": true,
20+
"indentStyle": "space",
21+
"indentWidth": 4
22+
},
23+
"linter": {
24+
"enabled": true,
25+
"rules": {
26+
"recommended": true
27+
}
28+
},
29+
"javascript": {
30+
"formatter": {
31+
"quoteStyle": "double"
32+
}
33+
},
34+
"assist": {
35+
"enabled": true,
36+
"actions": {
37+
"source": {
38+
"organizeImports": "on"
39+
}
40+
}
41+
}
42+
}

bun.lock

Lines changed: 93 additions & 460 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/.eslintrc.js

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

example/.prettierrc.js

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

example/app.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"name": "NitroImageExample",
3-
"displayName": "NitroImageExample"
2+
"name": "NitroImageExample",
3+
"displayName": "NitroImageExample"
44
}

example/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/babel-preset'],
2+
presets: ["module:@react-native/babel-preset"],
33
};

example/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* @format
33
*/
44

5-
import {AppRegistry} from 'react-native';
6-
import App from './src/App';
7-
import {name as appName} from './app.json';
5+
import { AppRegistry } from "react-native";
6+
import { name as appName } from "./app.json";
7+
import App from "./src/App";
88

99
AppRegistry.registerComponent(appName, () => App);
Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
11
{
2-
"images" : [
3-
{
4-
"idiom" : "iphone",
5-
"scale" : "2x",
6-
"size" : "20x20"
7-
},
8-
{
9-
"idiom" : "iphone",
10-
"scale" : "3x",
11-
"size" : "20x20"
12-
},
13-
{
14-
"idiom" : "iphone",
15-
"scale" : "2x",
16-
"size" : "29x29"
17-
},
18-
{
19-
"idiom" : "iphone",
20-
"scale" : "3x",
21-
"size" : "29x29"
22-
},
23-
{
24-
"idiom" : "iphone",
25-
"scale" : "2x",
26-
"size" : "40x40"
27-
},
28-
{
29-
"idiom" : "iphone",
30-
"scale" : "3x",
31-
"size" : "40x40"
32-
},
33-
{
34-
"idiom" : "iphone",
35-
"scale" : "2x",
36-
"size" : "60x60"
37-
},
38-
{
39-
"idiom" : "iphone",
40-
"scale" : "3x",
41-
"size" : "60x60"
42-
},
43-
{
44-
"idiom" : "ios-marketing",
45-
"scale" : "1x",
46-
"size" : "1024x1024"
47-
}
48-
],
49-
"info" : {
50-
"author" : "xcode",
51-
"version" : 1
52-
}
2+
"images": [
3+
{
4+
"idiom": "iphone",
5+
"scale": "2x",
6+
"size": "20x20"
7+
},
8+
{
9+
"idiom": "iphone",
10+
"scale": "3x",
11+
"size": "20x20"
12+
},
13+
{
14+
"idiom": "iphone",
15+
"scale": "2x",
16+
"size": "29x29"
17+
},
18+
{
19+
"idiom": "iphone",
20+
"scale": "3x",
21+
"size": "29x29"
22+
},
23+
{
24+
"idiom": "iphone",
25+
"scale": "2x",
26+
"size": "40x40"
27+
},
28+
{
29+
"idiom": "iphone",
30+
"scale": "3x",
31+
"size": "40x40"
32+
},
33+
{
34+
"idiom": "iphone",
35+
"scale": "2x",
36+
"size": "60x60"
37+
},
38+
{
39+
"idiom": "iphone",
40+
"scale": "3x",
41+
"size": "60x60"
42+
},
43+
{
44+
"idiom": "ios-marketing",
45+
"scale": "1x",
46+
"size": "1024x1024"
47+
}
48+
],
49+
"info": {
50+
"author": "xcode",
51+
"version": 1
52+
}
5353
}

0 commit comments

Comments
 (0)