跳转到内容

noReactNativeDeepImports

此内容尚不支持你的语言。

biome.json
{
"linter": {
"rules": {
"nursery": {
"noReactNativeDeepImports": "error"
}
}
}
}

Disallow deep imports from the react-native package.

Deep imports reach into React Native’s internal file structure, which is not part of the public API. Internal paths can change between versions without warning, breaking code that depends on them.

import View from "react-native/Libraries/Components/View/View";
code-block.js:1:18 lint/nursery/noReactNativeDeepImports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Deep imports from react-native are not allowed.

> 1 │ import View from “react-native/Libraries/Components/View/View”;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │

React Native’s internal file structure is not part of the public API and may change between versions without warning.

Import from the top-level react-native entry point instead.

This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

const Platform = require("react-native/Libraries/Utilities/Platform");
code-block.js:1:26 lint/nursery/noReactNativeDeepImports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Deep imports from react-native are not allowed.

> 1 │ const Platform = require(“react-native/Libraries/Utilities/Platform”);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │

React Native’s internal file structure is not part of the public API and may change between versions without warning.

Import from the top-level react-native entry point instead.

This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

const View = require("react-native/Libraries/Components/View/View");
code-block.js:1:22 lint/nursery/noReactNativeDeepImports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Deep imports from react-native are not allowed.

> 1 │ const View = require(“react-native/Libraries/Components/View/View”);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │

React Native’s internal file structure is not part of the public API and may change between versions without warning.

Import from the top-level react-native entry point instead.

This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

import("react-native/Libraries/Utilities/Platform");
code-block.js:1:8 lint/nursery/noReactNativeDeepImports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Deep imports from react-native are not allowed.

> 1 │ import(“react-native/Libraries/Utilities/Platform”);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │

React Native’s internal file structure is not part of the public API and may change between versions without warning.

Import from the top-level react-native entry point instead.

This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

import { View } from "react-native";
const { Platform } = require("react-native");