From b4dfde23f4fbcd8d1fb71de798da834a3791a09b Mon Sep 17 00:00:00 2001 From: Ifedapo Olarewaju Date: Sun, 15 Jul 2018 13:30:56 +0100 Subject: [PATCH] build: lint companion from root + lint-stage for companion --- package.json | 6 ++++-- packages/@uppy/companion/.eslintignore | 7 +++---- packages/@uppy/companion/{.eslintrc => .eslintrc.json} | 0 packages/@uppy/companion/package.json | 4 +--- 4 files changed, 8 insertions(+), 9 deletions(-) rename packages/@uppy/companion/{.eslintrc => .eslintrc.json} (100%) diff --git a/package.json b/package.json index 900af9b1d..5c11e501f 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "name": "uppy-build", "description": "Extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:", "lint-staged": { - "*.js": "eslint" + "*.js": "eslint", + "packages/@uppy/companion/**/*.js": "eslint --ignore-path packages/@uppy/companion/.eslintignore -c packages/@uppy/companion/.eslintrc.json" }, "pre-commit": "lint-staged", "license": "MIT", @@ -87,6 +88,7 @@ "build": "npm-run-all --parallel build:js build:css --serial build:gzip size", "clean": "rm -rf packages/*/lib packages/@uppy/*/lib && rm -rf packages/uppy/dist", "lint:fix": "npm run lint -- --fix", + "lint:companion": "eslint --ignore-path packages/@uppy/companion/.eslintignore -c packages/@uppy/companion/.eslintrc.json packages/@uppy/companion/.", "lint": "eslint . --cache", "lint-staged": "lint-staged", "release": "./bin/release", @@ -101,7 +103,7 @@ "test:unit": "jest --testPathPattern=./src --coverage", "test:type": "tsc -p .", "test": "npm run lint && npm run test:unit && npm run test:type", - "test:companion": "cd ./packages/@uppy/companion && npm run test", + "test:companion": "npm run lint:companion && cd ./packages/@uppy/companion && npm run test", "test:watch": "jest --watch --testPathPattern=src", "travis:deletecache": "travis cache --delete", "watch:css": "onchange 'packages/**/*.scss' --initial --verbose -- npm run build:css", diff --git a/packages/@uppy/companion/.eslintignore b/packages/@uppy/companion/.eslintignore index c97d4cd3d..54ad1fdb4 100644 --- a/packages/@uppy/companion/.eslintignore +++ b/packages/@uppy/companion/.eslintignore @@ -1,4 +1,3 @@ -lib/** -node_modules/** -coverage/** -built/** +packages/@uppy/companion/lib +packages/@uppy/companion/node_modules +packages/@uppy/companion/coverage diff --git a/packages/@uppy/companion/.eslintrc b/packages/@uppy/companion/.eslintrc.json similarity index 100% rename from packages/@uppy/companion/.eslintrc rename to packages/@uppy/companion/.eslintrc.json diff --git a/packages/@uppy/companion/package.json b/packages/@uppy/companion/package.json index d1a96d4f1..d7ad04fb8 100644 --- a/packages/@uppy/companion/package.json +++ b/packages/@uppy/companion/package.json @@ -95,11 +95,9 @@ "scripts": { "build": "tsc -p .", "deploy": "kubectl apply -f infra/kube/companion-kube.yml", - "fix": "eslint . --fix", - "lint": "eslint .", "prepublishOnly": "npm run build", "start": "node ./lib/standalone/start-server.js", - "test": "/bin/bash -c 'npm run lint && npm run build && source env.test.sh && jest'", + "test": "/bin/bash -c 'npm run build && source env.test.sh && jest'", "test:watch": "npm test -- --watch" }, "engines": {