mirror of
https://github.com/zebrajr/react.git
synced 2025-12-07 00:20:28 +01:00
* Implement component stack extraction hack * Normalize errors in tests This drops the requirement to include owner to pass the test. * Special case tests * Add destructuring to force toObject which throws before the side-effects This ensures that we don't double call yieldValue or advanceTime in tests. Ideally we could use empty destructuring but ES lint doesn't like it. * Cache the result in DEV In DEV it's somewhat likely that we'll see many logs that add component stacks. This could be slow so we cache the results of previous components. * Fixture * Add Reflect to lint * Log if out of range. * Fix special case when the function call throws in V8 In V8 we need to ignore the first line. Normally we would never get there because the stacks would differ before that, but the stacks are the same if we end up throwing at the same place as the control.
55 lines
1.1 KiB
JavaScript
55 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
module.exports = {
|
|
env: {
|
|
commonjs: true,
|
|
browser: true,
|
|
},
|
|
globals: {
|
|
// ES 6
|
|
Map: true,
|
|
Set: true,
|
|
Proxy: true,
|
|
Symbol: true,
|
|
WeakMap: true,
|
|
WeakSet: true,
|
|
Uint16Array: true,
|
|
Reflect: true,
|
|
// Vendor specific
|
|
MSApp: true,
|
|
__REACT_DEVTOOLS_GLOBAL_HOOK__: true,
|
|
// CommonJS / Node
|
|
process: true,
|
|
setImmediate: true,
|
|
Buffer: true,
|
|
// Trusted Types
|
|
trustedTypes: true,
|
|
|
|
// Scheduler profiling
|
|
SharedArrayBuffer: true,
|
|
Int32Array: true,
|
|
ArrayBuffer: true,
|
|
|
|
// Flight
|
|
Uint8Array: true,
|
|
Promise: true,
|
|
|
|
// Flight Webpack
|
|
__webpack_chunk_load__: true,
|
|
__webpack_require__: 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'],
|
|
};
|