Skip to content

Commit 5816a57

Browse files
authored
remove flow leftovers (#8213)
1 parent 7698986 commit 5816a57

File tree

13 files changed

+3
-20
lines changed

13 files changed

+3
-20
lines changed

.circleci/config.yml

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ jobs:
2626
- restore-cache: *restore-cache
2727
- run: yarn --no-progress --frozen-lockfile
2828
- save-cache: *save-cache
29-
- run: echo server.max_workers=1 >> .flowconfig
3029
- run: yarn lint --format junit -o reports/junit/js-lint-results.xml && yarn lint-es5-build --format junit -o reports/junit/js-es5-lint-results.xml && yarn lint:md:ci && yarn check-copyright-headers
3130
- store_test_results:
3231
path: reports/junit

e2e/__tests__/__snapshots__/moduleNameMapper.test.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ FAIL __tests__/index.js
3030
12 | module.exports = () => 'test';
3131
13 |
3232
33-
at createNoMappedModuleFoundError (../../packages/jest-resolve/build/index.js:474:17)
33+
at createNoMappedModuleFoundError (../../packages/jest-resolve/build/index.js:473:17)
3434
at Object.require (index.js:10:1)
3535
`;

e2e/__tests__/__snapshots__/resolveNoFileExtensions.test.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ FAIL __tests__/test.js
3333
| ^
3434
4 |
3535
36-
at Resolver.resolveModule (../../packages/jest-resolve/build/index.js:232:17)
36+
at Resolver.resolveModule (../../packages/jest-resolve/build/index.js:231:17)
3737
at Object.require (index.js:3:18)
3838
`;

packages/expect/src/jasmineUtils.ts

-4
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ function asymmetricMatch(a: any, b: any) {
5050
}
5151

5252
if (asymmetricA) {
53-
// $FlowFixMe – Flow sees `a` as a number
5453
return a.asymmetricMatch(b);
5554
}
5655

@@ -103,7 +102,6 @@ function eq(
103102
case '[object String]':
104103
// Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
105104
// equivalent to `new String("5")`.
106-
// $FlowFixMe – Flow sees `a` as a number
107105
return a == String(b);
108106
case '[object Number]':
109107
return Object.is(Number(a), Number(b));
@@ -119,7 +117,6 @@ function eq(
119117
a.source == b.source &&
120118
a.global == b.global &&
121119
a.multiline == b.multiline &&
122-
// $FlowFixMe – Flow sees `a` as a number
123120
a.ignoreCase == b.ignoreCase
124121
);
125122
}
@@ -210,7 +207,6 @@ function keys(
210207
}
211208
return keys.concat(
212209
(Object.getOwnPropertySymbols(o) as Array<any>).filter(
213-
//$FlowFixMe Jest complains about nullability, but we know for sure that property 'symbol' does exist.
214210
symbol =>
215211
(Object.getOwnPropertyDescriptor(o, symbol) as any).enumerable,
216212
),

packages/jest-cli/src/init/__tests__/init.test.js

-4
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,13 @@ const consoleLog = console.log;
2525

2626
describe('init', () => {
2727
beforeEach(() => {
28-
// $FlowFixMe mock console.log to reduce noise from the tests
2928
console.log = jest.fn();
30-
// $FlowFixMe mock
3129
fs.writeFileSync = jest.fn();
3230
});
3331

3432
afterEach(() => {
3533
jest.clearAllMocks();
36-
// $FlowFixMe
3734
console.log = consoleLog;
38-
// $FlowFixMe mock
3935
fs.writeFileSync = writeFileSync;
4036
});
4137

packages/jest-config/src/setFromArgv.ts

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export default function setFromArgv(
1414
options: Config.InitialOptions,
1515
argv: Config.Argv,
1616
): Config.InitialOptions {
17-
// $FlowFixMe: Seems like flow doesn't approve of string values
1817
const argvToOptions = Object.keys(argv)
1918
.filter(key => argv[key] !== undefined && specialArgs.indexOf(key) === -1)
2019
.reduce((options: {[key: string]: unknown}, key) => {

packages/jest-jasmine2/src/assertionErrorMessage.ts

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ const getOperatorName = (operator: string | null, stack: string) => {
4747

4848
const operatorMessage = (operator: string | null) => {
4949
const niceOperatorName = getOperatorName(operator, '');
50-
// $FlowFixMe: we default to the operator itself, so holes in the map doesn't matter
5150
const humanReadableOperator = humanReadableOperators[niceOperatorName];
5251

5352
return typeof operator === 'string'

packages/jest-jasmine2/src/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ async function jasmine2(
127127
if (globalConfig.errorOnDeprecated) {
128128
installErrorOnPrivate(environment.global);
129129
} else {
130-
// $FlowFixMe Flow seems to be confused about accessors and tries to enforce having a `value` property.
131130
Object.defineProperty(jasmine, 'DEFAULT_TIMEOUT_INTERVAL', {
132131
configurable: true,
133132
enumerable: true,

packages/jest-jasmine2/src/setup_jest_globals.ts

-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ export default ({
105105
expand,
106106
getBabelTraverse: () => require('@babel/traverse').default,
107107
getPrettier: () =>
108-
// $FlowFixMe dynamic require
109108
config.prettierPath ? require(config.prettierPath) : null,
110109
updateSnapshot,
111110
});

packages/jest-resolve/src/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ class Resolver {
8383
options: FindNodeModuleConfig,
8484
): Config.Path | null {
8585
const resolver = options.resolver
86-
? /* $FlowFixMe */
87-
require(options.resolver)
86+
? require(options.resolver)
8887
: defaultResolver;
8988
const paths = options.paths;
9089

packages/jest-util/src/deepCyclicCopy.ts

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ function deepCyclicCopyObject<T>(
5454
? Object.create(Object.getPrototypeOf(object))
5555
: {};
5656

57-
// $FlowFixMe: Object.getOwnPropertyDescriptors is polyfilled above.
5857
const descriptors = Object.getOwnPropertyDescriptors(object);
5958

6059
cycles.set(object, newObject);

packages/jest-worker/src/WorkerPool.ts

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818

1919
const canUseWorkerThreads = () => {
2020
try {
21-
// $FlowFixMe: Flow doesn't know about experimental APIs
2221
require('worker_threads');
2322
return true;
2423
} catch (_) {

packages/jest-worker/src/workers/processChild.ts

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ function reportError(error: Error, type: PARENT_MESSAGE_ERROR) {
8888
error.constructor && error.constructor.name,
8989
error.message,
9090
error.stack,
91-
// $FlowFixMe: this is safe to just inherit from Object.
9291
typeof error === 'object' ? {...error} : error,
9392
]);
9493
}

0 commit comments

Comments
 (0)