Skip to content

Commit 4127714

Browse files
motiz88facebook-github-bot
authored andcommitted
Apply sort-imports lint rule to all files
Summary: Changelog: [Internal] Reviewed By: robhogan Differential Revision: D51946975 fbshipit-source-id: e31c7ccf68f6a6aa4b9fdc154d0d7e4712935d6c
1 parent e0b0c88 commit 4127714

File tree

77 files changed

+157
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+157
-153
lines changed

packages/metro-cache/src/stores/HttpGetStore.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
'use strict';
1212

13-
import type {HttpOptions} from 'metro-cache';
1413
import type HttpError from './HttpError';
1514
import type NetworkError from './NetworkError';
15+
import type {HttpOptions} from 'metro-cache';
1616

1717
const HttpStore = require('./HttpStore');
1818
const {Logger} = require('metro-core');

packages/metro-config/src/configTypes.flow.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,22 @@
1010

1111
'use strict';
1212

13+
import type {IntermediateStackFrame} from '../../metro/src/Server/symbolicate';
1314
import type {HandleFunction, Server} from 'connect';
1415
import type {CacheStore} from 'metro-cache';
1516
import typeof MetroCache from 'metro-cache';
1617
import type {CacheManagerFactory} from 'metro-file-map';
1718
import type {CustomResolver} from 'metro-resolver';
1819
import type {JsTransformerConfig} from 'metro-transform-worker';
1920
import type {TransformResult} from 'metro/src/DeltaBundler';
20-
import type MetroServer from 'metro/src/Server';
21-
2221
import type {
2322
DeltaResult,
2423
Module,
2524
ReadOnlyGraph,
2625
SerializerOptions,
2726
} from 'metro/src/DeltaBundler/types.flow.js';
2827
import type {Reporter} from 'metro/src/lib/reporting';
29-
import type {IntermediateStackFrame} from '../../metro/src/Server/symbolicate';
28+
import type MetroServer from 'metro/src/Server';
3029

3130
export type ExtraTransformOptions = {
3231
+preloadedModules?: {[path: string]: true, ...} | false,

packages/metro-config/src/defaults/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ import type {ConfigT} from '../configTypes.flow';
1515

1616
const {
1717
DEFAULT_METRO_MINIFIER_PATH,
18+
additionalExts,
1819
assetExts,
1920
assetResolutions,
20-
additionalExts,
2121
defaultCreateModuleIdFactory,
22+
noopPerfLoggerFactory,
2223
platforms,
2324
sourceExts,
24-
noopPerfLoggerFactory,
2525
} = require('./defaults');
2626
const exclusionList = require('./exclusionList');
2727
const {FileStore} = require('metro-cache');

packages/metro-file-map/src/Watcher.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ import type {
2020
import type {WatcherOptions as WatcherBackendOptions} from './watchers/common';
2121
import type {AbortSignal} from 'node-abort-controller';
2222

23-
import watchmanCrawl from './crawlers/watchman';
2423
import nodeCrawl from './crawlers/node';
25-
import WatchmanWatcher from './watchers/WatchmanWatcher';
24+
import watchmanCrawl from './crawlers/watchman';
25+
import {ADD_EVENT, CHANGE_EVENT} from './watchers/common';
2626
import FSEventsWatcher from './watchers/FSEventsWatcher';
2727
import NodeWatcher from './watchers/NodeWatcher';
28-
import * as path from 'path';
29-
import * as fs from 'fs';
30-
import {ADD_EVENT, CHANGE_EVENT} from './watchers/common';
28+
import WatchmanWatcher from './watchers/WatchmanWatcher';
3129
import EventEmitter from 'events';
32-
import {performance} from 'perf_hooks';
30+
import * as fs from 'fs';
3331
import nullthrows from 'nullthrows';
32+
import * as path from 'path';
33+
import {performance} from 'perf_hooks';
3434

3535
const debug = require('debug')('Metro:Watcher');
3636

packages/metro-file-map/src/crawlers/__tests__/node-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
* @oncall react_native
99
*/
1010

11-
import {AbortController} from 'node-abort-controller';
1211
import TreeFS from '../../lib/TreeFS';
12+
import {AbortController} from 'node-abort-controller';
1313

1414
jest.useRealTimers();
1515

packages/metro-file-map/src/crawlers/__tests__/watchman-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
* @oncall react_native
99
*/
1010

11-
import {AbortController} from 'node-abort-controller';
1211
import TreeFS from '../../lib/TreeFS';
12+
import {AbortController} from 'node-abort-controller';
1313

1414
const path = require('path');
1515

packages/metro-file-map/src/crawlers/node/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import type {
1616
IgnoreMatcher,
1717
} from '../../flow-types';
1818

19-
import hasNativeFindSupport from './hasNativeFindSupport';
2019
import * as fastPath from '../../lib/fast_path';
20+
import hasNativeFindSupport from './hasNativeFindSupport';
2121
import {spawn} from 'child_process';
2222
import * as fs from 'graceful-fs';
2323
import {platform} from 'os';

packages/metro-file-map/src/crawlers/watchman/__tests__/index-test.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111

1212
import type {CrawlerOptions} from '../../../flow-types';
13+
1314
import TreeFS from '../../../lib/TreeFS';
1415
import watchmanCrawl from '../index';
1516
import EventEmitter from 'events';

packages/metro-file-map/src/flow-types.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
'use strict';
1313

14-
import type {PerfLoggerFactory, RootPerfLogger, PerfLogger} from 'metro-config';
14+
import type {PerfLogger, PerfLoggerFactory, RootPerfLogger} from 'metro-config';
1515
import type {AbortSignal} from 'node-abort-controller';
1616

1717
export type {PerfLoggerFactory, PerfLogger};

packages/metro-file-map/src/index.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* @oncall react_native
1010
*/
1111

12-
import type {IJestWorker} from 'jest-worker';
1312
import type {
1413
BuildParameters,
1514
BuildResult,
@@ -19,44 +18,45 @@ import type {
1918
CanonicalPath,
2019
ChangeEvent,
2120
ChangeEventMetadata,
22-
CrawlerOptions,
2321
Console,
22+
CrawlerOptions,
2423
EventsQueue,
2524
FileData,
2625
FileMetaData,
2726
FileSystem,
28-
HType,
2927
HasteMapData,
3028
HasteMapItem,
29+
HType,
3130
MutableFileSystem,
3231
Path,
33-
PerfLoggerFactory,
3432
PerfLogger,
33+
PerfLoggerFactory,
3534
RawMockMap,
3635
ReadOnlyRawMockMap,
37-
WorkerMetadata,
3836
WatchmanClocks,
37+
WorkerMetadata,
3938
} from './flow-types';
39+
import type {IJestWorker} from 'jest-worker';
4040

4141
import {DiskCacheManager} from './cache/DiskCacheManager';
4242
import H from './constants';
4343
import getMockName from './getMockName';
4444
import checkWatchmanCapabilities from './lib/checkWatchmanCapabilities';
4545
import {DuplicateError} from './lib/DuplicateError';
4646
import * as fastPath from './lib/fast_path';
47+
import MockMapImpl from './lib/MockMap';
48+
import MutableHasteMap from './lib/MutableHasteMap';
4749
import normalizePathSeparatorsToSystem from './lib/normalizePathSeparatorsToSystem';
4850
import TreeFS from './lib/TreeFS';
49-
import MutableHasteMap from './lib/MutableHasteMap';
5051
import {Watcher} from './Watcher';
5152
import {worker} from './worker';
5253
import EventEmitter from 'events';
5354
import invariant from 'invariant';
5455
import {Worker} from 'jest-worker';
55-
import * as path from 'path';
5656
import {AbortController} from 'node-abort-controller';
57-
import {performance} from 'perf_hooks';
5857
import nullthrows from 'nullthrows';
59-
import MockMapImpl from './lib/MockMap';
58+
import * as path from 'path';
59+
import {performance} from 'perf_hooks';
6060

6161
const debug = require('debug')('Metro:FileMap');
6262

packages/metro-file-map/src/lib/MockMap.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111

1212
import type {MockMap as IMockMap, Path, RawMockMap} from '../flow-types';
13+
1314
import {resolve} from './fast_path';
1415

1516
export default class MockMap implements IMockMap {

packages/metro-file-map/src/lib/MutableHasteMap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import type {
1313
Console,
1414
DuplicatesIndex,
1515
DuplicatesSet,
16-
HTypeValue,
1716
HasteMap,
1817
HasteMapItem,
1918
HasteMapItemMetaData,
19+
HTypeValue,
2020
Path,
2121
RawHasteMap,
2222
ReadOnlyRawHasteMap,

packages/metro-file-map/src/lib/__tests__/TreeFS-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* @oncall react_native
1010
*/
1111

12-
import type TreeFS from '../TreeFS';
1312
import type {FileData} from '../../flow-types';
13+
import type TreeFS from '../TreeFS';
1414

1515
let mockPathModule;
1616
jest.mock('path', () => mockPathModule);

packages/metro-file-map/src/lib/__tests__/rootRelativeCacheKeys-test.js

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*/
1010

1111
import type {BuildParameters} from '../../flow-types';
12-
1312
import typeof PathModule from 'path';
1413

1514
import rootRelativeCacheKeys from '../rootRelativeCacheKeys';

packages/metro-file-map/src/watchers/FSEventsWatcher.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ import type {Stats} from 'fs';
1313
// $FlowFixMe[cannot-resolve-module] - Optional, Darwin only
1414
import type {FSEvents} from 'fsevents';
1515

16+
import {isIncluded, typeFromStat} from './common';
1617
// $FlowFixMe[untyped-import] - anymatch
1718
import anymatch from 'anymatch';
1819
import EventEmitter from 'events';
1920
import {promises as fsPromises} from 'fs';
2021
import * as path from 'path';
2122
// $FlowFixMe[untyped-import] - walker
2223
import walker from 'walker';
23-
import {isIncluded, typeFromStat} from './common';
2424

2525
const debug = require('debug')('Metro:FSEventsWatcher');
2626

packages/metro-file-map/src/watchers/NodeWatcher.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
'use strict';
1717

18-
import type {WatcherOptions} from './common';
1918
import type {ChangeEventMetadata} from '../flow-types';
19+
import type {WatcherOptions} from './common';
2020
import type {FSWatcher, Stats} from 'fs';
2121

2222
const common = require('./common');

packages/metro-file-map/src/watchers/WatchmanWatcher.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
* @oncall react_native
1010
*/
1111

12-
import type {WatcherOptions} from './common';
1312
import type {ChangeEventMetadata} from '../flow-types';
13+
import type {WatcherOptions} from './common';
1414
import type {
1515
Client,
1616
WatchmanClockResponse,
1717
WatchmanFileChange,
1818
WatchmanQuery,
19-
WatchmanSubscriptionEvent,
2019
WatchmanSubscribeResponse,
20+
WatchmanSubscriptionEvent,
2121
WatchmanWatchResponse,
2222
} from 'fb-watchman';
2323

packages/metro-file-map/src/watchers/__tests__/WatchmanWatcher-test.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
*/
1111

1212
import type {
13-
WatchmanSubscribeResponse,
1413
WatchmanClockResponse,
14+
WatchmanSubscribeResponse,
1515
WatchmanWatchResponse,
1616
} from 'fb-watchman';
17+
1718
import WatchmanWatcher from '../WatchmanWatcher';
1819
import EventEmitter from 'events';
1920

packages/metro-file-map/src/watchers/__tests__/helpers.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
* @oncall react_native
1010
*/
1111

12+
import type {ChangeEventMetadata} from '../../flow-types';
1213
import type {WatcherOptions} from '../common';
1314

14-
import NodeWatcher from '../NodeWatcher';
1515
import FSEventsWatcher from '../FSEventsWatcher';
16+
import NodeWatcher from '../NodeWatcher';
1617
import WatchmanWatcher from '../WatchmanWatcher';
17-
import type {ChangeEventMetadata} from '../../flow-types';
18-
import {promises as fsPromises} from 'fs';
1918
import {execSync} from 'child_process';
20-
import {join} from 'path';
21-
import os from 'os';
19+
import {promises as fsPromises} from 'fs';
2220
import invariant from 'invariant';
21+
import os from 'os';
22+
import {join} from 'path';
2323

2424
jest.useRealTimers();
2525

packages/metro-file-map/src/watchers/__tests__/integration-test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
* @oncall react_native
1010
*/
1111

12-
import type {EventHelpers} from './helpers';
1312
import type {WatcherOptions} from '../common';
13+
import type {EventHelpers} from './helpers';
1414

1515
import FSEventsWatcher from '../FSEventsWatcher';
16-
import {createTempWatchRoot, startWatching, WATCHERS} from './helpers';
17-
import os from 'os';
16+
import {WATCHERS, createTempWatchRoot, startWatching} from './helpers';
1817
import {promises as fsPromises} from 'fs';
18+
import os from 'os';
1919
import {join} from 'path';
2020
const {mkdir, writeFile, rm, symlink, unlink} = fsPromises;
2121

packages/metro-file-map/src/worker.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const H = require('./constants');
1818
const dependencyExtractor = require('./lib/dependencyExtractor');
1919
const excludedExtensions = require('./workerExclusionList');
2020
const {createHash} = require('crypto');
21-
const fs = require('graceful-fs');
2221
const {promises: fsPromises} = require('fs');
22+
const fs = require('graceful-fs');
2323
const path = require('path');
2424

2525
const PACKAGE_JSON = path.sep + 'package.json';

packages/metro-resolver/src/PackageExportsResolve.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ import type {
1717
ResolutionContext,
1818
} from './types';
1919

20-
import path from 'path';
2120
import InvalidPackageConfigurationError from './errors/InvalidPackageConfigurationError';
2221
import PackagePathNotExportedError from './errors/PackagePathNotExportedError';
2322
import resolveAsset from './resolveAsset';
2423
import isAssetFile from './utils/isAssetFile';
2524
import toPosixPath from './utils/toPosixPath';
25+
import path from 'path';
2626

2727
/**
2828
* Resolve a package subpath based on the entry points defined in the package's

packages/metro-resolver/src/PackageResolve.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
import type {PackageInfo, PackageJson, ResolutionContext} from './types';
1313

14-
import path from 'path';
1514
import toPosixPath from './utils/toPosixPath';
15+
import path from 'path';
1616

1717
/**
1818
* Resolve the main entry point subpath for a package.

packages/metro-resolver/src/__tests__/assets-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
'use strict';
1313

14-
import path from 'path';
1514
import Resolver from '../index';
1615
import {createResolutionContext} from './utils';
16+
import path from 'path';
1717

1818
describe('asset resolutions', () => {
1919
const baseContext = {

packages/metro-resolver/src/__tests__/index-test.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313

1414
import type {ResolutionContext} from '../index';
1515

16+
import {createResolutionContext} from './utils';
17+
1618
const FailedToResolvePathError = require('../errors/FailedToResolvePathError');
1719
const Resolver = require('../index');
18-
import {createResolutionContext} from './utils';
1920

2021
const fileMap = {
2122
'/root/project/foo.js': '',

packages/metro-resolver/src/__tests__/package-exports-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
* @oncall react_native
1010
*/
1111

12-
import path from 'path';
1312
import Resolver from '../index';
1413
import {createPackageAccessors, createResolutionContext} from './utils';
14+
import path from 'path';
1515

1616
// Tests validating Package Exports resolution behaviour. See RFC0534:
1717
// https://github.com/react-native-community/discussions-and-proposals/blob/master/proposals/0534-metro-package-exports-support.md

packages/metro-resolver/src/__tests__/platform-extensions-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
import type {ResolutionContext} from '../index';
1313

14-
import Resolver from '../index';
1514
import FailedToResolvePathError from '../errors/FailedToResolvePathError';
15+
import Resolver from '../index';
1616
import {createResolutionContext} from './utils';
1717

1818
const fileMap = {

0 commit comments

Comments
 (0)