diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..9e9b5b9 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,27 @@ +module.exports = { + extends: 'airbnb-base', + env: { + 'browser': true, + 'mocha': true, + 'node': true + }, + rules: { + 'class-methods-use-this': 'off', + 'comma-dangle': ['error', 'never'], + 'consistent-return': 'off', + 'func-names': 'off', + 'import/no-extraneous-dependencies': 'off', + 'import/no-unresolved': 'off', + 'max-len': 'off', + 'no-bitwise': 'off', + 'no-continue': 'off', + 'no-empty': 'off', + 'no-multi-assign': 'off', + 'no-new': 'off', + 'no-param-reassign': 'off', + 'no-plusplus': 'off', + 'no-restricted-syntax': 'off', + 'no-underscore-dangle': 'off', + 'no-use-before-define': 'off' + } +}; diff --git a/.travis.yml b/.travis.yml index a170b52..8f46ac3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,11 @@ node_js: - 6 - 8 - 'stable' + +script: + - npm run lint + - npm run test + notifications: email: recipients: diff --git a/package.json b/package.json index 48bb972..a2d513e 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "node": ">= 6" }, "scripts": { + "lint": "eslint src/ test/ bin/", "test": "scripts/test", "prepublish": "scripts/prepublish" }, @@ -20,6 +21,9 @@ }, "devDependencies": { "chai": "4.1.2", + "eslint": "4.19.0", + "eslint-config-airbnb-base": "12.1.0", + "eslint-plugin-import": "2.9.0", "mocha": "6.0.0" }, "keywords": [