@samitouri / QOS-React / commits / f1c6488f1b

Forbid adding new files with @providesModule (#11361)

* Forbid adding new files with @providesModule * Turn off Haste mode in Flow config * chmod a+x * Try to fix bash * Try to fix bash again

Dan Abramov committed Oct 25, 2017 at 19:50 UTC f1c6488f1b2e5fad68c5b0c4e03d555a247bddf5
6 files changed +18 -5
.flowconfig
-2
@@ -17,8 +17,6 @@
17 ./scripts/flow
18
19 [options]
20 -module.system=haste
21 -
20 esproposal.class_static_fields=enable
21 esproposal.class_instance_fields=enable
22 unsafe.enable_getters_and_setters=true
packages/events/TouchHistoryMath.js
+4 -1
@@ -1,5 +1,8 @@
1 /**
2 - * @providesModule TouchHistoryMath
2 + * Copyright (c) 2016-present, Facebook, Inc.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 */
7
8 'use strict';
packages/shared/ReactElementType.js
-1
@@ -5,7 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @flow
8 - * @providesModule ReactElementType
8 */
9
10 'use strict';
packages/shared/ReactFiberComponentTreeHook.js
-1
@@ -5,7 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @flow
8 - * @providesModule ReactFiberComponentTreeHook
8 */
9
10 'use strict';
scripts/circleci/check_modules.sh new
+13
@@ -0,0 +1,13 @@
1 +#!/bin/bash
2 +
3 +set -e
4 +
5 +# Make sure we don't introduce accidental @providesModule annotations.
6 +EXPECTED='scripts/rollup/header.js'
7 +ACTUAL=$(git grep -l @providesModule -- './*.js' ':!scripts/rollup/shims/*.js')
8 +
9 +if [ "$EXPECTED" != "$ACTUAL" ]; then
10 + echo "@providesModule crept into some new files?"
11 + diff -u <(echo "$EXPECTED") <(echo "$ACTUAL") || true
12 + exit 1
13 +fi
scripts/circleci/test_entry_point.sh
+1
@@ -19,6 +19,7 @@ if [ $((0 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
19 COMMANDS_TO_RUN+=('node ./scripts/tasks/jest')
20 COMMANDS_TO_RUN+=('./scripts/circleci/build.sh')
21 COMMANDS_TO_RUN+=('./scripts/circleci/check_license.sh')
22 + COMMANDS_TO_RUN+=('./scripts/circleci/check_modules.sh')
23 COMMANDS_TO_RUN+=('./scripts/circleci/test_print_warnings.sh')
24 COMMANDS_TO_RUN+=('./scripts/circleci/track_stats.sh')
25 # COMMANDS_TO_RUN+=('./scripts/circleci/bench.sh')