From d382d3cad11cac374e946869de67b12d98f55dcd Mon Sep 17 00:00:00 2001 From: Marc Stammerjohann <8985933+marcjulian@users.noreply.github.com> Date: Fri, 2 Feb 2024 19:27:29 +0100 Subject: [PATCH] format and organize imports --- .prettierrc | 3 ++- lib/custom/custom-prisma.module.ts | 2 +- lib/custom/custom-prisma.service.ts | 2 +- lib/index.ts | 6 ++--- package-lock.json | 42 ++++++++++++++++++++++++----- package.json | 3 ++- schematics/nestjs-prisma/index.ts | 18 ++++++------- schematics/prisma-init/index.ts | 2 +- 8 files changed, 54 insertions(+), 24 deletions(-) diff --git a/.prettierrc b/.prettierrc index a20502b..19dad0e 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,5 @@ { "singleQuote": true, - "trailingComma": "all" + "trailingComma": "all", + "plugins": ["prettier-plugin-organize-imports"] } diff --git a/lib/custom/custom-prisma.module.ts b/lib/custom/custom-prisma.module.ts index 88a3268..fb1e1bb 100644 --- a/lib/custom/custom-prisma.module.ts +++ b/lib/custom/custom-prisma.module.ts @@ -1,4 +1,4 @@ -import { DynamicModule, Module, Provider, Logger } from '@nestjs/common'; +import { DynamicModule, Logger, Module, Provider } from '@nestjs/common'; import { CustomPrismaClientFactory, CustomPrismaModuleAsyncOptions, diff --git a/lib/custom/custom-prisma.service.ts b/lib/custom/custom-prisma.service.ts index 8fec6f1..d20682d 100644 --- a/lib/custom/custom-prisma.service.ts +++ b/lib/custom/custom-prisma.service.ts @@ -1,5 +1,5 @@ -import { PrismaClientLike } from './custom-prisma-options'; import { Inject, Injectable } from '@nestjs/common'; +import { PrismaClientLike } from './custom-prisma-options'; import { CUSTOM_PRISMA_CLIENT } from './custom-prisma.constants'; @Injectable() diff --git a/lib/index.ts b/lib/index.ts index ac0ea27..316ad87 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -1,8 +1,8 @@ export * from './custom'; -export * from './prisma.module'; -export * from './prisma.service'; +export * from './interfaces'; export * from './logging.middleware'; export * from './prisma-client-exception.filter'; -export * from './interfaces'; export * from './prisma.constants'; +export * from './prisma.module'; +export * from './prisma.service'; diff --git a/package-lock.json b/package-lock.json index 9067289..d13ca60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,8 @@ "eslint-config-prettier": "9.0.0", "eslint-plugin-prettier": "5.0.1", "jasmine": "^3.6.3", - "prettier": "3.0.3", + "prettier": "3.2.3", + "prettier-plugin-organize-imports": "^3.2.4", "prisma": "^5.5.2", "reflect-metadata": "0.1.13", "rxjs": "^7.8.1", @@ -2883,9 +2884,9 @@ } }, "node_modules/prettier": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", - "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.3.tgz", + "integrity": "sha512-QNhUTBq+mqt1oH1dTfY3phOKNhcDdJkfttHI6u0kj7M2+c+7fmNKlgh2GhnHiqMcbxJ+a0j2igz/2jfl9QKLuw==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -2909,6 +2910,26 @@ "node": ">=6.0.0" } }, + "node_modules/prettier-plugin-organize-imports": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-3.2.4.tgz", + "integrity": "sha512-6m8WBhIp0dfwu0SkgfOxJqh+HpdyfqSSLfKKRZSFbDuEQXDDndb8fTpRWkUrX/uBenkex3MgnVk0J3b3Y5byog==", + "dev": true, + "peerDependencies": { + "@volar/vue-language-plugin-pug": "^1.0.4", + "@volar/vue-typescript": "^1.0.4", + "prettier": ">=2.0", + "typescript": ">=2.9" + }, + "peerDependenciesMeta": { + "@volar/vue-language-plugin-pug": { + "optional": true + }, + "@volar/vue-typescript": { + "optional": true + } + } + }, "node_modules/prisma": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.5.2.tgz", @@ -5736,9 +5757,9 @@ "dev": true }, "prettier": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", - "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.3.tgz", + "integrity": "sha512-QNhUTBq+mqt1oH1dTfY3phOKNhcDdJkfttHI6u0kj7M2+c+7fmNKlgh2GhnHiqMcbxJ+a0j2igz/2jfl9QKLuw==", "dev": true }, "prettier-linter-helpers": { @@ -5750,6 +5771,13 @@ "fast-diff": "^1.1.2" } }, + "prettier-plugin-organize-imports": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-3.2.4.tgz", + "integrity": "sha512-6m8WBhIp0dfwu0SkgfOxJqh+HpdyfqSSLfKKRZSFbDuEQXDDndb8fTpRWkUrX/uBenkex3MgnVk0J3b3Y5byog==", + "dev": true, + "requires": {} + }, "prisma": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.5.2.tgz", diff --git a/package.json b/package.json index 8ed63fd..6af371f 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,8 @@ "eslint-config-prettier": "9.0.0", "eslint-plugin-prettier": "5.0.1", "jasmine": "^3.6.3", - "prettier": "3.0.3", + "prettier": "3.2.3", + "prettier-plugin-organize-imports": "^3.2.4", "prisma": "^5.5.2", "reflect-metadata": "0.1.13", "rxjs": "^7.8.1", diff --git a/schematics/nestjs-prisma/index.ts b/schematics/nestjs-prisma/index.ts index 4dfae01..ec56ce7 100644 --- a/schematics/nestjs-prisma/index.ts +++ b/schematics/nestjs-prisma/index.ts @@ -1,27 +1,27 @@ -import { npmScripts } from './npm-scripts'; -import { Schema } from './schema'; +import { strings } from '@angular-devkit/core'; import { Rule, SchematicContext, - Tree, - chain, SchematicsException, - url, + Tree, apply, - template, + chain, mergeWith, + template, + url, } from '@angular-devkit/schematics'; import { NodePackageInstallTask, RunSchematicTask, } from '@angular-devkit/schematics/tasks'; import { - addPackageJsonDependency, NodeDependency, + addPackageJsonDependency, } from '@schematics/angular/utility/dependencies'; -import { strings } from '@angular-devkit/core'; +import { Dependency, dependencies } from './dependencies'; +import { npmScripts } from './npm-scripts'; +import { Schema } from './schema'; import { getLatestDependencyVersion } from './utils/get-latest-dependency-version'; -import { dependencies, Dependency } from './dependencies'; // You don't have to export the function as default. You can also have more than one rule factory // per file. diff --git a/schematics/prisma-init/index.ts b/schematics/prisma-init/index.ts index 408801d..f52a680 100644 --- a/schematics/prisma-init/index.ts +++ b/schematics/prisma-init/index.ts @@ -1,7 +1,7 @@ -import { DatasourceProvider } from './../nestjs-prisma/schema'; import { SchematicContext, Tree } from '@angular-devkit/schematics'; import { exec } from 'child_process'; import { Observable } from 'rxjs'; +import { DatasourceProvider } from './../nestjs-prisma/schema'; interface InitOptions { datasource: DatasourceProvider;