diff --git a/.github/workflow-scripts/__tests__/publishTemplate-test.js b/.github/workflow-scripts/__tests__/publishTemplate-test.js index 9ddc6001680..9f735a63397 100644 --- a/.github/workflow-scripts/__tests__/publishTemplate-test.js +++ b/.github/workflow-scripts/__tests__/publishTemplate-test.js @@ -117,13 +117,13 @@ describe('#verifyPublishedTemplate', () => { it('will timeout if npm does not update package version after a set number of retries', async () => { const RETRIES = 2; - await verifyPublishedTemplate('0.77.0', true, RETRIES), + (await verifyPublishedTemplate('0.77.0', true, RETRIES), expect(mockVerifyPublishedPackage).toHaveBeenCalledWith( '@react-native-community/template', '0.77.0', 'latest', 2, - ); + )); }); }); }); diff --git a/.github/workflow-scripts/__tests__/verifyReleaseOnNpm-test.js b/.github/workflow-scripts/__tests__/verifyReleaseOnNpm-test.js index 4850e256b5a..761c4352b40 100644 --- a/.github/workflow-scripts/__tests__/verifyReleaseOnNpm-test.js +++ b/.github/workflow-scripts/__tests__/verifyReleaseOnNpm-test.js @@ -83,13 +83,13 @@ describe('#verifyReleaseOnNPM', () => { it('will timeout if npm does not update package version after a set number of retries', async () => { const RETRIES = 2; - await verifyReleaseOnNpm('0.77.0', true, RETRIES), + (await verifyReleaseOnNpm('0.77.0', true, RETRIES), expect(mockVerifyPublishedPackage).toHaveBeenCalledWith( 'react-native', '0.77.0', 'latest', 2, - ); + )); }); it('will timeout if npm does not update latest tag after a set number of retries', async () => { diff --git a/package.json b/package.json index 36721dd8003..03d3261c8ad 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "node-fetch": "^2.2.0", "nullthrows": "^1.1.1", "prettier": "3.6.2", - "prettier-plugin-hermes-parser": "0.30.0", + "prettier-plugin-hermes-parser": "0.31.1", "react": "19.1.1", "react-test-renderer": "19.1.1", "rimraf": "^3.0.2", diff --git a/packages/dev-middleware/src/__tests__/ServerUtils.js b/packages/dev-middleware/src/__tests__/ServerUtils.js index f67b6a83f49..df0c3177d2b 100644 --- a/packages/dev-middleware/src/__tests__/ServerUtils.js +++ b/packages/dev-middleware/src/__tests__/ServerUtils.js @@ -62,11 +62,11 @@ export function withServerForEachTest(options: CreateServerOptions): $ReadOnly<{ ({server, app} = await createServer(options)); const serverBaseUrl = baseUrlForServer( server, - options.secure ?? false ? 'https' : 'http', + (options.secure ?? false) ? 'https' : 'http', ); const serverBaseWsUrl = baseUrlForServer( server, - options.secure ?? false ? 'wss' : 'ws', + (options.secure ?? false) ? 'wss' : 'ws', ); Object.defineProperty(ref, 'serverBaseUrl', {value: serverBaseUrl}); Object.defineProperty(ref, 'serverBaseWsUrl', {value: serverBaseWsUrl}); diff --git a/packages/react-native/Libraries/Components/Pressable/Pressable.js b/packages/react-native/Libraries/Components/Pressable/Pressable.js index 42d94a758aa..e8b58984889 100644 --- a/packages/react-native/Libraries/Components/Pressable/Pressable.js +++ b/packages/react-native/Libraries/Components/Pressable/Pressable.js @@ -243,7 +243,7 @@ function Pressable({ }; const accessibilityLiveRegion = - ariaLive === 'off' ? 'none' : ariaLive ?? props.accessibilityLiveRegion; + ariaLive === 'off' ? 'none' : (ariaLive ?? props.accessibilityLiveRegion); const accessibilityLabel = ariaLabel ?? props.accessibilityLabel; const restPropsWithDefaults: React.ElementConfig = { diff --git a/packages/react-native/Libraries/Components/StatusBar/StatusBar.js b/packages/react-native/Libraries/Components/StatusBar/StatusBar.js index 5c266b11405..5cbc674ecf3 100644 --- a/packages/react-native/Libraries/Components/StatusBar/StatusBar.js +++ b/packages/react-native/Libraries/Components/StatusBar/StatusBar.js @@ -235,8 +235,8 @@ class StatusBar extends React.Component { static _defaultProps: any = createStackEntry({ backgroundColor: Platform.OS === 'android' - ? NativeStatusBarManagerAndroid.getConstants() - .DEFAULT_BACKGROUND_COLOR ?? 'black' + ? (NativeStatusBarManagerAndroid.getConstants() + .DEFAULT_BACKGROUND_COLOR ?? 'black') : 'black', barStyle: 'default', translucent: false, diff --git a/packages/react-native/Libraries/Components/TextInput/TextInput.js b/packages/react-native/Libraries/Components/TextInput/TextInput.js index 8bd86ccc2f0..46c1d6c61a3 100644 --- a/packages/react-native/Libraries/Components/TextInput/TextInput.js +++ b/packages/react-native/Libraries/Components/TextInput/TextInput.js @@ -915,8 +915,8 @@ const TextInput: component( Platform.OS === 'android' ? // $FlowFixMe[invalid-computed-prop] // $FlowFixMe[prop-missing] - autoCompleteWebToAutoCompleteAndroidMap[autoComplete] ?? - autoComplete + (autoCompleteWebToAutoCompleteAndroidMap[autoComplete] ?? + autoComplete) : undefined } textContentType={ diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableBounce.js b/packages/react-native/Libraries/Components/Touchable/TouchableBounce.js index db6bd60d793..3a81bc78281 100644 --- a/packages/react-native/Libraries/Components/Touchable/TouchableBounce.js +++ b/packages/react-native/Libraries/Components/Touchable/TouchableBounce.js @@ -138,7 +138,7 @@ class TouchableBounce extends React.Component< const accessibilityLiveRegion = this.props['aria-live'] === 'off' ? 'none' - : this.props['aria-live'] ?? this.props.accessibilityLiveRegion; + : (this.props['aria-live'] ?? this.props.accessibilityLiveRegion); const _accessibilityState = { busy: this.props['aria-busy'] ?? this.props.accessibilityState?.busy, checked: diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js b/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js index 015afef3157..ba1518a85e8 100644 --- a/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js +++ b/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js @@ -328,7 +328,7 @@ class TouchableHighlightImpl extends React.Component< const accessibilityLiveRegion = this.props['aria-live'] === 'off' ? 'none' - : this.props['aria-live'] ?? this.props.accessibilityLiveRegion; + : (this.props['aria-live'] ?? this.props.accessibilityLiveRegion); const accessibilityLabel = this.props['aria-label'] ?? this.props.accessibilityLabel; diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.js b/packages/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.js index 7cf4ffd42e1..97d2900eb99 100644 --- a/packages/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.js +++ b/packages/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.js @@ -332,7 +332,7 @@ class TouchableNativeFeedback extends React.Component< const accessibilityLiveRegion = this.props['aria-live'] === 'off' ? 'none' - : this.props['aria-live'] ?? this.props.accessibilityLiveRegion; + : (this.props['aria-live'] ?? this.props.accessibilityLiveRegion); const accessibilityLabel = this.props['aria-label'] ?? this.props.accessibilityLabel; diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js index 8bb207b2724..9733b42c7aa 100644 --- a/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js +++ b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js @@ -294,7 +294,7 @@ class TouchableOpacity extends React.Component< const accessibilityLiveRegion = this.props['aria-live'] === 'off' ? 'none' - : this.props['aria-live'] ?? this.props.accessibilityLiveRegion; + : (this.props['aria-live'] ?? this.props.accessibilityLiveRegion); const accessibilityLabel = this.props['aria-label'] ?? this.props.accessibilityLabel; diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/packages/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js index d375fe7b899..15fa6b1ec07 100755 --- a/packages/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/packages/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -189,7 +189,7 @@ export default function TouchableWithoutFeedback( disabled: disabled !== null ? disabled - : ariaDisabled ?? accessibilityState?.disabled, + : (ariaDisabled ?? accessibilityState?.disabled), hitSlop: hitSlop, delayLongPress: delayLongPress, delayPressIn: delayPressIn, @@ -272,7 +272,7 @@ export default function TouchableWithoutFeedback( ? 'no-hide-descendants' : props.importantForAccessibility, accessibilityLiveRegion: - ariaLive === 'off' ? 'none' : ariaLive ?? props.accessibilityLiveRegion, + ariaLive === 'off' ? 'none' : (ariaLive ?? props.accessibilityLiveRegion), nativeID: props.id ?? props.nativeID, }; diff --git a/packages/react-native/Libraries/Modal/Modal.js b/packages/react-native/Libraries/Modal/Modal.js index 2bdcbecc4dd..d1da4166414 100644 --- a/packages/react-native/Libraries/Modal/Modal.js +++ b/packages/react-native/Libraries/Modal/Modal.js @@ -292,7 +292,7 @@ class Modal extends React.Component { backgroundColor: this.props.transparent === true ? 'transparent' - : this.props.backdropColor ?? 'white', + : (this.props.backdropColor ?? 'white'), }; let animationType = this.props.animationType || 'none'; diff --git a/packages/react-native/Libraries/NativeComponent/ViewConfig.js b/packages/react-native/Libraries/NativeComponent/ViewConfig.js index 6f4ac624923..9dae3155a9a 100644 --- a/packages/react-native/Libraries/NativeComponent/ViewConfig.js +++ b/packages/react-native/Libraries/NativeComponent/ViewConfig.js @@ -47,6 +47,6 @@ function composeIndexers( maybeB: ?{+[string]: T}, ): {+[string]: T} { return maybeA == null || maybeB == null - ? maybeA ?? maybeB ?? {} + ? (maybeA ?? maybeB ?? {}) : {...maybeA, ...maybeB}; } diff --git a/packages/react-native/jest/mockComponent.js b/packages/react-native/jest/mockComponent.js index 6ff4f6bd3e2..7dedd4343b0 100644 --- a/packages/react-native/jest/mockComponent.js +++ b/packages/react-native/jest/mockComponent.js @@ -50,7 +50,7 @@ export default function mockComponent< (RealComponent.render == null ? 'Unknown' : // $FlowFixMe[incompatible-use] - RealComponent.render.displayName ?? RealComponent.render.name); + (RealComponent.render.displayName ?? RealComponent.render.name)); const nameWithoutPrefix = name.replace(/^(RCT|RK)/, ''); diff --git a/packages/react-native/scripts/codegen/generate-artifacts-executor/constants.js b/packages/react-native/scripts/codegen/generate-artifacts-executor/constants.js index 7f653a5ff60..8fc50a9111e 100644 --- a/packages/react-native/scripts/codegen/generate-artifacts-executor/constants.js +++ b/packages/react-native/scripts/codegen/generate-artifacts-executor/constants.js @@ -22,31 +22,31 @@ const REACT_NATIVE_REPOSITORY_ROOT = path.join( '..', ); -const REACT_NATIVE_PACKAGE_ROOT_FOLDER = path.join( - __dirname, - '..', - '..', - '..', - ) /*:: as string */; +const REACT_NATIVE_PACKAGE_ROOT_FOLDER /*: string */ = path.join( + __dirname, + '..', + '..', + '..', +); const CODEGEN_REPO_PATH = `${REACT_NATIVE_REPOSITORY_ROOT}/packages/react-native-codegen`; -const CORE_LIBRARIES_WITH_OUTPUT_FOLDER = { - FBReactNativeSpec: { - ios: path.join( - REACT_NATIVE_PACKAGE_ROOT_FOLDER, - 'React', - 'FBReactNativeSpec', - ) /*:: as string */, - android: path.join( - REACT_NATIVE_PACKAGE_ROOT_FOLDER, - 'ReactAndroid', - 'build', - 'generated', - 'source', - 'codegen', - ) /*:: as string */, - }, - } /*:: as {[string]: $FlowFixMe} */; +const CORE_LIBRARIES_WITH_OUTPUT_FOLDER /*: {[string]: $FlowFixMe} */ = { + FBReactNativeSpec: { + ios: path.join( + REACT_NATIVE_PACKAGE_ROOT_FOLDER, + 'React', + 'FBReactNativeSpec', + ) /*:: as string */, + android: path.join( + REACT_NATIVE_PACKAGE_ROOT_FOLDER, + 'ReactAndroid', + 'build', + 'generated', + 'source', + 'codegen', + ) /*:: as string */, + }, +}; const packageJsonPath = path.join( REACT_NATIVE_PACKAGE_ROOT_FOLDER, @@ -57,12 +57,12 @@ const packageJsonPath = path.join( const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')); const REACT_NATIVE = packageJson.name; -const TEMPLATES_FOLDER_PATH = path.join( - REACT_NATIVE_PACKAGE_ROOT_FOLDER, - 'scripts', - 'codegen', - 'templates', - ) /*:: as string */; +const TEMPLATES_FOLDER_PATH /*: string */ = path.join( + REACT_NATIVE_PACKAGE_ROOT_FOLDER, + 'scripts', + 'codegen', + 'templates', +); module.exports = { CODEGEN_REPO_PATH, diff --git a/packages/react-native/scripts/codegen/generate-artifacts-executor/generateRCTModuleProviders.js b/packages/react-native/scripts/codegen/generate-artifacts-executor/generateRCTModuleProviders.js index cba1e1d3017..1c8051db5ba 100644 --- a/packages/react-native/scripts/codegen/generate-artifacts-executor/generateRCTModuleProviders.js +++ b/packages/react-native/scripts/codegen/generate-artifacts-executor/generateRCTModuleProviders.js @@ -43,7 +43,7 @@ function generateRCTModuleProviders( codegenLog(`Generated artifact: ${finalPathH}`); codegenLog('Generating RCTModuleProviders.mm'); - let modulesInLibraries = {} /*:: as {[string]: Array<$FlowFixMe>} */; + let modulesInLibraries /*: {[string]: Array<$FlowFixMe>} */ = {}; let app = pkgJson.codegenConfig ? {config: pkgJson.codegenConfig, libraryPath: projectRoot} diff --git a/packages/react-native/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js b/packages/react-native/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js index fdd7e95c3f9..d54bd708c7b 100644 --- a/packages/react-native/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js +++ b/packages/react-native/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js @@ -45,7 +45,7 @@ function generateRCTThirdPartyComponents( codegenLog(`Generated artifact: ${finalPathH}`); codegenLog('Generating RCTThirdPartyComponentsProvider.mm'); - let componentsInLibraries = {} /*:: as {[string]: Array<$FlowFixMe>} */; + let componentsInLibraries /*: {[string]: Array<$FlowFixMe>} */ = {}; const componentLibraries = libraries.filter(({config, libraryPath}) => { if (isReactNativeCoreLibrary(config.name) || config.type === 'modules') { @@ -54,7 +54,7 @@ function generateRCTThirdPartyComponents( return true; }); - const librariesToCrawl = {} /*:: as {[string]: $FlowFixMe} */; + const librariesToCrawl /*: {[string]: $FlowFixMe} */ = {}; // Using new API explicitly or not using any config field to define components. const componentLibrariesUsingNewApi = []; diff --git a/packages/react-native/scripts/codegen/generate-artifacts-executor/utils.js b/packages/react-native/scripts/codegen/generate-artifacts-executor/utils.js index db611c8db17..24bfaa31e34 100644 --- a/packages/react-native/scripts/codegen/generate-artifacts-executor/utils.js +++ b/packages/react-native/scripts/codegen/generate-artifacts-executor/utils.js @@ -327,8 +327,8 @@ function isReactNativeCoreLibrary(libraryName /*: string */) /*: boolean */ { function parseiOSAnnotations( libraries /*: $ReadOnlyArray<$FlowFixMe> */, ) /*: {[string]: $FlowFixMe} */ { - const mLibraryMap = {} /*:: as {[string]: $FlowFixMe} */; - const cLibraryMap = {} /*:: as {[string]: $FlowFixMe} */; + const mLibraryMap /*: {[string]: $FlowFixMe} */ = {}; + const cLibraryMap /*: {[string]: $FlowFixMe} */ = {}; const map = {}; for (const library of libraries) { diff --git a/packages/react-native/scripts/codegen/generate-specs-cli-executor.js b/packages/react-native/scripts/codegen/generate-specs-cli-executor.js index a50afb5e673..78ddd7b0c3e 100644 --- a/packages/react-native/scripts/codegen/generate-specs-cli-executor.js +++ b/packages/react-native/scripts/codegen/generate-specs-cli-executor.js @@ -14,20 +14,20 @@ const utils = require('./codegen-utils'); const fs = require('fs'); const path = require('path'); -const GENERATORS = { - all: { - android: ['componentsAndroid', 'modulesAndroid', 'modulesCxx'], - ios: ['componentsIOS', 'modulesIOS', 'modulesCxx'], - }, - components: { - android: ['componentsAndroid'], - ios: ['componentsIOS'], - }, - modules: { - android: ['modulesAndroid', 'modulesCxx'], - ios: ['modulesIOS', 'modulesCxx'], - }, - } /*:: as {[string]: {[string]: $ReadOnlyArray}} */; +const GENERATORS /*: {[string]: {[string]: $ReadOnlyArray}} */ = { + all: { + android: ['componentsAndroid', 'modulesAndroid', 'modulesCxx'], + ios: ['componentsIOS', 'modulesIOS', 'modulesCxx'], + }, + components: { + android: ['componentsAndroid'], + ios: ['componentsIOS'], + }, + modules: { + android: ['modulesAndroid', 'modulesCxx'], + ios: ['modulesIOS', 'modulesCxx'], + }, +}; function createOutputDirectoryIfNeeded( outputDirectory /*: string */, diff --git a/packages/react-native/scripts/generate-provider-cli.js b/packages/react-native/scripts/generate-provider-cli.js index aa9d4acd293..9324da65ae4 100644 --- a/packages/react-native/scripts/generate-provider-cli.js +++ b/packages/react-native/scripts/generate-provider-cli.js @@ -34,10 +34,10 @@ const argv = yargs 'Please provide platform, schema path, and output directory.', ).argv; -const GENERATORS = { - android: [], - ios: ['providerIOS'], - } /*:: as {[string]: $ReadOnlyArray} */; +const GENERATORS /*: {[string]: $ReadOnlyArray} */ = { + android: [], + ios: ['providerIOS'], +}; function generateProvider( platform /*: string */, @@ -62,7 +62,7 @@ function generateProvider( throw new Error(`Can't parse schema to JSON. ${schemaListPath}`); } - const schemas = {} /*:: as {[string]: $FlowFixMe} */; + const schemas /*: {[string]: $FlowFixMe} */ = {}; try { for (const libraryName of Object.keys(schemaPaths)) { const tmpSchemaText = fs.readFileSync(schemaPaths[libraryName], 'utf-8'); diff --git a/packages/react-native/scripts/ios-prebuild/hermes.js b/packages/react-native/scripts/ios-prebuild/hermes.js index e5e67bfcb0a..6b1d0e68dc5 100644 --- a/packages/react-native/scripts/ios-prebuild/hermes.js +++ b/packages/react-native/scripts/ios-prebuild/hermes.js @@ -126,11 +126,15 @@ type HermesEngineSourceType = | 'download_prebuilt_nightly_tarball' */ -const HermesEngineSourceTypes = { - LOCAL_PREBUILT_TARBALL: 'local_prebuilt_tarball', - DOWNLOAD_PREBUILD_TARBALL: 'download_prebuild_tarball', - DOWNLOAD_PREBUILT_NIGHTLY_TARBALL: 'download_prebuilt_nightly_tarball', - } /*:: as const */; +const HermesEngineSourceTypes /*:{ + +DOWNLOAD_PREBUILD_TARBALL: "download_prebuild_tarball", + +DOWNLOAD_PREBUILT_NIGHTLY_TARBALL: "download_prebuilt_nightly_tarball", + +LOCAL_PREBUILT_TARBALL: "local_prebuilt_tarball" +} */ = { + LOCAL_PREBUILT_TARBALL: 'local_prebuilt_tarball', + DOWNLOAD_PREBUILD_TARBALL: 'download_prebuild_tarball', + DOWNLOAD_PREBUILT_NIGHTLY_TARBALL: 'download_prebuilt_nightly_tarball', +} as const; /** * Checks if the Hermes artifacts are already downloaded and up to date with the specified version. diff --git a/packages/react-native/scripts/ios-prebuild/reactNativeDependencies.js b/packages/react-native/scripts/ios-prebuild/reactNativeDependencies.js index 6b5880e98c1..8070f99049b 100644 --- a/packages/react-native/scripts/ios-prebuild/reactNativeDependencies.js +++ b/packages/react-native/scripts/ios-prebuild/reactNativeDependencies.js @@ -123,10 +123,13 @@ type ReactNativeDependenciesEngineSourceType = | 'download_prebuilt_nightly_tarball' */ -const ReactNativeDependenciesEngineSourceTypes = { - DOWNLOAD_PREBUILD_TARBALL: 'download_prebuild_tarball', - DOWNLOAD_PREBUILT_NIGHTLY_TARBALL: 'download_prebuilt_nightly_tarball', - } /*:: as const */; +const ReactNativeDependenciesEngineSourceTypes /*: { + +DOWNLOAD_PREBUILD_TARBALL: "download_prebuild_tarball", + +DOWNLOAD_PREBUILT_NIGHTLY_TARBALL: "download_prebuilt_nightly_tarball" +} */ = { + DOWNLOAD_PREBUILD_TARBALL: 'download_prebuild_tarball', + DOWNLOAD_PREBUILT_NIGHTLY_TARBALL: 'download_prebuilt_nightly_tarball', +}; /** * Checks if the ReactNativeDependencies artifacts are already downloaded and up to date with the specified version. diff --git a/packages/react-native/src/private/animated/__tests__/createAnimatedPropsMemoHook-test.js b/packages/react-native/src/private/animated/__tests__/createAnimatedPropsMemoHook-test.js index bfc648ac9ee..9b4d3fefa61 100644 --- a/packages/react-native/src/private/animated/__tests__/createAnimatedPropsMemoHook-test.js +++ b/packages/react-native/src/private/animated/__tests__/createAnimatedPropsMemoHook-test.js @@ -20,11 +20,11 @@ describe('createCompositeKeyForProps', () => { it('excludes non-array and non-object allowlisted props', () => { const props = {string: 'abc', number: 123, boolean: true, function() {}}; const allowlist = { - string: true, - number: true, - boolean: true, - function: true, - } /*:: as const */; + string: true, + number: true, + boolean: true, + function: true, + } as const; const compositeKey = createCompositeKeyForProps(props, allowlist); expect(compositeKey).toEqual(null); @@ -53,8 +53,8 @@ describe('createCompositeKeyForProps', () => { bar: new AnimatedEvent([], {useNativeDriver: true}), }; const allowlist = { - bar: true, - } /*:: as const */; + bar: true, + } as const; const compositeKey = createCompositeKeyForProps(props, allowlist); expect(compositeKey).toEqual({bar: props.bar}); @@ -69,10 +69,10 @@ describe('createCompositeKeyForProps', () => { }, }; const allowlist = { - style: { - baz: true, - }, - } /*:: as const */; + style: { + baz: true, + }, + } as const; const compositeKey = createCompositeKeyForProps(props, allowlist); expect(compositeKey).toEqual(null); @@ -84,8 +84,8 @@ describe('createCompositeKeyForProps', () => { bar: new AnimatedValue(1), }; const allowlist = { - bar: true, - } /*:: as const */; + bar: true, + } as const; const compositeKey = createCompositeKeyForProps(props, allowlist); expect(compositeKey).toEqual({bar: props.bar}); @@ -108,7 +108,7 @@ describe('createCompositeKeyForProps', () => { const props = { style: {opacity, transform: [{rotateX: 1}, {rotateY}, {rotateZ: 1}]}, }; - const allowlist = {style: {transform: true}} /*:: as const */; + const allowlist = {style: {transform: true}} as const; const compositeKey = createCompositeKeyForProps(props, allowlist); expect(compositeKey).toEqual({ @@ -126,7 +126,7 @@ describe('createCompositeKeyForProps', () => { const props = { style: [{opacity: opacityA}, {opacity: opacityB}], }; - const allowlist = {style: {opacity: true}} /*:: as const */; + const allowlist = {style: {opacity: true}} as const; const compositeKey = createCompositeKeyForProps(props, allowlist); expect(compositeKey).toEqual({style: {opacity: opacityB}}); diff --git a/scripts/run-ci-javascript-tests.js b/scripts/run-ci-javascript-tests.js index e0e2b229346..f77661090b7 100644 --- a/scripts/run-ci-javascript-tests.js +++ b/scripts/run-ci-javascript-tests.js @@ -20,13 +20,14 @@ */ const {execSync} = require('child_process'); -// $FlowFixMe[unclear-type] -const argv = require('yargs').argv /*:: as any as $ReadOnly<{ +const argv /*:$ReadOnly<{ maxWorkers?: number, jestBinary?: string, flowBinary?: string, yarnBinary?: string, -}> */; +}> */ = + // $FlowFixMe + require('yargs').argv; const numberOfMaxWorkers = argv.maxWorkers ?? 1; diff --git a/yarn.lock b/yarn.lock index d30678ea8cf..56412385c7c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7996,14 +7996,10 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier-plugin-hermes-parser@0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/prettier-plugin-hermes-parser/-/prettier-plugin-hermes-parser-0.30.0.tgz#2f7b5e8cba5f632a2010f5bb4cd574a9403631d1" - integrity sha512-hnNObP7pIrCfkX75jzcYxwwWOMCadR4O+Q48VLQ09Ly2V3np5eSBfs2Owo4xbrIZoULQS5/hZWrmcW/F2PNiSQ== - dependencies: - hermes-estree "0.30.0" - hermes-parser "0.30.0" - prettier-plugin-hermes-parser "0.30.0" +prettier-plugin-hermes-parser@0.31.1: + version "0.31.1" + resolved "https://registry.yarnpkg.com/prettier-plugin-hermes-parser/-/prettier-plugin-hermes-parser-0.31.1.tgz#950f14274ba6d5d39d152cdb25ea67c107b9b467" + integrity sha512-h98zphVpGyil1qXUP70jmD2SLMqsdah2Ys6Ap/f3zbKXJU5U91mtI+egxyTXtDasIL8Jp9awmUVLkzkyfimUNQ== prettier@3.6.2: version "3.6.2"