mirror of
https://github.com/facebook/react.git
synced 2026-02-24 20:53:03 +00:00
* Add Node ESM loader build This adds a loader build as a first-class export. This will grow in complexity so it deserves its own module. * Add Node CommonJS regiter build This adds a build as a first-class export for legacy CommonJS registration in Node.js. This will grow in complexity so it deserves its own module. * Simplify fixture a bit to easier show usage with or without esm * Bump es version We leave async function in here which are newer than ES2015.
61 lines
1.2 KiB
JavaScript
61 lines
1.2 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,
|
|
|
|
TaskController: true,
|
|
|
|
// Flight
|
|
Uint8Array: true,
|
|
Promise: true,
|
|
|
|
// Flight Webpack
|
|
__webpack_chunk_load__: true,
|
|
__webpack_require__: true,
|
|
|
|
// jest
|
|
expect: true,
|
|
jest: true,
|
|
},
|
|
parserOptions: {
|
|
ecmaVersion: 2017,
|
|
sourceType: 'module',
|
|
},
|
|
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'],
|
|
};
|