瀏覽代碼

Flow - A static type checker for JavaScript

dev1
Lyubo Marinov 8 年之前
父節點
當前提交
bfef62c1b1
共有 5 個檔案被更改,包括 81 行新增26 行删除
  1. 8
    1
      .eslintrc.js
  2. 36
    0
      .flowconfig
  3. 27
    24
      .jshintignore
  4. 6
    0
      flow-typed/npm/flow-bin_v0.x.x.js
  5. 4
    1
      package.json

+ 8
- 1
.eslintrc.js 查看文件

5
         'es6': true,
5
         'es6': true,
6
         'jasmine': true
6
         'jasmine': true
7
     },
7
     },
8
-    'extends': 'eslint:recommended',
8
+    'extends': [
9
+        'eslint:recommended',
10
+        'plugin:flowtype/recommended'
11
+    ],
9
     'globals': {
12
     'globals': {
10
         // The globals that (1) are accessed but not defined within many of our
13
         // The globals that (1) are accessed but not defined within many of our
11
         // files, (2) are certainly defined, and (3) we would like to use
14
         // files, (2) are certainly defined, and (3) we would like to use
13
         // files.
16
         // files.
14
         '__filename': false
17
         '__filename': false
15
     },
18
     },
19
+    'parser': 'babel-eslint',
16
     'parserOptions': {
20
     'parserOptions': {
17
         'ecmaFeatures': {
21
         'ecmaFeatures': {
18
             'experimentalObjectRestSpread': true
22
             'experimentalObjectRestSpread': true
19
         },
23
         },
20
         'sourceType': 'module'
24
         'sourceType': 'module'
21
     },
25
     },
26
+    'plugins': [
27
+        'flowtype'
28
+    ],
22
     'rules': {
29
     'rules': {
23
         'new-cap': 2,
30
         'new-cap': 2,
24
         'no-console': 0,
31
         'no-console': 0,

+ 36
- 0
.flowconfig 查看文件

1
+; XXX The origin of the source code of this .flowconfig file is the jitsi-meet
2
+; project. As the NPM package jitsi-meet builds the NPM package lib-jitsi-meet
3
+; and jitsi-meet's react-native requires specific .flowconfig contents, it is
4
+; mandatory to keep the .flowconfig files of jitsi-meet and lib-jitsi-meet in
5
+; sync (e.g. the flow-bin version).
6
+;
7
+[ignore]
8
+; Ignore packages in node_modules which we (i.e. the lib-jitsi-meet project)
9
+; have seen to cause errors and we have chosen not to fix.
10
+
11
+[include]
12
+
13
+[libs]
14
+flow/
15
+
16
+[options]
17
+emoji=true
18
+
19
+module.system=node
20
+
21
+experimental.strict_type_args=true
22
+
23
+munge_underscores=true
24
+
25
+module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
26
+
27
+suppress_type=$FlowIssue
28
+suppress_type=$FlowFixMe
29
+suppress_type=$FixMe
30
+
31
+suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
32
+
33
+unsafe.enable_getters_and_setters=true
34
+
35
+[version]
36
+^0.38.0

+ 27
- 24
.jshintignore 查看文件

1
-node_modules
2
-doc/example/libs
1
+# The following do not need to be checked because they do not represent JS
2
+# source code.
3
+doc/
4
+node_modules/
3
 lib-jitsi-meet.js
5
 lib-jitsi-meet.js
4
-lib-jitsi-meet.min.js
5
 lib-jitsi-meet.js.map
6
 lib-jitsi-meet.js.map
6
-doc
7
+lib-jitsi-meet.min.js
7
 
8
 
9
+# The following are checked by ESLint and take advantage of advanced language
10
+# features such as Facebook Flow which are not supported by JSHint.
11
+flow-typed/
8
 
12
 
9
-modules/xmpp/xmpp.js
10
-modules/xmpp/strophe.jingle.js
11
-modules/xmpp/SDPUtil.js
12
-modules/xmpp/SDP.js
13
-modules/xmpp/strophe.emuc.js
14
-modules/xmpp/JingleSessionPC.js
15
-modules/xmpp/LocalSSRCReplacement.js
16
-modules/xmpp/ChatRoom.js
17
-modules/xmpp/ChatRoom.js
18
-modules/statistics/RTPStatsCollector.js
19
-modules/statistics/LocalStatsCollector.js
13
+JitsiConference.js
14
+JitsiConnection.js
15
+JitsiMeetJS.js
16
+JitsiParticipant.js
17
+modules/RTC/JitsiLocalTrack.js
18
+modules/RTC/JitsiRemoteTrack.js
19
+modules/RTC/JitsiTrack.js
20
+modules/RTC/DataChannels.js
20
 modules/RTC/adapter.screenshare.js
21
 modules/RTC/adapter.screenshare.js
21
-modules/statistics/statistics.js
22
 modules/RTC/RTC.js
22
 modules/RTC/RTC.js
23
 modules/RTC/RTCUtils.js
23
 modules/RTC/RTCUtils.js
24
 modules/RTC/TraceablePeerConnection.js
24
 modules/RTC/TraceablePeerConnection.js
25
-modules/RTC/DataChannels.js
26
-modules/RTC/JitsiLocalTrack.js
27
-modules/RTC/JitsiRemoteTrack.js
28
-modules/RTC/JitsiTrack.js
29
-JitsiParticipant.js
30
-JitsiMeetJS.js
31
-JitsiConnection.js
32
-JitsiConference.js
25
+modules/statistics/LocalStatsCollector.js
26
+modules/statistics/RTPStatsCollector.js
27
+modules/statistics/statistics.js
28
+modules/xmpp/ChatRoom.js
29
+modules/xmpp/JingleSessionPC.js
30
+modules/xmpp/LocalSSRCReplacement.js
31
+modules/xmpp/SDP.js
32
+modules/xmpp/SDPUtil.js
33
+modules/xmpp/strophe.emuc.js
34
+modules/xmpp/strophe.jingle.js
35
+modules/xmpp/xmpp.js

+ 6
- 0
flow-typed/npm/flow-bin_v0.x.x.js 查看文件

1
+// flow-typed signature: 6a5610678d4b01e13bbfbbc62bdaf583
2
+// flow-typed version: 3817bc6980/flow-bin_v0.x.x/flow_>=v0.25.x
3
+
4
+declare module "flow-bin" {
5
+  declare module.exports: string;
6
+}

+ 4
- 1
package.json 查看文件

30
   },
30
   },
31
   "devDependencies": {
31
   "devDependencies": {
32
     "babel-core": "6.23.1",
32
     "babel-core": "6.23.1",
33
+    "babel-eslint": "7.1.1",
33
     "babel-loader": "6.3.2",
34
     "babel-loader": "6.3.2",
34
     "babel-polyfill": "6.23.0",
35
     "babel-polyfill": "6.23.0",
35
     "babel-preset-es2015": "6.22.0",
36
     "babel-preset-es2015": "6.22.0",
36
     "eslint": "3.16.1",
37
     "eslint": "3.16.1",
38
+    "eslint-plugin-flowtype": "2.30.0",
39
+    "flow-bin": "0.38.0",
37
     "jasmine-core": "2.5.2",
40
     "jasmine-core": "2.5.2",
38
     "jshint": "2.9.4",
41
     "jshint": "2.9.4",
39
     "karma": "0.13.22",
42
     "karma": "0.13.22",
46
   },
49
   },
47
   "scripts": {
50
   "scripts": {
48
     "install": "webpack -p",
51
     "install": "webpack -p",
49
-    "lint": "jshint . && eslint .",
52
+    "lint": "jshint . && eslint . && flow",
50
     "test": "karma start karma.conf.js",
53
     "test": "karma start karma.conf.js",
51
     "validate": "npm ls"
54
     "validate": "npm ls"
52
   },
55
   },

Loading…
取消
儲存