Parcourir la source

Flow - A static type checker for JavaScript

dev1
Lyubo Marinov il y a 8 ans
Parent
révision
bfef62c1b1
5 fichiers modifiés avec 81 ajouts et 26 suppressions
  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 Voir le fichier

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

+ 36
- 0
.flowconfig Voir le fichier

@@ -0,0 +1,36 @@
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 Voir le fichier

@@ -1,32 +1,35 @@
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 5
 lib-jitsi-meet.js
4
-lib-jitsi-meet.min.js
5 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 21
 modules/RTC/adapter.screenshare.js
21
-modules/statistics/statistics.js
22 22
 modules/RTC/RTC.js
23 23
 modules/RTC/RTCUtils.js
24 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 Voir le fichier

@@ -0,0 +1,6 @@
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 Voir le fichier

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

Chargement…
Annuler
Enregistrer