noReactNativeDeepImports
Esta página aún no está disponible en tu idioma.
Summary
Section titled “Summary”- Diagnostic Category:
lint/nursery/noReactNativeDeepImports - This rule doesn’t have a fix.
- The default severity of this rule is error.
- This rule belongs to the following domains:
- Sources:
- Same as
react-native/no-deep-imports
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noReactNativeDeepImports": "error" } } }}Description
Section titled “Description”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.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”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");Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.