From db94a62649deeb5342c9b84c7e15365c9430ffea Mon Sep 17 00:00:00 2001 From: Julius Tens Date: Thu, 27 Feb 2020 11:30:26 +0100 Subject: [PATCH] add basic linter setup --- .eslintrc.json | 28 ++++++++++++++++++++++++++++ .travis.yml | 2 +- package.json | 2 ++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..75300be2 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,28 @@ +{ + "env": { + "commonjs": true, + "es6": true, + "node": true + }, + "extends": "eslint:recommended", + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "ignorePatterns": ["node_modules", "test", "*example.js"], + "parserOptions": { + "ecmaVersion": 2018 + }, + "rules": { + "no-irregular-whitespace": "off", + "no-mixed-spaces-and-tabs": "off", + "no-unused-vars": [ + "error", + { + "vars": "all", + "args": "none", + "ignoreRestSiblings": false + } + ] + } +} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 7ee1e933..1d9d8efa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ node_js: - 'lts/*' - '10' cache: npm -script: npm test +script: npm run lint && npm test jobs: include: - name: e2e-test diff --git a/package.json b/package.json index 72bffbf9..6902a38f 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ }, "devDependencies": { "db-stations": "^3.0.0", + "eslint": "^6.8.0", "is-coordinates": "^2.0.2", "is-roughly-equal": "^0.1.0", "tap-spec": "^5.0.0", @@ -67,6 +68,7 @@ }, "scripts": { "e2e-test": "env NODE_ENV=dev node test/e2e/index.js | tap-spec", + "lint": "eslint .", "test": "env NODE_ENV=dev node test/index.js | tap-spec", "prepublishOnly": "npm test && npm run e2e-test" }