Files
react-native/packages/eslint-plugin-specs/postpack.js
Tim Yung b344aec2ae RN: Add @noflow to ESLint & Babel Preset Files (#51778)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51778

Adds `noflow` to a bunch of ESLint and Babel files that are expected to be evaluated using Node.js without Babel. Additioanlly, these files tend to depend on ESLint and Babel type definitions that are not currently readily available.

In the future, these files could be migrated to use `flow strict-local` or `flow strict` using comment syntax for type annotations. But for now, adding `noflow` makes it explicit that these are known to not be typechecked.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75883642

fbshipit-source-id: 54236d123ca8773de42bce81189dfb5c0671563e
2025-06-04 12:03:52 -07:00

46 lines
989 B
JavaScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @noflow
*/
const fs = require('fs');
/**
* script to prepare package for publish.
*
* Due to differences to how we consume internal packages, update a flag
*/
fs.readFile('./react-native-modules.js', 'utf8', function (readError, source) {
if (readError != null) {
return console.error(
'Failed to read react-native-modules.js for publish',
readError,
);
}
const result = source.replace(
'const PACKAGE_USAGE = true;',
'const PACKAGE_USAGE = false;',
);
fs.writeFile(
'./react-native-modules.js',
result,
'utf8',
function (writeError) {
if (writeError != null) {
return console.error(
'Failed to update react-native-modules.js for publish',
writeError,
);
}
},
);
});