Skip to content

Commit

Permalink
Set up eslint and fix a small number of issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sashko-stripe committed Nov 12, 2018
1 parent 0ff1824 commit ee62a37
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
extends: "eslint:recommended",
parserOptions: {
ecmaVersion: 2018,
sourceType: "module"
},
env: {
mocha: true,
node: true,
es6: true,
}
};
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ install:
- npm install

script:
- npm test
- npm run lint && npm test

# Allow Travis tests to run in containers.
sudo: false
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"test": "tav --ci && mocha test/index.js",
"prepublish": "babel ./src --ignore test --out-dir ./lib",
"pretest": "node test/updateSchemaJson.js",
"tav": "tav"
"tav": "tav",
"lint": "eslint src/**/*.js test/**/*.js"
},
"homepage": "https://github.com/apollostack/eslint-plugin-graphql",
"repository": {
Expand Down
3 changes: 1 addition & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
import {
flatten,
keys,
last,
reduce,
without,
includes,
Expand Down Expand Up @@ -383,7 +382,7 @@ function handleTemplateTag(node, context, schema, env, validators) {
text = replaceExpressions(node.quasi, context, env);
} catch (e) {
if (e.message !== 'Invalid interpolation') {
console.log(e);
console.log(e); // eslint-disable-line no-console
}
return;
}
Expand Down

0 comments on commit ee62a37

Please sign in to comment.