From 649159a8b04f23ed8c98abd983a09878ea4cc421 Mon Sep 17 00:00:00 2001 From: SimeonC <1085899+SimeonC@users.noreply.github.com> Date: Fri, 21 Jul 2023 15:36:00 +0900 Subject: [PATCH] fix: downgrade prettier to v2 See https://github.com/nrwl/nx/issues/17990 --- package-lock.json | 42 ++++++++++---------- package.json | 2 +- packages/eslint-plugin/src/shortestImport.ts | 23 +++++------ packages/nx/package.json | 2 +- packages/prettier-config/config.json | 2 + packages/prettier-config/package.json | 2 +- packages/utils/package.json | 2 +- 7 files changed, 36 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index 60d5c52b..ec67b217 100644 --- a/package-lock.json +++ b/package-lock.json @@ -61,7 +61,7 @@ "lodash": "^4.17.21", "nx": "16.5.0", "nx-cloud": "16.0.5", - "prettier": "^3.0.0", + "prettier": "2.8.8", "storybook": "^6.5.16", "type-fest": "3.12.0", "typescript": "5.1.6", @@ -27957,14 +27957,14 @@ } }, "node_modules/prettier": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz", - "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "bin": { - "prettier": "bin/prettier.cjs" + "prettier": "bin-prettier.js" }, "engines": { - "node": ">=14" + "node": ">=10.13.0" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -36336,11 +36336,11 @@ }, "packages/audit": { "name": "@tablecheck/frontend-audit", - "version": "0.0.1", + "version": "1.0.0", "license": "MIT", "dependencies": { "@clack/prompts": "^0.6.3", - "@tablecheck/frontend-utils": "^1.1.0", + "@tablecheck/frontend-utils": "^2.0.0", "@turingpointde/cvss.js": "^1.4.7", "chalk": "^4.1.2", "execa": "7.1.1", @@ -36379,7 +36379,7 @@ "@emotion/eslint-plugin": "^11.11.0", "@nx/eslint-plugin": "^16.5.0", "@tablecheck/eslint-plugin": "^1.2.2", - "@tablecheck/frontend-utils": "^1.1.0", + "@tablecheck/frontend-utils": "^2.0.0", "@typescript-eslint/eslint-plugin": "^5.58.0", "@typescript-eslint/parser": "^5.61.0", "eslint-config-airbnb": "^19.0.4", @@ -36416,7 +36416,7 @@ "version": "1.2.2", "license": "MIT", "dependencies": { - "@tablecheck/frontend-utils": "^1.1.0", + "@tablecheck/frontend-utils": "^2.0.0", "eslint-module-utils": "2.8.0" }, "devDependencies": { @@ -36437,7 +36437,7 @@ }, "packages/library": { "name": "@tablecheck/frontend-library", - "version": "0.0.1", + "version": "1.0.0", "license": "MIT", "dependencies": { "@babel/core": "^7.21.4", @@ -36448,7 +36448,7 @@ "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-node-resolve": "^15.0.2", "@rollup/plugin-typescript": "^11.1.0", - "@tablecheck/frontend-utils": "^1.1.0", + "@tablecheck/frontend-utils": "^2.0.0", "acorn-jsx": "^5.3.2", "address": "^1.2.2", "babel-plugin-polyfill-corejs2": "^0.3.3", @@ -36498,20 +36498,19 @@ }, "packages/nx": { "name": "@tablecheck/nx", - "version": "0.0.1", + "version": "1.0.0", "dependencies": { "@nx/devkit": "16.3.2", "@nx/linter": "16.3.2", "@tablecheck/eslint-config": "^1.8.2", - "@tablecheck/frontend-audit": "^0.0.1", - "@tablecheck/frontend-library": "^0.0.1", - "@tablecheck/frontend-utils": "^1.1.0", + "@tablecheck/frontend-library": "^1.0.0", + "@tablecheck/frontend-utils": "^2.0.0", "chalk": "^4.1.2", "execa": "7.1.1", "flat": "5.0.2", "fs-extra": "11.1.1", "lodash": "4.17.21", - "prettier": "3.0.0" + "prettier": "^2" }, "devDependencies": { "@types/flat": "5.0.2", @@ -37004,13 +37003,13 @@ }, "packages/prettier-config": { "name": "@tablecheck/prettier-config", - "version": "0.0.0", + "version": "1.0.0", "license": "MIT", "engines": { "node": ">= 16.16.0" }, "peerDependencies": { - "prettier": "^3" + "prettier": "^2" } }, "packages/semantic-release-config": { @@ -37029,16 +37028,15 @@ }, "packages/utils": { "name": "@tablecheck/frontend-utils", - "version": "1.1.0", + "version": "2.0.0", "license": "MIT", "dependencies": { "cosmiconfig": "^8.2.0", - "execa": "^7.1.1", "fs-extra": "^11.1.1", "glob": "^10.3.1", "jiti": "^1.18.2", "minimist": "^1.2.8", - "prettier": "^3.0.0", + "prettier": "^2", "prettier-package-json": "2.8.0" }, "devDependencies": { diff --git a/package.json b/package.json index 5d703c9d..40275b40 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "lodash": "^4.17.21", "nx": "16.5.0", "nx-cloud": "16.0.5", - "prettier": "^3.0.0", + "prettier": "2.8.8", "storybook": "^6.5.16", "type-fest": "3.12.0", "typescript": "5.1.6", diff --git a/packages/eslint-plugin/src/shortestImport.ts b/packages/eslint-plugin/src/shortestImport.ts index a3d02a4e..1b427cd8 100644 --- a/packages/eslint-plugin/src/shortestImport.ts +++ b/packages/eslint-plugin/src/shortestImport.ts @@ -52,22 +52,19 @@ export const shortestImport: TSESLint.RuleModule = { .readdirSync(path.join(path.dirname(filePath), baseUrl), { withFileTypes: true, }) - .reduce( - (directoryMap, dirrent) => { - if (dirrent.isDirectory()) - return { - ...directoryMap, - [dirrent.name]: path.join(baseUrl, dirrent.name), - }; + .reduce((directoryMap, dirrent) => { + if (dirrent.isDirectory()) return { ...directoryMap, - [dirrent.name.replace(/\.[^.]+$/gi, '')]: path - .join(baseUrl, dirrent.name) - .replace(/^\.\//gi, ''), + [dirrent.name]: path.join(baseUrl, dirrent.name), }; - }, - {} as Record, - ) + return { + ...directoryMap, + [dirrent.name.replace(/\.[^.]+$/gi, '')]: path + .join(baseUrl, dirrent.name) + .replace(/^\.\//gi, ''), + }; + }, {} as Record) : {}; const compilerPaths = Object.entries( config.compilerOptions.paths || {}, diff --git a/packages/nx/package.json b/packages/nx/package.json index 92dfe153..af825cec 100644 --- a/packages/nx/package.json +++ b/packages/nx/package.json @@ -33,7 +33,7 @@ "flat": "5.0.2", "fs-extra": "11.1.1", "lodash": "4.17.21", - "prettier": "3.0.0" + "prettier": "^2" }, "devDependencies": { "@types/flat": "5.0.2", diff --git a/packages/prettier-config/config.json b/packages/prettier-config/config.json index 1e8fc8e2..998d5646 100644 --- a/packages/prettier-config/config.json +++ b/packages/prettier-config/config.json @@ -1,5 +1,7 @@ { + "$schema": "http://json.schemastore.org/prettierrc", "singleQuote": true, + "trailingComma": "all", "overrides": [ { "files": ["**/*.css", "**/*.scss", "**/*.html"], diff --git a/packages/prettier-config/package.json b/packages/prettier-config/package.json index b2a0c72f..94f2c5a2 100644 --- a/packages/prettier-config/package.json +++ b/packages/prettier-config/package.json @@ -10,7 +10,7 @@ "version": "1.0.0", "main": "./config.json", "peerDependencies": { - "prettier": "^3" + "prettier": "^2" }, "engines": { "node": ">= 16.16.0" diff --git a/packages/utils/package.json b/packages/utils/package.json index 20679071..20133acb 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -31,7 +31,7 @@ "glob": "^10.3.1", "jiti": "^1.18.2", "minimist": "^1.2.8", - "prettier": "^3.0.0", + "prettier": "^2", "prettier-package-json": "2.8.0" }, "devDependencies": {