File tree Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 219
219
"vars-on-top": 0,
220
220
"wrap-iife": 2,
221
221
"wrap-regex": 0,
222
- "yoda": [2, "never", {"exceptRange": true}]
222
+ "yoda": [2, "never", {"exceptRange": true}],
223
+
224
+ "no-async": 2
223
225
}
224
226
}
Original file line number Diff line number Diff line change 24
24
"test" : " npm run lint && npm run check && npm run testonly" ,
25
25
"testonly" : " babel-node ./node_modules/.bin/_mocha $npm_package_options_mocha" ,
26
26
"t" : " babel-node ./node_modules/.bin/_mocha --require ./resources/mocha-bootload" ,
27
- "lint" : " eslint src || (printf '\\ 033[33mTry: \\ 033[7m npm run lint -- --fix \\ 033[0m\\ n' && exit 1)" ,
27
+ "lint" : " eslint --rulesdir ./resources/lint src || (printf '\\ 033[33mTry: \\ 033[7m npm run lint -- --fix \\ 033[0m\\ n' && exit 1)" ,
28
28
"check" : " flow check" ,
29
29
"check-cover" : " for file in {src/*.js,src/**/*.js}; do echo $file; flow coverage $file; done" ,
30
30
"build" : " babel src --optional runtime --ignore __tests__ --out-dir dist/ && cp package.json dist/ && npm run build-dot-flow" ,
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) 2017, Facebook, Inc.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree. An additional grant
7
+ * of patent rights can be found in the PATENTS file in the same directory.
8
+ */
9
+
10
+ module . exports = function ( context ) {
11
+ if ( context . getFilename ( ) . match ( / \b _ _ t e s t s _ _ \b / ) ) {
12
+ return { } ;
13
+ } else {
14
+ return {
15
+ FunctionDeclaration : function ( node ) {
16
+ if ( node . async ) {
17
+ context . report (
18
+ node ,
19
+ 'async functions are not allowed outside of the test suite ' +
20
+ 'because older versions of NodeJS do not support them ' +
21
+ 'without additional runtime dependencies. Instead, use explicit ' +
22
+ 'Promises.'
23
+ ) ;
24
+ }
25
+ } ,
26
+ } ;
27
+ }
28
+ } ;
You can’t perform that action at this time.
0 commit comments