Skip to content

Commit ee2bea1

Browse files
authored
chore: sort member in imports (#8846)
1 parent 9ba4594 commit ee2bea1

File tree

90 files changed

+264
-274
lines changed

Some content is hidden

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

90 files changed

+264
-274
lines changed

.eslintrc.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
extends: [
1010
'./packages/eslint-config-fb-strict/index.js',
1111
'plugin:import/errors',
12+
'plugin:import/typescript',
1213
'prettier',
1314
'prettier/flowtype',
1415
],
@@ -18,12 +19,14 @@ module.exports = {
1819
parser: '@typescript-eslint/parser',
1920
plugins: ['@typescript-eslint/eslint-plugin'],
2021
rules: {
21-
'@typescript-eslint/array-type': ['error', 'generic'],
22+
'@typescript-eslint/array-type': ['error', {default: 'generic'}],
2223
'@typescript-eslint/ban-types': 'error',
2324
'@typescript-eslint/no-unused-vars': [
2425
'error',
2526
{argsIgnorePattern: '^_'},
2627
],
28+
// Since we do `export =`. Remove for Jest 25
29+
'import/default': 'off',
2730
'import/order': 'error',
2831
'no-dupe-class-members': 'off',
2932
'no-unused-vars': 'off',
@@ -108,10 +111,6 @@ module.exports = {
108111
'no-console': 0,
109112
'no-unused-vars': 2,
110113
'prettier/prettier': 2,
111-
},
112-
settings: {
113-
'import/resolver': {
114-
'eslint-import-resolver-typescript': true,
115-
},
114+
'sort-imports': [2, {ignoreDeclarationSort: true}],
116115
},
117116
};

docs/TutorialReact.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ export default class CheckboxWithLabel extends React.Component {
253253
```javascript
254254
// __tests__/CheckboxWithLabel-test.js
255255
import React from 'react';
256-
import {render, fireEvent, cleanup} from '@testing-library/react';
256+
import {cleanup, fireEvent, render} from '@testing-library/react';
257257
import CheckboxWithLabel from '../CheckboxWithLabel';
258258

259259
// automatically unmount and cleanup DOM after the test is finished.

e2e/Utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import * as fs from 'fs';
1010
import * as path from 'path';
1111
import {Config} from '@jest/types';
1212

13-
import {sync as spawnSync, ExecaReturns} from 'execa';
13+
import {ExecaReturns, sync as spawnSync} from 'execa';
1414
import {createDirectory} from 'jest-util';
1515
import rimraf from 'rimraf';
1616

examples/react-testing-library/__tests__/CheckboxWithLabel-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2004-present Facebook. All Rights Reserved.
22

33
import React from 'react';
4-
import {render, fireEvent, cleanup} from '@testing-library/react';
4+
import {cleanup, fireEvent, render} from '@testing-library/react';
55
import CheckboxWithLabel from '../CheckboxWithLabel';
66

77
// automatically unmount and cleanup DOM after the test is finished.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"@types/babel__template": "^7.0.0",
1515
"@types/jest": "24.0.2",
1616
"@types/node": "*",
17-
"@typescript-eslint/eslint-plugin": "^1.10.2",
18-
"@typescript-eslint/parser": "^1.10.2",
17+
"@typescript-eslint/eslint-plugin": "^2.0.0",
18+
"@typescript-eslint/parser": "^2.0.0",
1919
"ansi-regex": "^4.0.0",
2020
"ansi-styles": "^3.2.0",
2121
"babel-eslint": "^10.0.2",
@@ -28,7 +28,6 @@
2828
"debug": "^4.0.1",
2929
"eslint": "^5.6.0",
3030
"eslint-config-prettier": "^5.0.0",
31-
"eslint-import-resolver-typescript": "^1.1.1",
3231
"eslint-plugin-babel": "^5.1.0",
3332
"eslint-plugin-flowtype": "^2.35.0",
3433
"eslint-plugin-import": "^2.6.0",

packages/babel-jest/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import * as path from 'path';
1111
import {Transformer} from '@jest/transform';
1212
import {Config} from '@jest/types';
1313
import {
14-
loadPartialConfig,
1514
PartialConfig,
1615
TransformOptions,
1716
transformSync as babelTransform,
17+
loadPartialConfig,
1818
} from '@babel/core';
1919
import chalk from 'chalk';
2020
import slash from 'slash';

packages/expect/src/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
import * as matcherUtils from 'jest-matcher-utils';
1010
import {
1111
AsyncExpectationResult,
12-
SyncExpectationResult,
12+
Expect,
1313
ExpectationResult,
14-
Matchers as MatcherInterface,
1514
MatcherState as JestMatcherState,
15+
Matchers as MatcherInterface,
1616
MatchersObject,
17+
PromiseMatcherFn,
1718
RawMatcherFn,
19+
SyncExpectationResult,
1820
ThrowingMatcherFn,
19-
PromiseMatcherFn,
20-
Expect,
2121
} from './types';
2222

2323
import {iterableEquality, subsetEquality} from './utils';
@@ -35,16 +35,16 @@ import {
3535
objectContaining,
3636
objectNotContaining,
3737
stringContaining,
38-
stringNotContaining,
3938
stringMatching,
39+
stringNotContaining,
4040
stringNotMatching,
4141
} from './asymmetricMatchers';
4242
import {
4343
INTERNAL_MATCHER_FLAG,
44-
getState,
45-
setState,
4644
getMatchers,
45+
getState,
4746
setMatchers,
47+
setState,
4848
} from './jestMatchersObject';
4949
import extractExpectedAssertionsErrors from './extractExpectedAssertionsErrors';
5050

packages/expect/src/matchers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import getType, {isPrimitive} from 'jest-get-type';
1010
import {
1111
DIM_COLOR,
1212
EXPECTED_COLOR,
13+
MatcherHintOptions,
1314
RECEIVED_COLOR,
1415
SUGGEST_TO_CONTAIN_EQUAL,
1516
ensureExpectedIsNonNegativeInteger,
@@ -19,13 +20,12 @@ import {
1920
matcherErrorMessage,
2021
matcherHint,
2122
printDiffOrStringify,
22-
printReceived,
2323
printExpected,
24+
printReceived,
2425
printWithType,
2526
stringify,
26-
MatcherHintOptions,
2727
} from 'jest-matcher-utils';
28-
import {MatchersObject, MatcherState} from './types';
28+
import {MatcherState, MatchersObject} from './types';
2929
import {
3030
printExpectedConstructorName,
3131
printExpectedConstructorNameNot,

packages/expect/src/spyMatchers.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@
77

88
import getType, {isPrimitive} from 'jest-get-type';
99
import {
10+
DIM_COLOR,
11+
EXPECTED_COLOR,
12+
MatcherHintOptions,
13+
RECEIVED_COLOR,
1014
diff,
1115
ensureExpectedIsNumber,
1216
ensureNoExpected,
13-
DIM_COLOR,
14-
EXPECTED_COLOR,
1517
matcherErrorMessage,
1618
matcherHint,
17-
MatcherHintOptions,
1819
printExpected,
1920
printReceived,
2021
printWithType,
21-
RECEIVED_COLOR,
2222
stringify,
2323
} from 'jest-matcher-utils';
24-
import {MatchersObject, MatcherState, SyncExpectationResult} from './types';
24+
import {MatcherState, MatchersObject, SyncExpectationResult} from './types';
2525
import {equals} from './jasmineUtils';
2626
import {iterableEquality} from './utils';
2727

packages/expect/src/toThrowMatchers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
import {formatStackTrace, separateMessageFromStack} from 'jest-message-util';
1010
import {
1111
EXPECTED_COLOR,
12+
MatcherHintOptions,
1213
RECEIVED_COLOR,
1314
matcherErrorMessage,
1415
matcherHint,
1516
printDiffOrStringify,
1617
printExpected,
1718
printReceived,
1819
printWithType,
19-
MatcherHintOptions,
2020
} from 'jest-matcher-utils';
2121
import {
2222
printExpectedConstructorName,
@@ -27,8 +27,8 @@ import {
2727
printReceivedStringContainExpectedSubstring,
2828
} from './print';
2929
import {
30-
MatchersObject,
3130
MatcherState,
31+
MatchersObject,
3232
RawMatcherFn,
3333
SyncExpectationResult,
3434
} from './types';

0 commit comments

Comments
 (0)