diff --git a/biome.json b/biome.json index b410c360..3971d3c8 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "$schema": "https://biomejs.dev/schemas/2.6.7/schema.json", "vcs": { "enabled": false, "clientKind": "git", @@ -7,19 +7,18 @@ }, "files": { "ignoreUnknown": false, - "ignore": ["lib"] + "includes": ["**", "!**/lib"] }, "formatter": { "enabled": true, - "indentStyle": "tab" - }, - "organizeImports": { - "enabled": true + "indentStyle": "tab", + "includes": ["**", "!**/*.md", "!**/*.yml", "!**/*.yaml"] }, + "assist": { "actions": { "source": { "organizeImports": "on" } } }, "linter": { "enabled": true, "rules": { - "recommended": true + "preset": "recommended" } }, "javascript": { diff --git a/package.json b/package.json index bc37346e..658fb1dc 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ }, "homepage": "https://github.com/react-native-menu/menu#readme", "devDependencies": { - "@biomejs/biome": "1.9.4", + "@biomejs/biome": "2.6.7", "@callstack/react-native-visionos": "^0.79.6", "@react-native-community/cli": "^20.0.2", "@react-native/babel-preset": "^0.81.1", diff --git a/react-native.config.js b/react-native.config.js index 2755895f..00dafb81 100644 --- a/react-native.config.js +++ b/react-native.config.js @@ -12,7 +12,7 @@ const project = (() => { sourceDir: path.join("example", "ios"), }, }); - } catch (e) { + } catch { return undefined; } })(); diff --git a/src/NativeModuleSpecs/UIMenuNativeComponent.ts b/src/NativeModuleSpecs/UIMenuNativeComponent.ts index e065a154..d0deaa6f 100644 --- a/src/NativeModuleSpecs/UIMenuNativeComponent.ts +++ b/src/NativeModuleSpecs/UIMenuNativeComponent.ts @@ -1,3 +1,9 @@ +// biome-ignore-start lint/suspicious/noReactNativeDeepImports: this is a codegen spec file. +// React Native's codegen parses these imports directly and expects CodegenTypes and +// codegenNativeComponent on these exact paths. react-native/index.js does re-export +// codegenNativeComponent, but rewriting an import that codegen parses risks breaking native +// builds for no benefit -- see the note on this file in CLAUDE.md. Scoped to this import +// block rather than the whole file, so accidental deep imports below are still caught. import type { DirectEventHandler, Int32, @@ -5,6 +11,7 @@ import type { } from "react-native/Libraries/Types/CodegenTypes"; import type { HostComponent, ViewProps } from "react-native"; import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent"; +// biome-ignore-end lint/suspicious/noReactNativeDeepImports: end of the codegen import block. /* Caution, those below are not just typescript types. diff --git a/src/UIMenuView.android.tsx b/src/UIMenuView.android.tsx index 0c426304..5fef294d 100644 --- a/src/UIMenuView.android.tsx +++ b/src/UIMenuView.android.tsx @@ -1,4 +1,5 @@ import { + codegenNativeCommands, findNodeHandle, type HostComponent, requireNativeComponent, @@ -6,7 +7,6 @@ import { } from "react-native"; import type { MenuComponentRef, NativeMenuComponentProps } from "./types"; import { forwardRef, useImperativeHandle, useRef } from "react"; -import codegenNativeCommands from "react-native/Libraries/Utilities/codegenNativeCommands"; const NativeMenuComponent = requireNativeComponent( "MenuView", diff --git a/yarn.lock b/yarn.lock index c4f34047..81d9902d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3415,19 +3415,25 @@ __metadata: languageName: node linkType: hard -"@biomejs/biome@npm:1.9.4": - version: 1.9.4 - resolution: "@biomejs/biome@npm:1.9.4" - dependencies: - "@biomejs/cli-darwin-arm64": "npm:1.9.4" - "@biomejs/cli-darwin-x64": "npm:1.9.4" - "@biomejs/cli-linux-arm64": "npm:1.9.4" - "@biomejs/cli-linux-arm64-musl": "npm:1.9.4" - "@biomejs/cli-linux-x64": "npm:1.9.4" - "@biomejs/cli-linux-x64-musl": "npm:1.9.4" - "@biomejs/cli-win32-arm64": "npm:1.9.4" - "@biomejs/cli-win32-x64": "npm:1.9.4" +"@biomejs/biome@npm:2.6.7": + version: 2.6.7 + resolution: "@biomejs/biome@npm:2.6.7" + dependencies: + "@biomejs/cli-android-arm64": "npm:2.6.7" + "@biomejs/cli-android-x64": "npm:2.6.7" + "@biomejs/cli-darwin-arm64": "npm:2.6.7" + "@biomejs/cli-darwin-x64": "npm:2.6.7" + "@biomejs/cli-linux-arm64": "npm:2.6.7" + "@biomejs/cli-linux-arm64-musl": "npm:2.6.7" + "@biomejs/cli-linux-x64": "npm:2.6.7" + "@biomejs/cli-linux-x64-musl": "npm:2.6.7" + "@biomejs/cli-win32-arm64": "npm:2.6.7" + "@biomejs/cli-win32-x64": "npm:2.6.7" dependenciesMeta: + "@biomejs/cli-android-arm64": + optional: true + "@biomejs/cli-android-x64": + optional: true "@biomejs/cli-darwin-arm64": optional: true "@biomejs/cli-darwin-x64": @@ -3446,62 +3452,76 @@ __metadata: optional: true bin: biome: bin/biome - checksum: 10c0/b5655c5aed9a6fffe24f7d04f15ba4444389d0e891c9ed9106fab7388ac9b4be63185852cc2a937b22940dac3e550b71032a4afd306925cfea436c33e5646b3e + checksum: 10c0/2ad0a8076ce352386dd14f6170eb1ddd8e9ef5b21d6b195a0b92e0a0216b541b85d51eb41432767d00f756c20c47960ca50c475369626117c9e4dc4d12174f91 + languageName: node + linkType: hard + +"@biomejs/cli-android-arm64@npm:2.6.7": + version: 2.6.7 + resolution: "@biomejs/cli-android-arm64@npm:2.6.7" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@biomejs/cli-android-x64@npm:2.6.7": + version: 2.6.7 + resolution: "@biomejs/cli-android-x64@npm:2.6.7" + conditions: os=android & cpu=x64 languageName: node linkType: hard -"@biomejs/cli-darwin-arm64@npm:1.9.4": - version: 1.9.4 - resolution: "@biomejs/cli-darwin-arm64@npm:1.9.4" +"@biomejs/cli-darwin-arm64@npm:2.6.7": + version: 2.6.7 + resolution: "@biomejs/cli-darwin-arm64@npm:2.6.7" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@biomejs/cli-darwin-x64@npm:1.9.4": - version: 1.9.4 - resolution: "@biomejs/cli-darwin-x64@npm:1.9.4" +"@biomejs/cli-darwin-x64@npm:2.6.7": + version: 2.6.7 + resolution: "@biomejs/cli-darwin-x64@npm:2.6.7" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@biomejs/cli-linux-arm64-musl@npm:1.9.4": - version: 1.9.4 - resolution: "@biomejs/cli-linux-arm64-musl@npm:1.9.4" +"@biomejs/cli-linux-arm64-musl@npm:2.6.7": + version: 2.6.7 + resolution: "@biomejs/cli-linux-arm64-musl@npm:2.6.7" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@biomejs/cli-linux-arm64@npm:1.9.4": - version: 1.9.4 - resolution: "@biomejs/cli-linux-arm64@npm:1.9.4" +"@biomejs/cli-linux-arm64@npm:2.6.7": + version: 2.6.7 + resolution: "@biomejs/cli-linux-arm64@npm:2.6.7" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@biomejs/cli-linux-x64-musl@npm:1.9.4": - version: 1.9.4 - resolution: "@biomejs/cli-linux-x64-musl@npm:1.9.4" +"@biomejs/cli-linux-x64-musl@npm:2.6.7": + version: 2.6.7 + resolution: "@biomejs/cli-linux-x64-musl@npm:2.6.7" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@biomejs/cli-linux-x64@npm:1.9.4": - version: 1.9.4 - resolution: "@biomejs/cli-linux-x64@npm:1.9.4" +"@biomejs/cli-linux-x64@npm:2.6.7": + version: 2.6.7 + resolution: "@biomejs/cli-linux-x64@npm:2.6.7" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@biomejs/cli-win32-arm64@npm:1.9.4": - version: 1.9.4 - resolution: "@biomejs/cli-win32-arm64@npm:1.9.4" +"@biomejs/cli-win32-arm64@npm:2.6.7": + version: 2.6.7 + resolution: "@biomejs/cli-win32-arm64@npm:2.6.7" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@biomejs/cli-win32-x64@npm:1.9.4": - version: 1.9.4 - resolution: "@biomejs/cli-win32-x64@npm:1.9.4" +"@biomejs/cli-win32-x64@npm:2.6.7": + version: 2.6.7 + resolution: "@biomejs/cli-win32-x64@npm:2.6.7" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -4768,7 +4788,7 @@ __metadata: version: 0.0.0-use.local resolution: "@react-native-menu/menu@workspace:." dependencies: - "@biomejs/biome": "npm:1.9.4" + "@biomejs/biome": "npm:2.6.7" "@callstack/react-native-visionos": "npm:^0.79.6" "@react-native-community/cli": "npm:^20.0.2" "@react-native/babel-preset": "npm:^0.81.1"