Skip to content

Commit 572bbda

Browse files
committed
Update all dependencies, include flow-specific lint handling
1 parent 0618077 commit 572bbda

File tree

4 files changed

+27
-20
lines changed

4 files changed

+27
-20
lines changed

.eslintrc

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"parser": "babel-eslint",
33

44
"plugins": [
5-
"babel"
5+
"babel",
6+
"flowtype",
7+
"flow-vars"
68
],
79

810
"env": {
@@ -44,6 +46,11 @@
4446
"array-bracket-spacing": 0,
4547
"generator-star-spacing": 0,
4648

49+
"flowtype/space-after-type-colon": [2, "always"],
50+
"flowtype/space-before-type-colon": [2, "never"],
51+
"flow-vars/define-flow-type": 2,
52+
"flow-vars/use-flow-type": 2,
53+
4754
"arrow-spacing": 2,
4855
"block-scoped-var": 0,
4956
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
@@ -155,7 +162,7 @@
155162
"no-return-assign": 2,
156163
"no-script-url": 2,
157164
"no-self-compare": 0,
158-
"no-sequences": 2,
165+
"no-sequences": 0,
159166
"no-shadow": 2,
160167
"no-shadow-restricted-names": 2,
161168
"no-spaced-func": 2,

package.json

+13-11
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,25 @@
3838
"babel-runtime": ">=6.0.0"
3939
},
4040
"devDependencies": {
41-
"babel-cli": "6.6.5",
42-
"babel-eslint": "6.0.2",
43-
"babel-plugin-syntax-async-functions": "6.5.0",
44-
"babel-plugin-transform-class-properties": "6.6.0",
45-
"babel-plugin-transform-flow-strip-types": "6.7.0",
46-
"babel-plugin-transform-object-rest-spread": "6.6.5",
47-
"babel-plugin-transform-regenerator": "6.6.5",
48-
"babel-plugin-transform-runtime": "6.6.0",
41+
"babel-cli": "6.9.0",
42+
"babel-eslint": "6.0.4",
43+
"babel-plugin-syntax-async-functions": "6.8.0",
44+
"babel-plugin-transform-class-properties": "6.9.1",
45+
"babel-plugin-transform-flow-strip-types": "6.8.0",
46+
"babel-plugin-transform-object-rest-spread": "6.8.0",
47+
"babel-plugin-transform-regenerator": "6.9.0",
48+
"babel-plugin-transform-runtime": "6.9.0",
4949
"babel-preset-es2015": "6.6.0",
5050
"chai": "3.5.0",
5151
"chai-subset": "1.2.2",
5252
"coveralls": "2.11.9",
53-
"eslint": "2.7.0",
53+
"eslint": "2.11.1",
5454
"eslint-plugin-babel": "3.2.0",
55-
"flow-bin": "0.22.1",
55+
"eslint-plugin-flow-vars": "^0.4.0",
56+
"eslint-plugin-flowtype": "2.2.7",
57+
"flow-bin": "0.26.0",
5658
"isparta": "4.0.0",
57-
"mocha": "2.4.5",
59+
"mocha": "2.5.3",
5860
"sane": "1.3.4"
5961
}
6062
}

src/language/lexer.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -193,22 +193,19 @@ function readToken(source: Source, fromPosition: number): Token {
193193
case 124: return makeToken(TokenKind.PIPE, position, position + 1);
194194
// }
195195
case 125: return makeToken(TokenKind.BRACE_R, position, position + 1);
196-
// A-Z
196+
// A-Z _ a-z
197197
case 65: case 66: case 67: case 68: case 69: case 70: case 71: case 72:
198198
case 73: case 74: case 75: case 76: case 77: case 78: case 79: case 80:
199199
case 81: case 82: case 83: case 84: case 85: case 86: case 87: case 88:
200200
case 89: case 90:
201-
// _
202201
case 95:
203-
// a-z
204202
case 97: case 98: case 99: case 100: case 101: case 102: case 103: case 104:
205203
case 105: case 106: case 107: case 108: case 109: case 110: case 111:
206204
case 112: case 113: case 114: case 115: case 116: case 117: case 118:
207205
case 119: case 120: case 121: case 122:
208206
return readName(source, position);
209-
// -
207+
// - 0-9
210208
case 45:
211-
// 0-9
212209
case 48: case 49: case 50: case 51: case 52:
213210
case 53: case 54: case 55: case 56: case 57:
214211
return readNumber(source, position, code);

src/language/parser.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,11 @@ function parseDefinition(parser: Parser): Definition {
204204

205205
if (peek(parser, TokenKind.NAME)) {
206206
switch (parser.token.value) {
207+
// Note: subscription is an experimental non-spec addition.
207208
case 'query':
208209
case 'mutation':
209-
// Note: subscription is an experimental non-spec addition.
210-
case 'subscription': return parseOperationDefinition(parser);
210+
case 'subscription':
211+
return parseOperationDefinition(parser);
211212

212213
case 'fragment': return parseFragmentDefinition(parser);
213214

0 commit comments

Comments
 (0)