Skip to content

Commit

Permalink
Lint source files, sort imports, remove unused imports (#41829)
Browse files Browse the repository at this point in the history
Summary:
This PR lints source files using eslint. I've executed `yarn lint --fix` and also manually fixed some of eslint issues.

Before:

![CleanShot 2023-12-07 at 12 07 10@2x](https://github.com/facebook/react-native/assets/52801365/2b00cf23-e5a0-46b8-802f-adcb67224111)

After:

![CleanShot 2023-12-07 at 12 06 24@2x](https://github.com/facebook/react-native/assets/52801365/bb05b2c0-2b27-4f99-b7b4-cb47a51a3885)

## Changelog:

[GENERAL] [FIXED] - Lint source files, sort imports, remove unused ones

Pull Request resolved: #41829

Test Plan: CI Green

Reviewed By: christophpurrer

Differential Revision: D51979074

Pulled By: dmytrorykun

fbshipit-source-id: e11b90721e33f5e9949a0833e5f39fe7ba3d1067
  • Loading branch information
okwasniewski authored and facebook-github-bot committed Dec 11, 2023
1 parent 6b532c7 commit 7d1a98c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 24 deletions.
4 changes: 2 additions & 2 deletions packages/dev-middleware/src/inspector-proxy/Device.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @oncall react_native
*/

import type {EventReporter} from '../types/EventReporter';
import type {
DebuggerRequest,
ErrorResponse,
Expand All @@ -22,10 +23,9 @@ import type {

import DeviceEventReporter from './DeviceEventReporter';
import * as fs from 'fs';
import * as path from 'path';
import fetch from 'node-fetch';
import * as path from 'path';
import WS from 'ws';
import type {EventReporter} from '../types/EventReporter';

const debug = require('debug')('Metro:InspectorProxy');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ import type {PlatformConfig} from '../AnimatedPlatformConfig';
import type AnimatedNode from '../nodes/AnimatedNode';
import type AnimatedValue from '../nodes/AnimatedValue';

import Platform from '../../Utilities/Platform';
import NativeAnimatedHelper from '../NativeAnimatedHelper';
import AnimatedColor from '../nodes/AnimatedColor';
import AnimatedProps from '../nodes/AnimatedProps';
import AnimatedValueXY from '../nodes/AnimatedValueXY';

export type EndResult = {finished: boolean, value?: number, ...};
export type EndCallback = (result: EndResult) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* @flow strict
*/

import type {ArrayLike} from './ArrayLikeUtils';
import type DOMRectReadOnly from '../Geometry/DOMRectReadOnly';
import type {ArrayLike} from './ArrayLikeUtils';

declare export default class DOMRectList
implements Iterable<DOMRectReadOnly>, ArrayLike<DOMRectReadOnly>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

'use strict';

import type {Spec as FabricUIManagerSpec} from '../ReactNative/FabricUIManager';
import type {
LayoutAnimationConfig as LayoutAnimationConfig_,
LayoutAnimationProperty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,16 @@ const onScrollToIndexFailed = (info: {
*/
};

// $FlowFixMe[missing-local-annot]
const ItemSeparatorComponent = info => (
<CustomSeparatorComponent {...info} text="ITEM SEPARATOR" />
);

// $FlowFixMe[missing-local-annot]
const SectionSeparatorComponent = info => (
<CustomSeparatorComponent {...info} text="SECTION SEPARATOR" />
);

export function SectionList_scrollable(Props: {
...
}): React.Element<typeof RNTesterPage> {
Expand Down Expand Up @@ -280,14 +290,8 @@ export function SectionList_scrollable(Props: {
ref={ref}
ListHeaderComponent={HeaderComponent}
ListFooterComponent={FooterComponent}
// $FlowFixMe[missing-local-annot]
SectionSeparatorComponent={info => (
<CustomSeparatorComponent {...info} text="SECTION SEPARATOR" />
)}
// $FlowFixMe[missing-local-annot]
ItemSeparatorComponent={info => (
<CustomSeparatorComponent {...info} text="ITEM SEPARATOR" />
)}
SectionSeparatorComponent={SectionSeparatorComponent}
ItemSeparatorComponent={ItemSeparatorComponent}
accessibilityRole="list"
debug={debug}
inverted={inverted}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ const styles = StyleSheet.create({
},
});

const examples: Array<RNTesterModuleExample> = [
const textInputExamples: Array<RNTesterModuleExample> = [
...TextInputSharedExamples,
{
title: 'Live Re-Write (ひ -> 日)',
Expand Down Expand Up @@ -944,5 +944,5 @@ module.exports = ({
documentationURL: 'https://reactnative.dev/docs/textinput',
category: 'Basic',
description: 'Single and multi-line text inputs.',
examples,
examples: textInputExamples,
}: RNTesterModule);
13 changes: 6 additions & 7 deletions scripts/test-e2e-local.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@
* and to make it more accessible for other devs to play around with.
*/

const {exec, pushd, popd, pwd, cd, sed} = require('shelljs');
const updateTemplatePackage = require('./update-template-package');
const yargs = require('yargs');
const path = require('path');

const {
checkPackagerRunning,
maybeLaunchAndroidEmulator,
launchPackagerInSeparateWindow,
setupCircleCIArtifacts,
maybeLaunchAndroidEmulator,
prepareArtifacts,
setupCircleCIArtifacts,
} = require('./testing-utils');
const updateTemplatePackage = require('./update-template-package');
const path = require('path');
const {cd, exec, popd, pushd, pwd, sed} = require('shelljs');
const yargs = require('yargs');

const argv = yargs
.option('t', {
Expand Down

0 comments on commit 7d1a98c

Please sign in to comment.