Skip to content

Commit

Permalink
chore(react-native-playground): eslint & type (#1358)
Browse files Browse the repository at this point in the history
  • Loading branch information
manudeli authored Nov 14, 2024
1 parent 99cc42c commit d2fdc90
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 38 deletions.
2 changes: 1 addition & 1 deletion examples/react-native-playground/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Providers } from '@/src/providers'
import { Slot } from 'expo-router'
import * as SplashScreen from 'expo-splash-screen'
import { StatusBar } from 'expo-status-bar'
import { Providers } from '@/src/providers'
import 'react-native-reanimated'

SplashScreen.preventAutoHideAsync()
Expand Down
15 changes: 15 additions & 0 deletions examples/react-native-playground/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import path from 'path'
import { fileURLToPath } from 'url'
import { suspensiveReactTypeScriptConfig } from '@suspensive/eslint-config'

export default [
...suspensiveReactTypeScriptConfig,
{
languageOptions: {
parserOptions: {
tsconfigRootDir: path.dirname(fileURLToPath(import.meta.url)),
project: './tsconfig.json',
},
},
},
]
21 changes: 11 additions & 10 deletions examples/react-native-playground/package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
{
"name": "@suspensive/react-native-playground",
"author": "Jonghyeon Ko <[email protected]>",
"version": "0.0.0",
"private": true,
"author": "Jonghyeon Ko <[email protected]>",
"main": "expo-router/entry",
"scripts": {
"start": "expo start",
"reset-project": "node ./scripts/reset-project.js",
"android": "expo start --android",
"ci:eslint": "eslint \"**/*.{ts,tsx,cts,mts}\"",
"ci:type": "tsc --noEmit",
"ios": "expo start --ios",
"web": "expo start --web",
"reset-project": "node ./scripts/reset-project.js",
"start": "expo start",
"test": "jest --watchAll",
"lint": "expo lint"
},
"jest": {
"preset": "jest-expo"
"web": "expo start --web"
},
"dependencies": {
"@suspensive/react-native": "workspace:*",
"@expo/vector-icons": "^14.0.2",
"@react-navigation/bottom-tabs": "^7.0.0",
"@react-navigation/native": "^7.0.0",
"@suspensive/react-native": "workspace:*",
"expo": "catalog:",
"expo-blur": "~14.0.1",
"expo-constants": "~17.0.3",
Expand Down Expand Up @@ -52,5 +51,7 @@
"react-test-renderer": "18.3.1",
"typescript": "^5.3.3"
},
"private": true
"jest": {
"preset": "jest-expo"
}
}
5 changes: 2 additions & 3 deletions examples/react-native-playground/src/providers.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'
import * as SplashScreen from 'expo-splash-screen'
import { PropsWithChildren } from 'react'
import { useEffect } from 'react'
import { type PropsWithChildren, useEffect } from 'react'
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'

export const Providers = ({ children }: PropsWithChildren) => {
return (
Expand Down
11 changes: 2 additions & 9 deletions examples/react-native-playground/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,8 @@
"compilerOptions": {
"strict": true,
"paths": {
"@/*": [
"./*"
]
"@/*": ["./*"]
}
},
"include": [
"**/*.ts",
"**/*.tsx",
".expo/types/**/*.ts",
"expo-env.d.ts"
]
"include": ["**/*.ts", "**/*.tsx", ".expo/types/**/*.ts", "expo-env.d.ts", "eslint.config.mjs"]
}
18 changes: 3 additions & 15 deletions packages/react/src/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,9 @@ class BaseErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState
export const ErrorBoundary = Object.assign(
(() => {
const ErrorBoundary = forwardRef<{ reset(): void }, ErrorBoundaryProps>(
(
{
fallback,
children,
// TODO: remove this line
// eslint-disable-next-line @typescript-eslint/unbound-method
onError,
// TODO: remove this line
// eslint-disable-next-line @typescript-eslint/unbound-method
onReset,
resetKeys,
shouldCatch,
},
ref
) => {
// TODO: remove this line
// eslint-disable-next-line @typescript-eslint/unbound-method
({ fallback, children, onError, onReset, resetKeys, shouldCatch }, ref) => {
const group = useContext(ErrorBoundaryGroupContext) ?? { resetKey: 0 }
const baseErrorBoundaryRef = useRef<BaseErrorBoundary>(null)
useImperativeHandle(ref, () => ({
Expand Down

0 comments on commit d2fdc90

Please sign in to comment.