mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Replace wrap-warning-with-env-check with an eslint plugin (#17540)
* Replace Babel plugin with an ESLint plugin * Fix ESLint rule violations * Move shared conditions higher * Test formatting nits * Tweak ESLint rule * Bugfix: inside else branch, 'if' tests are not satisfactory * Use a stricter check for exactly if (__DEV__) This makes it easier to see what's going on and matches dominant style in the codebase. * Fix remaining files after stricter check
This commit is contained in:
@@ -125,7 +125,7 @@ function getBabelConfig(updateBabelOptions, bundleType, filename) {
|
||||
// Minify invariant messages
|
||||
require('../error-codes/transform-error-messages'),
|
||||
// Wrap warning() calls in a __DEV__ check so they are stripped from production.
|
||||
require('../babel/wrap-warning-with-env-check'),
|
||||
require('../babel/lift-warning-conditional-argument'),
|
||||
]),
|
||||
});
|
||||
case RN_OSS_DEV:
|
||||
@@ -142,7 +142,7 @@ function getBabelConfig(updateBabelOptions, bundleType, filename) {
|
||||
{noMinify: true},
|
||||
],
|
||||
// Wrap warning() calls in a __DEV__ check so they are stripped from production.
|
||||
require('../babel/wrap-warning-with-env-check'),
|
||||
require('../babel/lift-warning-conditional-argument'),
|
||||
]),
|
||||
});
|
||||
case UMD_DEV:
|
||||
@@ -158,7 +158,7 @@ function getBabelConfig(updateBabelOptions, bundleType, filename) {
|
||||
// Minify invariant messages
|
||||
require('../error-codes/transform-error-messages'),
|
||||
// Wrap warning() calls in a __DEV__ check so they are stripped from production.
|
||||
require('../babel/wrap-warning-with-env-check'),
|
||||
require('../babel/lift-warning-conditional-argument'),
|
||||
]),
|
||||
});
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user