From c1a6b5a9405dbdb372c2fbabdc20c5ed4e4e2cae Mon Sep 17 00:00:00 2001 From: Igor Gassmann Date: Wed, 20 Dec 2017 17:05:00 -0300 Subject: [PATCH] Fix and update Prettier and ESLint scripts --- .lintstagedrc | 12 ++++++++++++ package.json | 10 ++-------- 2 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 .lintstagedrc diff --git a/.lintstagedrc b/.lintstagedrc new file mode 100644 index 000000000..bd9f228ce --- /dev/null +++ b/.lintstagedrc @@ -0,0 +1,12 @@ +{ + "linters": { + "src/**/*.{js,jsx,scss,json}": [ + "prettier --write", + "git add" + ], + "src/**/*.{js,jsx}": [ + "eslint --fix", + "git add" + ] + } +} diff --git a/package.json b/package.json index 7eb2ebffe..5c0a7acd9 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,8 @@ "build": "yarn compile && electron-builder build", "postinstall": "electron-builder install-app-deps", "precommit": "lint-staged", - "lint": "eslint src/", - "pretty": "prettier src/ --write" + "lint": "eslint src/**/*.{js,jsx} --fix", + "pretty": "prettier src/**/*.{js,jsx,scss,json} --write" }, "keywords": [ "lbry" @@ -108,12 +108,6 @@ "yarn": "^1.3" }, "license": "MIT", - "lint-staged": { - "src/**/*.{js,jsx}": [ - "prettier --write", - "git add" - ] - }, "lbrySettings": { "lbrynetDaemonVersion": "0.18.0", "lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-daemon-vDAEMONVER-OSNAME.zip"