mirror of
https://github.com/facebook/react.git
synced 2026-02-25 13:13:03 +00:00
If there are any suspended fallbacks at the end of the `act` scope, force them to display by running the pending timers (i.e. `setTimeout`). The public implementation of `act` achieves the same behavior with an extra check in the work loop (`shouldForceFlushFallbacks`). Since our internal `act` needs to work in both development and production, without additional runtime checks, we instead rely on Jest's mock timers. This doesn't not affect refresh transitions, which are meant to delay indefinitely, because in that case we exit the work loop without posting a timer.
57 lines
1.1 KiB
JavaScript
57 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
module.exports = {
|
|
env: {
|
|
commonjs: true,
|
|
browser: true,
|
|
},
|
|
globals: {
|
|
// ES6
|
|
Map: true,
|
|
Set: true,
|
|
Symbol: true,
|
|
Proxy: true,
|
|
WeakMap: true,
|
|
WeakSet: true,
|
|
Uint16Array: true,
|
|
Reflect: true,
|
|
// Vendor specific
|
|
MSApp: true,
|
|
__REACT_DEVTOOLS_GLOBAL_HOOK__: true,
|
|
// FB
|
|
__DEV__: true,
|
|
// Node.js Server Rendering
|
|
setImmediate: true,
|
|
Buffer: true,
|
|
// Trusted Types
|
|
trustedTypes: true,
|
|
|
|
// Scheduler profiling
|
|
SharedArrayBuffer: true,
|
|
Int32Array: true,
|
|
ArrayBuffer: true,
|
|
|
|
TaskController: true,
|
|
|
|
// Flight
|
|
Uint8Array: true,
|
|
Promise: true,
|
|
|
|
// jest
|
|
jest: true,
|
|
},
|
|
parserOptions: {
|
|
ecmaVersion: 5,
|
|
sourceType: 'script',
|
|
},
|
|
rules: {
|
|
'no-undef': 'error',
|
|
'no-shadow-restricted-names': 'error',
|
|
},
|
|
|
|
// These plugins aren't used, but eslint complains if an eslint-ignore comment
|
|
// references unused plugins. An alternate approach could be to strip
|
|
// eslint-ignore comments as part of the build.
|
|
plugins: ['jest', 'no-for-of-loops', 'react', 'react-internal'],
|
|
};
|