Skip to content

Commit 1a335b3

Browse files
yungstersfacebook-github-bot
authored andcommitted
RN: Require @flow Annotations (#51824)
Summary: Pull Request resolved: #51824 Configures ESLint to require `flow` (or `noflow`) annotations for JavaScript files in the React Native repository. This ensures that we uphold a high bar for type safety and correctness, or intentionally deviate when it makes sense. Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D75985490 fbshipit-source-id: 56f9fe7666a02c796ceb9cf076677e81b164b65e
1 parent e8e51ac commit 1a335b3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7+
* @noflow
78
* @format
89
*/
910

@@ -27,6 +28,7 @@ module.exports = {
2728
files: ['*.js', '*.js.flow', '*.jsx'],
2829
parser: 'hermes-eslint',
2930
rules: {
31+
'ft-flow/require-valid-file-annotation': [2, 'always'],
3032
'no-extra-boolean-cast': 0,
3133
'no-void': 0,
3234
// These rules are not required with hermes-eslint
@@ -68,6 +70,7 @@ module.exports = {
6870
{
6971
files: ['flow-typed/**/*.js', 'packages/react-native/flow/**/*'],
7072
rules: {
73+
'ft-flow/require-valid-file-annotation': 0,
7174
'lint/valid-flow-typed-signature': 2,
7275
'no-shadow': 0,
7376
'no-unused-vars': 0,

0 commit comments

Comments
 (0)