From 31c531f151c3676dc33e9e66516c7bee7f0a6cf4 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Fri, 24 May 2019 19:04:47 +0300 Subject: [PATCH] Use own package to lint code --- .eslintrc.js | 26 ++++++++++++++++++++++++++ .travis.yml | 1 + package.json | 4 +++- yarn.lock | 9 +++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..0e745bd --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,26 @@ +module.exports = { + extends: [ + 'plugin:@elyby/config', + ], + + env: { + node: true, + es6: true, + }, + + settings: { + react: { + // Override these settings to avoid a wall of warnings + version: 'latest', + }, + }, + + overrides: [ + { + files: ['src/configs/*.ts'], + rules: { + 'quote-props': 'off', + }, + }, + ], +}; diff --git a/.travis.yml b/.travis.yml index ad23ff1..3a59225 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ cache: script: - yarn tsc + - yarn lint - yarn test - yarn build diff --git a/package.json b/package.json index d6e0c63..ade99ac 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ }, "scripts": { "build": "babel src -d lib --extensions .ts,.js", - "test": "jest" + "test": "jest", + "lint": "eslint \"{src,tests}/**/*.{js,ts}\"" }, "dependencies": { "@typescript-eslint/eslint-plugin": "^1.9.0", @@ -34,6 +35,7 @@ "@babel/core": "^7.4.5", "@babel/preset-env": "^7.4.4", "@babel/preset-typescript": "^7.3.3", + "@elyby/eslint-plugin": "^0.1.0", "@types/eslint": "^4.16.6", "@types/estree": "^0.0.39", "@types/node": "^12.0.2", diff --git a/yarn.lock b/yarn.lock index 2a12ff7..01445e0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -666,6 +666,15 @@ exec-sh "^0.3.2" minimist "^1.2.0" +"@elyby/eslint-plugin@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@elyby/eslint-plugin/-/eslint-plugin-0.1.0.tgz#02e1860b8d176dca8dac982e2d3b1837dd6ad293" + integrity sha512-P/mv8wj6E3YbdR7N+f/pPWDZlKIHvVHH7ruOjyRMuGElMWnXycFv3tqA0xJgPE1gTCaa8NYg6jbk6Q8l/d/7xw== + dependencies: + "@typescript-eslint/eslint-plugin" "^1.9.0" + "@typescript-eslint/parser" "^1.9.0" + eslint-plugin-react "^7.13.0" + "@jest/console@^24.7.1": version "24.7.1" resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545"