mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +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:
1 parent
acfe4b21b2
commit
b43eec7eaa
35 files changed
+933
-550
No files matched your search
@@ -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