mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Update prettier (#13205)
* Update Prettier to 1.13.7 * Apply Prettier changes * Pin prettier version * EOL
This commit is contained in:
committed by
Dan Abramov
parent
6d3e262880
commit
9f78913b20
@@ -6,6 +6,7 @@ module.exports = {
|
||||
jsxBracketSameLine: true,
|
||||
trailingComma: 'es5',
|
||||
printWidth: 80,
|
||||
parser: 'babylon',
|
||||
|
||||
overrides: [
|
||||
{
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
"ncp": "^2.0.0",
|
||||
"object-assign": "^4.1.1",
|
||||
"platform": "^1.1.0",
|
||||
"prettier": "1.11.1",
|
||||
"prettier": "1.13.7",
|
||||
"prop-types": "^15.6.2",
|
||||
"random-seed": "^0.3.0",
|
||||
"react-lifecycles-compat": "^3.0.2",
|
||||
|
||||
@@ -39,12 +39,16 @@ if (__DEV__) {
|
||||
const listenersIsArr = Array.isArray(dispatchListeners);
|
||||
const listenersLen = listenersIsArr
|
||||
? dispatchListeners.length
|
||||
: dispatchListeners ? 1 : 0;
|
||||
: dispatchListeners
|
||||
? 1
|
||||
: 0;
|
||||
|
||||
const instancesIsArr = Array.isArray(dispatchInstances);
|
||||
const instancesLen = instancesIsArr
|
||||
? dispatchInstances.length
|
||||
: dispatchInstances ? 1 : 0;
|
||||
: dispatchInstances
|
||||
? 1
|
||||
: 0;
|
||||
|
||||
warningWithoutStack(
|
||||
instancesIsArr === listenersIsArr && instancesLen === listenersLen,
|
||||
|
||||
@@ -548,7 +548,9 @@ const ResponderEventPlugin = {
|
||||
? eventTypes.responderStart
|
||||
: isResponderTouchMove
|
||||
? eventTypes.responderMove
|
||||
: isResponderTouchEnd ? eventTypes.responderEnd : null;
|
||||
: isResponderTouchEnd
|
||||
? eventTypes.responderEnd
|
||||
: null;
|
||||
|
||||
if (incrementalTouch) {
|
||||
const gesture = ResponderSyntheticEvent.getPooled(
|
||||
@@ -571,7 +573,9 @@ const ResponderEventPlugin = {
|
||||
noResponderTouches(nativeEvent);
|
||||
const finalTouch = isResponderTerminate
|
||||
? eventTypes.responderTerminate
|
||||
: isResponderRelease ? eventTypes.responderRelease : null;
|
||||
: isResponderRelease
|
||||
? eventTypes.responderRelease
|
||||
: null;
|
||||
if (finalTouch) {
|
||||
const finalEvent = ResponderSyntheticEvent.getPooled(
|
||||
finalTouch,
|
||||
|
||||
@@ -68,7 +68,8 @@ type ComponentLifeCycle =
|
||||
* Mounted components have a DOM node representation and are capable of
|
||||
* receiving new props.
|
||||
*/
|
||||
| 'MOUNTED' /**
|
||||
| 'MOUNTED'
|
||||
/**
|
||||
* Unmounted components are inactive and cannot receive new props.
|
||||
*/
|
||||
| 'UNMOUNTED';
|
||||
|
||||
@@ -16,7 +16,9 @@ const SyntheticWheelEvent = SyntheticMouseEvent.extend({
|
||||
return 'deltaX' in event
|
||||
? event.deltaX
|
||||
: // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
|
||||
'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
|
||||
'wheelDeltaX' in event
|
||||
? -event.wheelDeltaX
|
||||
: 0;
|
||||
},
|
||||
deltaY(event) {
|
||||
return 'deltaY' in event
|
||||
@@ -25,7 +27,9 @@ const SyntheticWheelEvent = SyntheticMouseEvent.extend({
|
||||
'wheelDeltaY' in event
|
||||
? -event.wheelDeltaY
|
||||
: // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
|
||||
'wheelDelta' in event ? -event.wheelDelta : 0;
|
||||
'wheelDelta' in event
|
||||
? -event.wheelDelta
|
||||
: 0;
|
||||
},
|
||||
deltaZ: null,
|
||||
|
||||
|
||||
@@ -94,7 +94,9 @@ function extractSingleTouch(nativeEvent) {
|
||||
|
||||
return !hasTouches && hasChangedTouches
|
||||
? changedTouches[0]
|
||||
: hasTouches ? touches[0] : nativeEvent;
|
||||
: hasTouches
|
||||
? touches[0]
|
||||
: nativeEvent;
|
||||
}
|
||||
|
||||
function getAxisCoordOfEvent(
|
||||
|
||||
@@ -66,7 +66,9 @@ class ReactShallowRenderer {
|
||||
'components, but the provided element type was `%s`.',
|
||||
Array.isArray(element.type)
|
||||
? 'array'
|
||||
: element.type === null ? 'null' : typeof element.type,
|
||||
: element.type === null
|
||||
? 'null'
|
||||
: typeof element.type,
|
||||
);
|
||||
|
||||
if (this._rendering) {
|
||||
|
||||
@@ -21,6 +21,8 @@ export default function(
|
||||
':' +
|
||||
source.lineNumber +
|
||||
')'
|
||||
: ownerName ? ' (created by ' + ownerName + ')' : '')
|
||||
: ownerName
|
||||
? ' (created by ' + ownerName + ')'
|
||||
: '')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ function calculateMeanAndSdOfRatioFromDeltaMethod(
|
||||
) {
|
||||
const mean =
|
||||
(meanTest - meanControl) / meanControl -
|
||||
Math.pow(semControl, 2) * meanTest / Math.pow(meanControl, 3);
|
||||
(Math.pow(semControl, 2) * meanTest) / Math.pow(meanControl, 3);
|
||||
const variance =
|
||||
Math.pow(semTest / meanControl, 2) +
|
||||
Math.pow(semControl * meanTest, 2) / Math.pow(meanControl, 4);
|
||||
|
||||
@@ -4570,9 +4570,9 @@ preserve@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
|
||||
|
||||
prettier@1.11.1, prettier@^1.0.0:
|
||||
version "1.11.1"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75"
|
||||
prettier@1.13.7, prettier@^1.0.0:
|
||||
version "1.13.7"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.7.tgz#850f3b8af784a49a6ea2d2eaa7ed1428a34b7281"
|
||||
|
||||
pretty-format@^23.0.1:
|
||||
version "23.0.1"
|
||||
|
||||
Reference in New Issue
Block a user