From afff6f67af1e755d9c225d8d2e432d91e9752602 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 19 May 2020 11:05:39 +0200 Subject: [PATCH] package: depend on spotify prettier config directly, and add eslint fix to commit hook --- package.json | 8 +++++++- prettier.config.js | 16 ---------------- yarn.lock | 5 +++++ 3 files changed, 12 insertions(+), 17 deletions(-) delete mode 100644 prettier.config.js diff --git a/package.json b/package.json index e5028bfd2f..7c4b2d518e 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "version": "1.0.0", "devDependencies": { "@spotify/eslint-config-oss": "^1.0.1", + "@spotify/prettier-config": "^7.0.0", "husky": "^4.2.3", "lerna": "^3.20.2", "lint-staged": "^10.1.0", @@ -43,9 +44,14 @@ "pre-commit": "lint-staged" } }, + "prettier": "@spotify/prettier-config", "lint-staged": { "*.{js,jsx,ts,tsx}": [ - "prettier --config ./prettier.config.js --list-different --write" + "eslint --fix", + "prettier --write" + ], + "*.{json,md}": [ + "prettier --write" ] } } diff --git a/prettier.config.js b/prettier.config.js deleted file mode 100644 index e12d35a880..0000000000 --- a/prettier.config.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2020 Spotify AB - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -module.exports = require('@spotify/web-scripts/config/prettier.config.js'); diff --git a/yarn.lock b/yarn.lock index 103fb2ab9d..7957553106 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2710,6 +2710,11 @@ resolved "https://registry.npmjs.org/@spotify/prettier-config/-/prettier-config-6.0.0.tgz#f3a72cf290af8f5b57e89fc65e6eaff8178a6e83" integrity sha512-lO/ykZ/GNtzH63mFzs1VeqOVNCZwQJyZm/PBNBZuYk3hnWOfDC8XA5G/D4opV/gxqkED5+Ek7LSAnPcQNv/wUA== +"@spotify/prettier-config@^7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@spotify/prettier-config/-/prettier-config-7.0.0.tgz#47750979d1282197295108b6958360660a955c16" + integrity sha512-lIMcx/2oDqTtW84iHKkRJe+8U6HK6GPwWH5sJp9UEHcDpdXomOQYvwcGXy2I2zwPQQ14gYYE6nEJuSnnYqsYRw== + "@spotify/tsconfig@^6.0.0": version "6.0.0" resolved "https://registry.npmjs.org/@spotify/tsconfig/-/tsconfig-6.0.0.tgz#bf9fd0b8188494d87ba6c172f0030376d2aa5dd8"