From 9193ec6a9dd9b91b36e3f57a5edc0e07326d66ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Herrera=20Guzm=C3=A1n?= Date: Fri, 23 Aug 2019 23:43:35 +0200 Subject: [PATCH] chore: simplify lint stage cycle --- CONTRIBUTING.md | 11 +---------- core/commons-api/package.json | 6 ------ core/file-locking/package.json | 6 ------ core/readme/package.json | 6 ------ core/streams/package.json | 6 ------ core/types/package.json | 6 ------ package.json | 8 +++++++- plugins/active-directory/package.json | 6 ------ plugins/audit/package.json | 6 ------ plugins/auth-memory/package.json | 6 ------ plugins/aws-s3-storage/package.json | 6 ------ plugins/google-cloud/package.json | 6 ------ plugins/htpasswd/package.json | 6 ------ plugins/local-storage/package.json | 6 ------ plugins/memory/package.json | 6 ------ tools/babel-preset/package.json | 6 ------ tools/eslint-config/package.json | 6 ------ tools/eslint-plugin-verdaccio/package.json | 6 ------ 18 files changed, 8 insertions(+), 107 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4872694c..aae53eb5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -244,16 +244,7 @@ Later, follow the next steps in the package recently imported: 2. Remove .npmignore (a blacklist file) and whitelist folders that should be packaged using `files` field. Also, provide `main` and `types` fields if necessary. 3. Update LICENSE year. 4. Update [`@verdaccio/eslint-config`](tools/eslint-config/package.json) and [`@verdaccio/babel-preset`](tools/babel-preset/package.json) packages to the latest version set in the monorepo and add caret (`^`). Also, remove Prettier stuff as its settings are provided by [`@verdaccio/eslint-config`](tools/eslint-config/rules/prettier.js). -5. Add `"lint:stage": "lint-staged"` script and lint-staged settings in package.json: - ```json - "lint-staged": { - "**/*.{js,ts}": [ - "eslint --fix", - "git add - ] - } - ``` -6. Follow the steps described in [Creating Packages](#creating-packages) to complete the flow. +5. Follow the steps described in [Creating Packages](#creating-packages) to complete the flow. ### Managing Dependencies diff --git a/core/commons-api/package.json b/core/commons-api/package.json index 08279197..1fe4b2db 100644 --- a/core/commons-api/package.json +++ b/core/commons-api/package.json @@ -36,11 +36,5 @@ "test": "jest", "type-check": "tsc --noEmit", "type-check:watch": "npm run type-check -- --watch" - }, - "lint-staged": { - "**/*.{js,ts}": [ - "eslint --fix", - "git add" - ] } } diff --git a/core/file-locking/package.json b/core/file-locking/package.json index 6c584bcc..5dff616c 100644 --- a/core/file-locking/package.json +++ b/core/file-locking/package.json @@ -38,11 +38,5 @@ "test": "jest", "type-check": "tsc --noEmit", "type-check:watch": "npm run type-check -- --watch" - }, - "lint-staged": { - "**/*.{ts,js}": [ - "eslint --fix", - "git add" - ] } } diff --git a/core/readme/package.json b/core/readme/package.json index 927af97d..872c70db 100644 --- a/core/readme/package.json +++ b/core/readme/package.json @@ -40,11 +40,5 @@ "test": "jest", "type-check": "tsc --noEmit", "type-check:watch": "npm run type-check -- --watch" - }, - "lint-staged": { - "**/*.{js,ts}": [ - "eslint --fix", - "git add" - ] } } diff --git a/core/streams/package.json b/core/streams/package.json index a56f20fe..d6d4ecab 100644 --- a/core/streams/package.json +++ b/core/streams/package.json @@ -35,11 +35,5 @@ "test": "jest", "type-check": "tsc --noEmit", "type-check:watch": "npm run type-check -- --watch" - }, - "lint-staged": { - "**/*.{js,ts}": [ - "eslint --fix", - "git add" - ] } } diff --git a/core/types/package.json b/core/types/package.json index 7b455a19..e288eebb 100644 --- a/core/types/package.json +++ b/core/types/package.json @@ -18,11 +18,5 @@ "lint": "eslint \"**/*.{js,ts}\"", "lint:stage": "lint-staged", "test": "tsc --noEmit" - }, - "lint-staged": { - "**/*.{js,ts}": [ - "eslint --fix", - "git add" - ] } } diff --git a/package.json b/package.json index 2cb6fea5..3c58b487 100644 --- a/package.json +++ b/package.json @@ -44,9 +44,15 @@ "husky": { "hooks": { "commit-msg": "commitlint -E HUSKY_GIT_PARAMS --verbose", - "pre-commit": "lerna run lint:stage" + "pre-commit": "lint-staged" } }, + "lint-staged": { + "**/*.{js,ts}": [ + "eslint --fix", + "git add" + ] + }, "commitlint": { "extends": [ "@commitlint/config-lerna-scopes" diff --git a/plugins/active-directory/package.json b/plugins/active-directory/package.json index ee2a7f30..0e713836 100644 --- a/plugins/active-directory/package.json +++ b/plugins/active-directory/package.json @@ -41,11 +41,5 @@ "test": "jest", "type-check": "tsc --noEmit", "type-check:watch": "npm run type-check -- --watch" - }, - "lint-staged": { - "**/*.{js,ts}": [ - "eslint --fix", - "git add" - ] } } diff --git a/plugins/audit/package.json b/plugins/audit/package.json index 6a478c26..e2758144 100644 --- a/plugins/audit/package.json +++ b/plugins/audit/package.json @@ -38,11 +38,5 @@ "test": "jest", "type-check": "tsc --noEmit", "type-check:watch": "npm run type-check -- --watch" - }, - "lint-staged": { - "**/*.{js,ts}": [ - "eslint --fix", - "git add" - ] } } diff --git a/plugins/auth-memory/package.json b/plugins/auth-memory/package.json index 00451da2..4f661b9a 100644 --- a/plugins/auth-memory/package.json +++ b/plugins/auth-memory/package.json @@ -36,11 +36,5 @@ "test": "jest", "type-check": "tsc --noEmit", "type-check:watch": "npm run type-check -- --watch" - }, - "lint-staged": { - "**/*.{js,ts}": [ - "eslint --fix", - "git add" - ] } } diff --git a/plugins/aws-s3-storage/package.json b/plugins/aws-s3-storage/package.json index 1e2d924a..77f1fc12 100644 --- a/plugins/aws-s3-storage/package.json +++ b/plugins/aws-s3-storage/package.json @@ -43,11 +43,5 @@ "@verdaccio/types": "^5.3.0", "cross-env": "5.2.0", "recursive-readdir": "2.2.2" - }, - "lint-staged": { - "**/*.{js,ts}": [ - "eslint --fix", - "git add" - ] } } diff --git a/plugins/google-cloud/package.json b/plugins/google-cloud/package.json index ca99937f..87a956d9 100644 --- a/plugins/google-cloud/package.json +++ b/plugins/google-cloud/package.json @@ -43,11 +43,5 @@ }, "optionalDependencies": { "fast-crc32c": "1.0.4" - }, - "lint-staged": { - "*.{ts, json}": [ - "eslint --fix", - "git add" - ] } } diff --git a/plugins/htpasswd/package.json b/plugins/htpasswd/package.json index 55b76a19..2eb2e539 100644 --- a/plugins/htpasswd/package.json +++ b/plugins/htpasswd/package.json @@ -51,11 +51,5 @@ "extends": [ "@commitlint/config-conventional" ] - }, - "lint-staged": { - "**/*.{js,ts}": [ - "eslint --fix", - "git add" - ] } } diff --git a/plugins/local-storage/package.json b/plugins/local-storage/package.json index 9646a913..bb05ac24 100644 --- a/plugins/local-storage/package.json +++ b/plugins/local-storage/package.json @@ -48,11 +48,5 @@ "test": "jest", "type-check": "tsc --noEmit", "type-check:watch": "npm run type-check -- --watch" - }, - "lint-staged": { - "**/*.{js,ts}": [ - "eslint --fix", - "git add" - ] } } diff --git a/plugins/memory/package.json b/plugins/memory/package.json index 195ad764..7809290d 100644 --- a/plugins/memory/package.json +++ b/plugins/memory/package.json @@ -39,11 +39,5 @@ "test": "jest", "type-check": "tsc --noEmit", "type-check:watch": "npm run type-check -- --watch" - }, - "lint-staged": { - "**/*.{js,ts}": [ - "eslint --fix", - "git add" - ] } } diff --git a/tools/babel-preset/package.json b/tools/babel-preset/package.json index a20b1d41..bb8f03d4 100644 --- a/tools/babel-preset/package.json +++ b/tools/babel-preset/package.json @@ -49,11 +49,5 @@ "scripts": { "lint": "eslint \"**/*.js\"", "lint:stage": "lint-staged" - }, - "lint-staged": { - "**/*.js": [ - "eslint --fix", - "git add" - ] } } diff --git a/tools/eslint-config/package.json b/tools/eslint-config/package.json index e7b73ea7..91105482 100644 --- a/tools/eslint-config/package.json +++ b/tools/eslint-config/package.json @@ -39,11 +39,5 @@ "lint": "eslint \"**/*.js\"", "lint:stage": "lint-staged", "test-prettier-rules": "eslint --print-config index.js | eslint-config-prettier-check" - }, - "lint-staged": { - "**/*.js": [ - "eslint --fix", - "git add" - ] } } diff --git a/tools/eslint-plugin-verdaccio/package.json b/tools/eslint-plugin-verdaccio/package.json index ad0cd889..08e5f4cd 100644 --- a/tools/eslint-plugin-verdaccio/package.json +++ b/tools/eslint-plugin-verdaccio/package.json @@ -24,11 +24,5 @@ "lint": "eslint \"**/*.js\"", "lint:stage": "lint-staged", "test": "mocha tests --recursive" - }, - "lint-staged": { - "**/*.js": [ - "eslint --fix", - "git add" - ] } }