mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
xplat/js: Auto-fix react-prefer-namespace-import ESLint Rule (#56233)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56233 Applies the automatic fixes from the new `react-prefer-namespace-import` ESLint rule. Changelog: [Internal] Reviewed By: thegreatercurve Differential Revision: D98338132 fbshipit-source-id: 856dd5b96bfb7ab8398bdcbea3651435acbc891e
This commit is contained in:
1 parent
9e058db4c8
commit
bfb6870f66
56 files changed
+68
-56
No files matched your search
@@ -15,7 +15,7 @@ import RNTesterModuleContainer from './components/RNTesterModuleContainer';
|
||||
import SnapshotViewIOS from './examples/Snapshot/SnapshotViewIOS.ios';
|
||||
import RNTesterApp from './RNTesterAppShared';
|
||||
import RNTesterList from './utils/RNTesterList';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {AppRegistry} from 'react-native';
|
||||
|
||||
AppRegistry.registerComponent('SetPropertiesExampleApp', () =>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
'use strict';
|
||||
|
||||
import RNTesterText from './RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {memo} from 'react';
|
||||
import {
|
||||
ActivityIndicator,
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
import type {GestureResponderEvent} from 'react-native';
|
||||
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {Pressable, StyleSheet, Text} from 'react-native';
|
||||
|
||||
type Props = Readonly<{
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
import type {TextProps} from 'react-native';
|
||||
|
||||
import {RNTesterThemeContext} from './RNTesterTheme';
|
||||
import React, {useContext, useMemo} from 'react';
|
||||
import * as React from 'react';
|
||||
import {useContext, useMemo} from 'react';
|
||||
import {Text} from 'react-native';
|
||||
|
||||
type Props = Readonly<{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
import {RNTesterThemeContext} from './RNTesterTheme';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {StyleSheet, Text, View} from 'react-native';
|
||||
|
||||
type Props = Readonly<{
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
'use strict';
|
||||
|
||||
import RNTesterText from '../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {useState} from 'react';
|
||||
import {Image, TouchableHighlight, View} from 'react-native';
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
import RNTesterBlock from '../../components/RNTesterBlock';
|
||||
import RNTesterPage from '../../components/RNTesterPage';
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {Alert, StyleSheet, TouchableWithoutFeedback, View} from 'react-native';
|
||||
|
||||
const importantForAccessibilityValues = [
|
||||
|
||||
@@ -18,7 +18,8 @@ import RNTesterText from '../../components/RNTesterText';
|
||||
import checkImageSource from './check.png';
|
||||
import mixedCheckboxImageSource from './mixed.png';
|
||||
import uncheckImageSource from './uncheck.png';
|
||||
import React, {createRef, useEffect, useRef, useState} from 'react';
|
||||
import * as React from 'react';
|
||||
import {createRef, useEffect, useRef, useState} from 'react';
|
||||
import {
|
||||
AccessibilityInfo,
|
||||
Alert,
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
import type {Node} from 'react';
|
||||
|
||||
import React, {useCallback, useEffect, useRef, useState} from 'react';
|
||||
import * as React from 'react';
|
||||
import {useCallback, useEffect, useRef, useState} from 'react';
|
||||
import {ActivityIndicator, StyleSheet, View} from 'react-native';
|
||||
|
||||
function ToggleAnimatingActivityIndicator() {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import AnExSet from './AnExSet';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Animated,
|
||||
LayoutAnimation,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {Animated, PanResponder, StyleSheet, View} from 'react-native';
|
||||
|
||||
const NUM_BOBBLES = 5;
|
||||
|
||||
@@ -15,7 +15,7 @@ import type {
|
||||
PanResponderGestureState,
|
||||
} from 'react-native';
|
||||
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {Animated, PanResponder, StyleSheet, View} from 'react-native';
|
||||
|
||||
class AnExChained extends React.Component<Object, any> {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Animated,
|
||||
Image,
|
||||
|
||||
@@ -14,7 +14,8 @@ import AnExBobble from './AnExBobble';
|
||||
import AnExChained from './AnExChained';
|
||||
import AnExScroll from './AnExScroll';
|
||||
import AnExTilt from './AnExTilt';
|
||||
import React, {useState} from 'react';
|
||||
import * as React from 'react';
|
||||
import {useState} from 'react';
|
||||
import {
|
||||
Animated,
|
||||
PanResponder,
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import React, {useCallback, useEffect} from 'react';
|
||||
import * as React from 'react';
|
||||
import {useCallback, useEffect} from 'react';
|
||||
import {
|
||||
Animated,
|
||||
PanResponder,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {useEffect, useState} from 'react';
|
||||
import {AppState, Platform} from 'react-native';
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
import RNTesterBlock from '../../components/RNTesterBlock';
|
||||
import RNTesterPage from '../../components/RNTesterPage';
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {useCallback, useState} from 'react';
|
||||
import {
|
||||
Image,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
import type {Node} from 'react';
|
||||
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {Button} from 'react-native';
|
||||
|
||||
exports.displayName = (undefined: ?string);
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React, {useEffect, useState} from 'react';
|
||||
import * as React from 'react';
|
||||
import {useEffect, useState} from 'react';
|
||||
import {Dimensions, useWindowDimensions} from 'react-native';
|
||||
|
||||
type Props = {dim: string};
|
||||
|
||||
@@ -14,7 +14,8 @@ import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
import type {Node} from 'react';
|
||||
|
||||
import {RNTesterThemeContext} from '../../components/RNTesterTheme';
|
||||
import React, {useContext, useRef, useState} from 'react';
|
||||
import * as React from 'react';
|
||||
import {useContext, useRef, useState} from 'react';
|
||||
import {
|
||||
Button,
|
||||
DrawerLayoutAndroid,
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
import type {ViewProps} from 'react-native';
|
||||
|
||||
import React, {useState} from 'react';
|
||||
import * as React from 'react';
|
||||
import {useState} from 'react';
|
||||
import {
|
||||
Button,
|
||||
StyleSheet,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet';
|
||||
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {useState} from 'react';
|
||||
import {
|
||||
Animated,
|
||||
|
||||
@@ -16,7 +16,7 @@ import type {ImageProps, LayoutChangeEvent} from 'react-native';
|
||||
import RNTesterButton from '../../components/RNTesterButton';
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import ImageCapInsetsExample from './ImageCapInsetsExample';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {useEffect, useState} from 'react';
|
||||
import {Image, ImageBackground, StyleSheet, Text, View} from 'react-native';
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {PanResponder, ScrollView, StyleSheet, View} from 'react-native';
|
||||
|
||||
exports.displayName = 'JSResponderHandlerExample';
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import React, {useState} from 'react';
|
||||
import * as React from 'react';
|
||||
import {useState} from 'react';
|
||||
import {
|
||||
Alert,
|
||||
Button,
|
||||
|
||||
+2
-1
@@ -15,7 +15,8 @@ import type {KeyEvent, NativeSyntheticEvent} from 'react-native';
|
||||
|
||||
import RNTesterButton from '../../components/RNTesterButton';
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React, {useCallback, useState} from 'react';
|
||||
import * as React from 'react';
|
||||
import {useCallback, useState} from 'react';
|
||||
import {ScrollView, StyleSheet, TextInput, View} from 'react-native';
|
||||
|
||||
type KeyEventLog = {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {
|
||||
LayoutAnimation,
|
||||
StyleSheet,
|
||||
|
||||
@@ -17,7 +17,7 @@ import type {
|
||||
} from 'react-native/Libraries/Components/View/ViewPropTypes';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {Image, LayoutAnimation, StyleSheet, View} from 'react-native';
|
||||
|
||||
type Props = Readonly<{}>;
|
||||
|
||||
@@ -16,7 +16,7 @@ import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet';
|
||||
import RNTesterBlock from '../../components/RNTesterBlock';
|
||||
import RNTesterPage from '../../components/RNTesterPage';
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {StyleSheet, View} from 'react-native';
|
||||
|
||||
type CicleProps = Readonly<{
|
||||
|
||||
@@ -14,7 +14,7 @@ import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {Platform, PlatformColor, StyleSheet, View} from 'react-native';
|
||||
|
||||
type Props = Readonly<{
|
||||
|
||||
@@ -12,7 +12,7 @@ import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterBlock from '../../components/RNTesterBlock';
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {useState} from 'react';
|
||||
import {
|
||||
Button,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet';
|
||||
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {useState} from 'react';
|
||||
import {Image, ImageBackground, StyleSheet, Text, View} from 'react-native';
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import type AnimatedValue from 'react-native/Libraries/Animated/nodes/AnimatedVa
|
||||
import RNTesterSettingSwitchRow from '../../components/RNTesterSettingSwitchRow';
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import useJsStalls from '../../utils/useJsStalls';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Animated,
|
||||
StyleSheet,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {useEffect, useState} from 'react';
|
||||
import {DeviceEventEmitter, View} from 'react-native';
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
import type {ColorValue} from 'react-native';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Appearance,
|
||||
Button,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTexterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Alert,
|
||||
Animated,
|
||||
|
||||
@@ -14,7 +14,7 @@ import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {Platform, PlatformColor, StyleSheet, View} from 'react-native';
|
||||
|
||||
type Props = Readonly<{
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {
|
||||
RefreshControl,
|
||||
ScrollView,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {useState} from 'react';
|
||||
import {Button, DeviceInfo, Modal, StyleSheet, View} from 'react-native';
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
} from '../../components/ListExampleShared';
|
||||
import RNTesterPage from '../../components/RNTesterPage';
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {useRef, useState} from 'react';
|
||||
import {
|
||||
Alert,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {useState} from 'react';
|
||||
import {Button, Share, StyleSheet, View} from 'react-native';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Modal,
|
||||
StatusBar,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {Platform, Switch, View} from 'react-native';
|
||||
|
||||
type OnOffIndicatorProps = Readonly<{on: boolean, testID: string}>;
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
*/
|
||||
|
||||
import {RNTesterThemeContext} from '../../components/RNTesterTheme';
|
||||
import React, {useContext} from 'react';
|
||||
import * as React from 'react';
|
||||
import {useContext} from 'react';
|
||||
import {StyleSheet, TextInput} from 'react-native';
|
||||
|
||||
const ExampleTextInput: component(
|
||||
|
||||
@@ -17,7 +17,7 @@ import type {
|
||||
|
||||
import ExampleTextInput from './ExampleTextInput';
|
||||
import TextInputSharedExamples from './TextInputSharedExamples';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {useState} from 'react';
|
||||
import {StyleSheet, Text, View} from 'react-native';
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import type {KeyboardTypeOptions} from 'react-native';
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import ExampleTextInput from './ExampleTextInput';
|
||||
import TextInputSharedExamples from './TextInputSharedExamples';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {useRef} from 'react';
|
||||
import {
|
||||
Alert,
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import React, {useEffect, useState} from 'react';
|
||||
import * as React from 'react';
|
||||
import {useEffect, useState} from 'react';
|
||||
import {TextInput, View} from 'react-native';
|
||||
|
||||
function TextInputKeyProp() {
|
||||
|
||||
@@ -14,7 +14,7 @@ import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterButton from '../../components/RNTesterButton';
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {Alert, Platform, ToastAndroid, View} from 'react-native';
|
||||
|
||||
function burnCPU(milliseconds: number) {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {Pressable, StyleSheet, ToastAndroid} from 'react-native';
|
||||
|
||||
const ToastWithShortDuration = () => {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {useEffect, useRef, useState} from 'react';
|
||||
import {
|
||||
Animated,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {StyleSheet, View} from 'react-native';
|
||||
|
||||
type Props = {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Platform,
|
||||
StyleSheet,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Image,
|
||||
PixelRatio,
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import RNTOption from '../../components/RNTOption';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {Alert, StyleSheet, Text, TouchableHighlight, View} from 'react-native';
|
||||
|
||||
const BINARY_TYPES = {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
'use strict';
|
||||
|
||||
import {RNTesterThemeContext} from '../../components/RNTesterTheme';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Button,
|
||||
Platform,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
'use strict';
|
||||
|
||||
import RNTesterText from '../../components/RNTesterText';
|
||||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import {StyleSheet, Text, TouchableHighlight, View} from 'react-native';
|
||||
|
||||
class XHRExampleHeaders extends React.Component {
|
||||
|
||||
Reference in new issue
Block a user