diff --git a/package.json b/package.json index edd4f2cfd69..3d2388850a6 100644 --- a/package.json +++ b/package.json @@ -87,11 +87,11 @@ "eslint-plugin-react-native": "^4.0.0", "eslint-plugin-redundant-undefined": "^0.4.0", "eslint-plugin-relay": "^1.8.3", - "flow-api-translator": "0.19.2", + "flow-api-translator": "0.20.0", "flow-bin": "^0.229.2", "glob": "^7.1.1", - "hermes-eslint": "0.19.2", - "hermes-transform": "0.19.2", + "hermes-eslint": "0.20.0", + "hermes-transform": "0.20.0", "inquirer": "^7.1.0", "jest": "^29.6.3", "jest-junit": "^10.0.0", @@ -104,7 +104,7 @@ "node-fetch": "^2.2.0", "nullthrows": "^1.1.1", "prettier": "2.8.8", - "prettier-plugin-hermes-parser": "0.19.2", + "prettier-plugin-hermes-parser": "0.20.0", "react": "18.2.0", "react-test-renderer": "18.2.0", "rimraf": "^3.0.2", diff --git a/packages/hermes-inspector-msggen/src/Property.js b/packages/hermes-inspector-msggen/src/Property.js index a6739160357..3874d83c58c 100644 --- a/packages/hermes-inspector-msggen/src/Property.js +++ b/packages/hermes-inspector-msggen/src/Property.js @@ -194,8 +194,8 @@ class RefProperty extends Property { return this.cyclical ? `{nullptr, deleter<${fullCppType}>}` : this.optional - ? '' - : '{}'; + ? '' + : '{}'; } } diff --git a/packages/react-native-babel-transformer/package.json b/packages/react-native-babel-transformer/package.json index 14c8f39b904..3bac9a7b458 100644 --- a/packages/react-native-babel-transformer/package.json +++ b/packages/react-native-babel-transformer/package.json @@ -17,7 +17,7 @@ "dependencies": { "@babel/core": "^7.20.0", "@react-native/babel-preset": "0.74.0", - "hermes-parser": "0.19.2", + "hermes-parser": "0.20.0", "nullthrows": "^1.1.1" }, "peerDependencies": { diff --git a/packages/react-native-codegen/package.json b/packages/react-native-codegen/package.json index fdde30bcd9c..dabc128e190 100644 --- a/packages/react-native-codegen/package.json +++ b/packages/react-native-codegen/package.json @@ -31,7 +31,7 @@ "dependencies": { "@babel/parser": "^7.20.0", "glob": "^7.1.1", - "hermes-parser": "0.19.2", + "hermes-parser": "0.20.0", "invariant": "^2.2.4", "jscodeshift": "^0.14.0", "mkdirp": "^0.5.1", @@ -49,7 +49,7 @@ "@babel/plugin-transform-flow-strip-types": "^7.20.0", "@babel/preset-env": "^7.20.0", "chalk": "^4.0.0", - "hermes-estree": "0.19.2", + "hermes-estree": "0.20.0", "micromatch": "^4.0.4", "prettier": "2.8.8", "rimraf": "^3.0.2", diff --git a/packages/react-native/Libraries/Components/TextInput/TextInput.js b/packages/react-native/Libraries/Components/TextInput/TextInput.js index 7b522fe5dcb..c8ead59c119 100644 --- a/packages/react-native/Libraries/Components/TextInput/TextInput.js +++ b/packages/react-native/Libraries/Components/TextInput/TextInput.js @@ -1158,8 +1158,8 @@ function InternalTextInput(props: Props): React.Node { typeof props.value === 'string' ? props.value : typeof props.defaultValue === 'string' - ? props.defaultValue - : ''; + ? props.defaultValue + : ''; // This is necessary in case native updates the text and JS decides // that the update should be ignored and we should stick with the value @@ -1736,12 +1736,12 @@ const ExportedForwardRef: React.AbstractComponent< textContentType != null ? textContentType : Platform.OS === 'ios' && - autoComplete && - autoComplete in autoCompleteWebToTextContentTypeMap - ? // $FlowFixMe[invalid-computed-prop] - // $FlowFixMe[prop-missing] - autoCompleteWebToTextContentTypeMap[autoComplete] - : textContentType + autoComplete && + autoComplete in autoCompleteWebToTextContentTypeMap + ? // $FlowFixMe[invalid-computed-prop] + // $FlowFixMe[prop-missing] + autoCompleteWebToTextContentTypeMap[autoComplete] + : textContentType } {...restProps} forwardedRef={forwardedRef} diff --git a/packages/react-native/Libraries/Components/Touchable/Touchable.js b/packages/react-native/Libraries/Components/Touchable/Touchable.js index c34ca4f8b85..899385a995a 100644 --- a/packages/react-native/Libraries/Components/Touchable/Touchable.js +++ b/packages/react-native/Libraries/Components/Touchable/Touchable.js @@ -40,8 +40,8 @@ const extractSingleTouch = (nativeEvent: { return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches - ? touches[0] - : nativeEvent; + ? touches[0] + : nativeEvent; }; /** diff --git a/packages/react-native/Libraries/Core/Devtools/parseErrorStack.js b/packages/react-native/Libraries/Core/Devtools/parseErrorStack.js index 9b84537c3d9..d52ae1faffa 100644 --- a/packages/react-native/Libraries/Core/Devtools/parseErrorStack.js +++ b/packages/react-native/Libraries/Core/Devtools/parseErrorStack.js @@ -47,11 +47,11 @@ function parseErrorStack(errorStack?: string): Array { const parsedStack = Array.isArray(errorStack) ? errorStack : global.HermesInternal - ? convertHermesStack(parseHermesStack(errorStack)) - : stacktraceParser.parse(errorStack).map((frame): StackFrame => ({ - ...frame, - column: frame.column != null ? frame.column - 1 : null, - })); + ? convertHermesStack(parseHermesStack(errorStack)) + : stacktraceParser.parse(errorStack).map((frame): StackFrame => ({ + ...frame, + column: frame.column != null ? frame.column - 1 : null, + })); return parsedStack; } diff --git a/packages/react-native/Libraries/Core/Devtools/parseHermesStack.js b/packages/react-native/Libraries/Core/Devtools/parseHermesStack.js index 1193afd88f9..f7b6929834b 100644 --- a/packages/react-native/Libraries/Core/Devtools/parseHermesStack.js +++ b/packages/react-native/Libraries/Core/Devtools/parseHermesStack.js @@ -88,25 +88,25 @@ function parseLine(line: string): ?HermesStackEntry { asFrame[2] === 'native' ? {type: 'NATIVE'} : asFrame[3] === 'address at ' - ? isInternalBytecodeSourceUrl(asFrame[4]) - ? { - type: 'INTERNAL_BYTECODE', - sourceUrl: asFrame[4], - line1Based: Number.parseInt(asFrame[5], 10), - virtualOffset0Based: Number.parseInt(asFrame[6], 10), - } + ? isInternalBytecodeSourceUrl(asFrame[4]) + ? { + type: 'INTERNAL_BYTECODE', + sourceUrl: asFrame[4], + line1Based: Number.parseInt(asFrame[5], 10), + virtualOffset0Based: Number.parseInt(asFrame[6], 10), + } + : { + type: 'BYTECODE', + sourceUrl: asFrame[4], + line1Based: Number.parseInt(asFrame[5], 10), + virtualOffset0Based: Number.parseInt(asFrame[6], 10), + } : { - type: 'BYTECODE', + type: 'SOURCE', sourceUrl: asFrame[4], line1Based: Number.parseInt(asFrame[5], 10), - virtualOffset0Based: Number.parseInt(asFrame[6], 10), - } - : { - type: 'SOURCE', - sourceUrl: asFrame[4], - line1Based: Number.parseInt(asFrame[5], 10), - column1Based: Number.parseInt(asFrame[6], 10), - }, + column1Based: Number.parseInt(asFrame[6], 10), + }, }; } const asSkipped = line.match(RE_SKIPPED); diff --git a/packages/react-native/Libraries/Interaction/TouchHistoryMath.js b/packages/react-native/Libraries/Interaction/TouchHistoryMath.js index cbcbe2606de..aec0d669131 100644 --- a/packages/react-native/Libraries/Interaction/TouchHistoryMath.js +++ b/packages/react-native/Libraries/Interaction/TouchHistoryMath.js @@ -48,10 +48,10 @@ const TouchHistoryMath = { ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis - ? oneTouchData.currentPageY - : !ofCurrent && isXAxis - ? oneTouchData.previousPageX - : oneTouchData.previousPageY; + ? oneTouchData.currentPageY + : !ofCurrent && isXAxis + ? oneTouchData.previousPageX + : oneTouchData.previousPageY; count = 1; } } else { diff --git a/packages/react-native/Libraries/ReactNative/getNativeComponentAttributes.js b/packages/react-native/Libraries/ReactNative/getNativeComponentAttributes.js index 318a2d18a4e..d768a648718 100644 --- a/packages/react-native/Libraries/ReactNative/getNativeComponentAttributes.js +++ b/packages/react-native/Libraries/ReactNative/getNativeComponentAttributes.js @@ -77,8 +77,8 @@ function getNativeComponentAttributes(uiViewClassName: string): any { ? true : {process} : process == null - ? {diff} - : {diff, process}; + ? {diff} + : {diff, process}; } // Unfortunately, the current setup declares style properties as top-level diff --git a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js index d4b5ab92113..c39bcb97ea3 100644 --- a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js +++ b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js @@ -918,5 +918,5 @@ export type ____FlattenStyleProp_Internal< > = TStyleProp extends null | void | false | '' ? empty : TStyleProp extends $ReadOnlyArray - ? ____FlattenStyleProp_Internal - : TStyleProp; + ? ____FlattenStyleProp_Internal + : TStyleProp; diff --git a/packages/react-native/Libraries/Utilities/Platform.android.js b/packages/react-native/Libraries/Utilities/Platform.android.js index 5272465aa7c..e2cfdf8aa64 100644 --- a/packages/react-native/Libraries/Utilities/Platform.android.js +++ b/packages/react-native/Libraries/Utilities/Platform.android.js @@ -78,10 +78,10 @@ const Platform: PlatformType = { ? // $FlowFixMe[incompatible-return] spec.android : 'native' in spec - ? // $FlowFixMe[incompatible-return] - spec.native - : // $FlowFixMe[incompatible-return] - spec.default, + ? // $FlowFixMe[incompatible-return] + spec.native + : // $FlowFixMe[incompatible-return] + spec.default, }; module.exports = Platform; diff --git a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap index 591a451b02b..54740e29317 100644 --- a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap +++ b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap @@ -7750,8 +7750,8 @@ export type ____FlattenStyleProp_Internal< > = TStyleProp extends null | void | false | \\"\\" ? empty : TStyleProp extends $ReadOnlyArray - ? ____FlattenStyleProp_Internal - : TStyleProp; + ? ____FlattenStyleProp_Internal + : TStyleProp; " `; diff --git a/packages/react-native/src/private/webapis/dom/nodes/ReadOnlyElement.js b/packages/react-native/src/private/webapis/dom/nodes/ReadOnlyElement.js index 46fb34c1e8f..e1b58a294fa 100644 --- a/packages/react-native/src/private/webapis/dom/nodes/ReadOnlyElement.js +++ b/packages/react-native/src/private/webapis/dom/nodes/ReadOnlyElement.js @@ -151,9 +151,8 @@ export default class ReadOnlyElement extends ReadOnlyNode { const node = getShadowNode(this); if (node != null) { - const scrollPosition = nullthrows(getFabricUIManager()).getScrollPosition( - node, - ); + const scrollPosition = + nullthrows(getFabricUIManager()).getScrollPosition(node); if (scrollPosition != null) { return scrollPosition[0]; } @@ -166,9 +165,8 @@ export default class ReadOnlyElement extends ReadOnlyNode { const node = getShadowNode(this); if (node != null) { - const scrollPosition = nullthrows(getFabricUIManager()).getScrollPosition( - node, - ); + const scrollPosition = + nullthrows(getFabricUIManager()).getScrollPosition(node); if (scrollPosition != null) { return scrollPosition[1]; } diff --git a/packages/react-native/src/private/webapis/dom/nodes/ReadOnlyNode.js b/packages/react-native/src/private/webapis/dom/nodes/ReadOnlyNode.js index 2eb5d742ff2..2c29c2d105a 100644 --- a/packages/react-native/src/private/webapis/dom/nodes/ReadOnlyNode.js +++ b/packages/react-native/src/private/webapis/dom/nodes/ReadOnlyNode.js @@ -125,9 +125,8 @@ export default class ReadOnlyNode { return null; } - const parentInstanceHandle = nullthrows(getFabricUIManager()).getParentNode( - shadowNode, - ); + const parentInstanceHandle = + nullthrows(getFabricUIManager()).getParentNode(shadowNode); if (parentInstanceHandle == null) { return null; @@ -323,9 +322,8 @@ export function getChildNodes( return []; } - const childNodeInstanceHandles = nullthrows( - getFabricUIManager(), - ).getChildNodes(shadowNode); + const childNodeInstanceHandles = + nullthrows(getFabricUIManager()).getChildNodes(shadowNode); return childNodeInstanceHandles .map(instanceHandle => getPublicInstanceFromInternalInstanceHandle(instanceHandle), diff --git a/packages/rn-tester/js/RNTesterAppShared.js b/packages/rn-tester/js/RNTesterAppShared.js index 131a838b976..87cb6b69dfe 100644 --- a/packages/rn-tester/js/RNTesterAppShared.js +++ b/packages/rn-tester/js/RNTesterAppShared.js @@ -217,8 +217,8 @@ const RNTesterApp = ({ activeModuleTitle != null ? activeModuleTitle : screen === Screens.COMPONENTS - ? 'Components' - : 'APIs'; + ? 'Components' + : 'APIs'; const activeExampleList = screen === Screens.COMPONENTS ? examplesList.components : examplesList.apis; diff --git a/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js b/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js index f6d9126c67b..bd14a801340 100644 --- a/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js +++ b/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js @@ -645,8 +645,8 @@ class NestedCheckBox extends React.Component< checkbox2 && this.state.checkbox3 ? true : checkbox2 || this.state.checkbox3 - ? 'mixed' - : false, + ? 'mixed' + : false, }); }; @@ -659,8 +659,8 @@ class NestedCheckBox extends React.Component< this.state.checkbox2 && checkbox3 ? true : this.state.checkbox2 || checkbox3 - ? 'mixed' - : false, + ? 'mixed' + : false, }); }; @@ -680,8 +680,8 @@ class NestedCheckBox extends React.Component< this.state.checkbox1 === 'mixed' ? mixedCheckboxImageSource : this.state.checkbox1 - ? checkImageSource - : uncheckImageSource + ? checkImageSource + : uncheckImageSource } /> Meat diff --git a/packages/rn-tester/js/examples/Performance/PerformanceComparisonExample.js b/packages/rn-tester/js/examples/Performance/PerformanceComparisonExample.js index 896b8defbb8..fb0ac33a9cd 100644 --- a/packages/rn-tester/js/examples/Performance/PerformanceComparisonExample.js +++ b/packages/rn-tester/js/examples/Performance/PerformanceComparisonExample.js @@ -84,8 +84,8 @@ function PerfExampleWrapper(props: { {loadExample === SHOW_BAD_EXAMPLE ? badExampleContents : loadExample === SHOW_GOOD_EXAMPLE - ? goodExampleContents - : null} + ? goodExampleContents + : null} diff --git a/packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js b/packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js index 2437e8509cb..c8f4bd6bacc 100644 --- a/packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js +++ b/packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js @@ -297,8 +297,8 @@ function VariantColorsExample() { Platform.OS === 'ios' ? DynamicColorIOS({light: 'red', dark: 'blue'}) : Platform.OS === 'android' - ? PlatformColor('?attr/colorAccent') - : 'red', + ? PlatformColor('?attr/colorAccent') + : 'red', }} /> diff --git a/packages/rn-tester/js/examples/Pressable/PressableExample.js b/packages/rn-tester/js/examples/Pressable/PressableExample.js index 5266d69bb41..6dfe4be3031 100644 --- a/packages/rn-tester/js/examples/Pressable/PressableExample.js +++ b/packages/rn-tester/js/examples/Pressable/PressableExample.js @@ -244,8 +244,8 @@ function PressableNativeMethods() { {status == null ? 'Missing Ref!' : status === true - ? 'Native Methods Exist' - : 'Native Methods Missing!'} + ? 'Native Methods Exist' + : 'Native Methods Missing!'} diff --git a/packages/rn-tester/js/examples/Touchable/TouchableExample.js b/packages/rn-tester/js/examples/Touchable/TouchableExample.js index 4f978e9d599..7827437cca1 100644 --- a/packages/rn-tester/js/examples/Touchable/TouchableExample.js +++ b/packages/rn-tester/js/examples/Touchable/TouchableExample.js @@ -321,8 +321,8 @@ function TouchableNativeMethodChecker< {status == null ? 'Missing Ref!' : status === true - ? 'Native Methods Exist' - : 'Native Methods Missing!'} + ? 'Native Methods Exist' + : 'Native Methods Missing!'} ); diff --git a/packages/virtualized-lists/Lists/VirtualizedListCellRenderer.js b/packages/virtualized-lists/Lists/VirtualizedListCellRenderer.js index afe3eea7ad4..d67f19884bd 100644 --- a/packages/virtualized-lists/Lists/VirtualizedListCellRenderer.js +++ b/packages/virtualized-lists/Lists/VirtualizedListCellRenderer.js @@ -203,8 +203,8 @@ export default class CellRenderer extends React.Component< ? [styles.rowReverse, inversionStyle] : [styles.columnReverse, inversionStyle] : horizontal - ? [styles.row, inversionStyle] - : inversionStyle; + ? [styles.row, inversionStyle] + : inversionStyle; const result = !CellRendererComponent ? (