diff --git a/.eslintrc b/.eslintrc index 789a89c3..3a11e64e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -39,8 +39,11 @@ "rules": { "babel/arrow-parens": [2, "as-needed"], + "babel/array-bracket-spacing": [2, "always"], + "babel/generator-star-spacing": [2, {"before": true, "after": false}], + "array-bracket-spacing": 0, + "generator-star-spacing": 0, - "array-bracket-spacing": [2, "always", {"arraysInArrays": false}], "arrow-spacing": 2, "block-scoped-var": 0, "brace-style": [2, "1tbs", {"allowSingleLine": true}], @@ -61,7 +64,6 @@ "eqeqeq": 2, "func-names": 0, "func-style": 0, - "generator-star-spacing": [2, {"before": true, "after": false}], "guard-for-in": 2, "handle-callback-err": [2, "error"], "id-length": 0, @@ -69,6 +71,7 @@ "indent": [2, 2, {"SwitchCase": 1}], "init-declarations": 0, "key-spacing": [2, {"beforeColon": false, "afterColon": true}], + "keyword-spacing": 2, "linebreak-style": 2, "lines-around-comment": 0, "max-depth": 0, @@ -100,7 +103,6 @@ "no-else-return": 2, "no-empty": 2, "no-empty-character-class": 2, - "no-empty-label": 2, "no-eq-null": 0, "no-eval": 2, "no-ex-assign": 2, @@ -121,7 +123,7 @@ "no-irregular-whitespace": 2, "no-iterator": 2, "no-label-var": 2, - "no-labels": 0, + "no-labels": [2, {"allowLoop": true}], "no-lone-blocks": 2, "no-lonely-if": 2, "no-loop-func": 0, @@ -174,17 +176,17 @@ "no-unused-vars": [2, {"vars": "all", "args": "after-used"}], "no-use-before-define": 0, "no-useless-call": 2, - "no-var": 0, + "no-var": 2, "no-void": 2, "no-warning-comments": 0, "no-with": 2, - "object-curly-spacing": [2, "always"], + "object-curly-spacing": [0, "always"], "object-shorthand": [2, "always"], "one-var": [2, "never"], "operator-assignment": [2, "always"], "operator-linebreak": [2, "after"], "padded-blocks": 0, - "prefer-const": 0, + "prefer-const": 2, "prefer-reflect": 0, "prefer-spread": 0, "quote-props": [2, "as-needed"], @@ -194,12 +196,10 @@ "semi": [2, "always"], "semi-spacing": [2, {"before": false, "after": true}], "sort-vars": 0, - "space-after-keywords": [2, "always"], "space-before-blocks": [2, "always"], "space-before-function-paren": [2, {"anonymous": "always", "named": "never"}], "space-in-parens": 0, "space-infix-ops": [2, {"int32Hint": false}], - "space-return-throw-case": 2, "space-unary-ops": [2, {"words": true, "nonwords": false}], "spaced-comment": [2, "always"], "strict": 0, diff --git a/package.json b/package.json index 6f057361..3870a50c 100644 --- a/package.json +++ b/package.json @@ -53,13 +53,13 @@ "devDependencies": { "babel": "5.8.21", "babel-core": "5.8.22", - "babel-eslint": "4.1.8", + "babel-eslint": "6.0.3", "babel-runtime": "5.8.20", "body-parser": "^1.14.0", "chai": "3.2.0", "coveralls": "2.11.4", - "eslint": "1.1.0", - "eslint-plugin-babel": "2.1.1", + "eslint": "2.8.0", + "eslint-plugin-babel": "3.2.0", "express": "4.13.3", "express3": "*", "flow-bin": "0.21.0", diff --git a/src/__tests__/http-test.js b/src/__tests__/http-test.js index d8a2a469..53858d0c 100644 --- a/src/__tests__/http-test.js +++ b/src/__tests__/http-test.js @@ -133,7 +133,7 @@ describe('test harness', () => { }); -[[ express4, 'modern' ], [ express3, 'old' ]].forEach(([ express, version ]) => { +[ [ express4, 'modern' ], [ express3, 'old' ] ].forEach(([ express, version ]) => { describe(`GraphQL-HTTP tests for ${version} mocha`, () => { describe('GET functionality', () => { it('allows GET with query param', async () => { @@ -207,7 +207,7 @@ describe('test harness', () => { const error = await catchError( request(app) .get(urlString({ - query: `{ test, unknownOne, unknownTwo }` + query: '{ test, unknownOne, unknownTwo }' })) ); diff --git a/src/index.js b/src/index.js index b94808c7..0d0bee9f 100644 --- a/src/index.js +++ b/src/index.js @@ -199,7 +199,7 @@ export default function graphqlHTTP(options: Options): Middleware { throw httpError( 405, `Can only perform a ${operationAST.operation} operation ` + - `from a POST request.` + 'from a POST request.' ); } }