Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Lint with Biome

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
lint:
name: Run Biome Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: bun install

- name: Run Biome
run: bun lint-ci
env:
CI: true
4 changes: 2 additions & 2 deletions 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"],
};
42 changes: 42 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"$schema": "https://biomejs.dev/schemas/2.1.1/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"includes": [
"**",
"!lib/**",
"!**/ios/**",
"!**/android/**",
"!nitrogen/generated/**"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 4
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
553 changes: 93 additions & 460 deletions bun.lock

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions example/.eslintrc.js

This file was deleted.

7 changes: 0 additions & 7 deletions example/.prettierrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions example/app.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "NitroImageExample",
"displayName": "NitroImageExample"
"name": "NitroImageExample",
"displayName": "NitroImageExample"
}
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
Expand Up @@ -2,8 +2,8 @@
* @format
*/

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

AppRegistry.registerComponent(appName, () => App);
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
"images": [
{
"idiom": "iphone",
"scale": "2x",
"size": "20x20"
},
{
"idiom": "iphone",
"scale": "3x",
"size": "20x20"
},
{
"idiom": "iphone",
"scale": "2x",
"size": "29x29"
},
{
"idiom": "iphone",
"scale": "3x",
"size": "29x29"
},
{
"idiom": "iphone",
"scale": "2x",
"size": "40x40"
},
{
"idiom": "iphone",
"scale": "3x",
"size": "40x40"
},
{
"idiom": "iphone",
"scale": "2x",
"size": "60x60"
},
{
"idiom": "iphone",
"scale": "3x",
"size": "60x60"
},
{
"idiom": "ios-marketing",
"scale": "1x",
"size": "1024x1024"
}
],
"info": {
"author": "xcode",
"version": 1
}
}
8 changes: 4 additions & 4 deletions example/ios/NitroImageExample/Images.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
"info": {
"version": 1,
"author": "xcode"
}
}
24 changes: 12 additions & 12 deletions example/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const path = require('path');
const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config");
const path = require("node:path");

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

/**
* Metro configuration
Expand All @@ -10,16 +10,16 @@ const root = path.resolve(__dirname, '..');
* @type {import('@react-native/metro-config').MetroConfig}
*/
const config = {
watchFolders: [root],
watchFolders: [root],

transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
};

module.exports = mergeConfig(getDefaultConfig(__dirname), config);
Expand Down
77 changes: 37 additions & 40 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,39 @@
{
"name": "NitroImageExample",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start --client-logs",
"pods": "bundle install && cd ios && bundle exec pod install"
},
"dependencies": {
"@react-navigation/bottom-tabs": "^7.3.14",
"@react-navigation/native": "^7.1.10",
"react": "19.0.0",
"react-native": "0.79.3",
"react-native-fast-image": "^8.6.3",
"react-native-nitro-image": "..",
"react-native-nitro-modules": "^0.26.3",
"react-native-safe-area-context": "^5.4.1",
"react-native-screens": "^4.11.1"
},
"devDependencies": {
"@babel/core": "^7.27.4",
"@babel/preset-env": "^7.27.2",
"@babel/runtime": "^7.27.6",
"@react-native-community/cli": "18.0.0",
"@react-native-community/cli-platform-android": "18.0.0",
"@react-native-community/cli-platform-ios": "18.0.0",
"@react-native/babel-preset": "0.79.3",
"@react-native/eslint-config": "0.79.3",
"@react-native/metro-config": "0.79.3",
"@react-native/typescript-config": "0.79.3",
"@types/react": "^19.0.0",
"eslint": "^8.19.0",
"prettier": "2.8.8",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}
"name": "NitroImageExample",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start --client-logs",
"pods": "bundle install && cd ios && bundle exec pod install"
},
"dependencies": {
"@react-navigation/bottom-tabs": "^7.3.14",
"@react-navigation/native": "^7.1.10",
"react": "19.0.0",
"react-native": "0.79.3",
"react-native-fast-image": "^8.6.3",
"react-native-nitro-image": "..",
"react-native-nitro-modules": "^0.26.3",
"react-native-safe-area-context": "^5.4.1",
"react-native-screens": "^4.11.1"
},
"devDependencies": {
"@babel/core": "^7.27.4",
"@babel/preset-env": "^7.27.2",
"@babel/runtime": "^7.27.6",
"@react-native-community/cli": "18.0.0",
"@react-native-community/cli-platform-android": "18.0.0",
"@react-native-community/cli-platform-ios": "18.0.0",
"@react-native/babel-preset": "0.79.3",
"@react-native/metro-config": "0.79.3",
"@react-native/typescript-config": "0.79.3",
"@types/react": "^19.0.0",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}
}
28 changes: 12 additions & 16 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,24 @@
* @format
*/

import React from 'react';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { FastImageTab } from './FastImageTab';
import { NitroImageTab } from './NitroImageTab';
import { createStaticNavigation } from '@react-navigation/native';
import { EmptyTab } from './EmptyTab';
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { createStaticNavigation } from "@react-navigation/native";
import { EmptyTab } from "./EmptyTab";
import { FastImageTab } from "./FastImageTab";
import { NitroImageTab } from "./NitroImageTab";

const Tabs = createBottomTabNavigator({
detachInactiveScreens: false,
screens: {
Empty: EmptyTab,
FastImage: FastImageTab,
NitroImage: NitroImageTab,
},
detachInactiveScreens: false,
screens: {
Empty: EmptyTab,
FastImage: FastImageTab,
NitroImage: NitroImageTab,
},
});
const Navigation = createStaticNavigation(Tabs);

function App(): React.JSX.Element {
return (
<Navigation />
);
return <Navigation />;
}


export default App;
Loading