From 305d922c5a5c1caaa03415abe9ce32e446fd14bf Mon Sep 17 00:00:00 2001 From: Alexey Kolpakov Date: Thu, 25 Oct 2018 12:11:10 +0300 Subject: [PATCH] impr linter settings --- .eslintignore | 2 +- .eslintrc | 3 --- index.js | 2 +- lib/provider/offer.js | 2 +- package.json | 5 ++++- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.eslintignore b/.eslintignore index 81d8fdb..dbc64a9 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,2 @@ node_modules/* -files/* +config/* diff --git a/.eslintrc b/.eslintrc index dd9e590..e8f917d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -2,9 +2,6 @@ "extends": [ "google" ], - "plugins": [ - "mocha" - ], "rules": { "camelcase": 0, "comma-dangle": 0, diff --git a/index.js b/index.js index ee1d45e..9a0d430 100755 --- a/index.js +++ b/index.js @@ -39,7 +39,7 @@ async function run() { }, []); offers.forEach((x, idx) => queue.add(() => { - let t = x.toHtml().replace(/(Россия|Москва),\s*/g, ''); + const t = x.toHtml().replace(/(Россия|Москва),\s*/g, ''); return pRetry(() => sendHtmlMessage(t), {retries: 10, onFailedAttempt: (err) => console.warn(`idx: ${idx}, err: ${err.toString()}`)}) .catch((err) => { diff --git a/lib/provider/offer.js b/lib/provider/offer.js index fb76245..39a00ca 100644 --- a/lib/provider/offer.js +++ b/lib/provider/offer.js @@ -5,6 +5,6 @@ module.exports.Offer = class Offer { } } toHtml() { - throw 'Abstract class method "toHtml"!'; + throw new Error('Abstract class method "toHtml"!'); } }; diff --git a/package.json b/package.json index 556eae8..7f35537 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,11 @@ { "name": "cyanic", - "version": "1.0.3", + "version": "1.0.4", "main": "index.js", "license": "MIT", + "scripts": { + "lint": "./node_modules/.bin/eslint --ext .js ." + }, "dependencies": { "axios": "^0.18.0", "config": "^2.0.1",