style: format code

This commit is contained in:
cedoor
2022-05-24 19:32:15 +02:00
parent 7dca2264cd
commit 6dfe8265e5
51 changed files with 1145 additions and 1136 deletions

View File

@@ -1,13 +1,13 @@
import { getGreeting } from '../support/app.po';
import { getGreeting } from "../support/app.po"
describe('admin', () => {
beforeEach(() => cy.visit('/'));
describe("admin", () => {
beforeEach(() => cy.visit("/"))
it('should display welcome message', () => {
it("should display welcome message", () => {
// Custom command example, see `../support/commands.ts` file
cy.login('my-email@something.com', 'myPassword');
cy.login("my-email@something.com", "myPassword")
// Function helper example, see `../support/app.po.ts` file
getGreeting().contains('Welcome admin');
});
});
getGreeting().contains("Welcome admin")
})
})

View File

@@ -1 +1 @@
export const getGreeting = () => cy.get('h1');
export const getGreeting = () => cy.get("h1")

View File

@@ -12,14 +12,14 @@
declare namespace Cypress {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Chainable<Subject> {
login(email: string, password: string): void;
login(email: string, password: string): void
}
}
//
// -- This is a parent command --
Cypress.Commands.add('login', (email, password) => {
console.log('Custom command example: Login', email, password);
});
Cypress.Commands.add("login", (email, password) => {
console.log("Custom command example: Login", email, password)
})
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })

View File

@@ -14,4 +14,4 @@
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands';
import "./commands"

View File

@@ -1,11 +1,11 @@
/* eslint-disable */
export default {
displayName: 'admin',
preset: '../../jest.preset.js',
displayName: "admin",
preset: "../../jest.preset.js",
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
'^.+\\.[tj]sx?$': 'babel-jest',
"^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "@nrwl/react/plugins/jest",
"^.+\\.[tj]sx?$": "babel-jest"
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/admin',
};
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
coverageDirectory: "../../coverage/apps/admin"
}

View File

@@ -15,7 +15,10 @@
"main": "apps/admin/src/main.tsx",
"polyfills": "apps/admin/src/polyfills.ts",
"tsConfig": "apps/admin/tsconfig.app.json",
"assets": ["apps/admin/src/favicon.ico", "apps/admin/src/assets"],
"assets": [
"apps/admin/src/favicon.ico",
"apps/admin/src/assets"
],
"styles": [],
"scripts": [],
"webpackConfig": "@nrwl/react/plugins/webpack"

View File

@@ -1,27 +1,27 @@
import { render } from '@testing-library/react';
import { render } from "@testing-library/react"
import { BrowserRouter } from 'react-router-dom';
import { BrowserRouter } from "react-router-dom"
import App from './app';
import App from "./app"
describe('App', () => {
it('should render successfully', () => {
describe("App", () => {
it("should render successfully", () => {
const { baseElement } = render(
<BrowserRouter>
<App />
</BrowserRouter>
);
)
expect(baseElement).toBeTruthy();
});
expect(baseElement).toBeTruthy()
})
it('should have a greeting as the title', () => {
it("should have a greeting as the title", () => {
const { getByText } = render(
<BrowserRouter>
<App />
</BrowserRouter>
);
)
expect(getByText(/Welcome admin/gi)).toBeTruthy();
});
});
expect(getByText(/Welcome admin/gi)).toBeTruthy()
})
})

View File

@@ -1,6 +1,6 @@
import NxWelcome from './nx-welcome';
import NxWelcome from "./nx-welcome"
import { Route, Routes, Link } from 'react-router-dom';
import { Route, Routes, Link } from "react-router-dom"
export function App() {
return (
@@ -29,7 +29,7 @@ export function App() {
path="/"
element={
<div>
This is the generated root route.{' '}
This is the generated root route.{" "}
<Link to="/page-2">Click here for page 2.</Link>
</div>
}
@@ -38,14 +38,16 @@ export function App() {
path="/page-2"
element={
<div>
<Link to="/">Click here to go back to root page.</Link>
<Link to="/">
Click here to go back to root page.
</Link>
</div>
}
/>
</Routes>
{/* END: routes */}
</>
);
)
}
export default App;
export default App

View File

@@ -410,7 +410,7 @@ export function NxWelcome({ title }: { title: string }) {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
`,
`
}}
/>
<div className="wrapper">
@@ -681,12 +681,14 @@ export function NxWelcome({ title }: { title: string }) {
</svg>
<h2>
NxCloud
<span>Enable faster CI & better DX</span>
<span>
Enable faster CI & better DX
</span>
</h2>
</div>
<p>
You can activate distributed tasks executions and caching by
running:
You can activate distributed tasks
executions and caching by running:
</p>
<pre>nx connect-to-nx-cloud</pre>
<a
@@ -694,8 +696,8 @@ export function NxWelcome({ title }: { title: string }) {
target="_blank"
rel="noreferrer"
>
{' '}
What is Nx Cloud?{' '}
{" "}
What is Nx Cloud?{" "}
</a>
</div>
<a
@@ -785,7 +787,9 @@ export function NxWelcome({ title }: { title: string }) {
Run affected commands
</summary>
<pre>
<span># see what&apos;s been affected by changes</span>
<span>
# see what&apos;s been affected by changes
</span>
nx affected:graph
<span># run tests for current changes</span>
nx affected:test
@@ -814,7 +818,7 @@ export function NxWelcome({ title }: { title: string }) {
</div>
</div>
</>
);
)
}
export default NxWelcome;
export default NxWelcome

View File

@@ -1,3 +1,3 @@
export const environment = {
production: true,
};
production: true
}

View File

@@ -2,5 +2,5 @@
// When building for production, this file is replaced with `environment.prod.ts`.
export const environment = {
production: false,
};
production: false
}

View File

@@ -1,16 +1,14 @@
import { StrictMode } from 'react';
import * as ReactDOM from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';
import { StrictMode } from "react"
import * as ReactDOM from "react-dom/client"
import { BrowserRouter } from "react-router-dom"
import App from './app/app';
import App from "./app/app"
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement)
root.render(
<StrictMode>
<BrowserRouter>
<App />
</BrowserRouter>
</StrictMode>
);
)

View File

@@ -3,5 +3,5 @@
*
* See: https://github.com/zloirock/core-js#babel
*/
import 'core-js/stable';
import 'regenerator-runtime/runtime';
import "core-js/stable"
import "regenerator-runtime/runtime"

View File

@@ -1,16 +1,16 @@
/* eslint-disable */
export default {
displayName: 'api',
preset: '../../jest.preset.js',
displayName: "api",
preset: "../../jest.preset.js",
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
"ts-jest": {
tsconfig: "<rootDir>/tsconfig.spec.json"
}
},
},
testEnvironment: 'node',
testEnvironment: "node",
transform: {
'^.+\\.[tj]s$': 'ts-jest',
"^.+\\.[tj]s$": "ts-jest"
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/apps/api',
};
moduleFileExtensions: ["ts", "js", "html"],
coverageDirectory: "../../coverage/apps/api"
}

View File

@@ -1,22 +1,24 @@
import { Test, TestingModule } from '@nestjs/testing';
import { Test, TestingModule } from "@nestjs/testing"
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { AppController } from "./app.controller"
import { AppService } from "./app.service"
describe('AppController', () => {
let app: TestingModule;
describe("AppController", () => {
let app: TestingModule
beforeAll(async () => {
app = await Test.createTestingModule({
controllers: [AppController],
providers: [AppService],
}).compile();
});
providers: [AppService]
}).compile()
})
describe('getData', () => {
describe("getData", () => {
it('should return "Welcome to api!"', () => {
const appController = app.get<AppController>(AppController);
expect(appController.getData()).toEqual({ message: 'Welcome to api!' });
});
});
});
const appController = app.get<AppController>(AppController)
expect(appController.getData()).toEqual({
message: "Welcome to api!"
})
})
})
})

View File

@@ -1,6 +1,6 @@
import { Controller, Get } from '@nestjs/common';
import { Controller, Get } from "@nestjs/common"
import { AppService } from './app.service';
import { AppService } from "./app.service"
@Controller()
export class AppController {
@@ -8,6 +8,6 @@ export class AppController {
@Get()
getData() {
return this.appService.getData();
return this.appService.getData()
}
}

View File

@@ -1,11 +1,11 @@
import { Module } from '@nestjs/common';
import { Module } from "@nestjs/common"
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { AppController } from "./app.controller"
import { AppService } from "./app.service"
@Module({
imports: [],
controllers: [AppController],
providers: [AppService],
providers: [AppService]
})
export class AppModule {}

View File

@@ -1,21 +1,21 @@
import { Test } from '@nestjs/testing';
import { Test } from "@nestjs/testing"
import { AppService } from './app.service';
import { AppService } from "./app.service"
describe('AppService', () => {
let service: AppService;
describe("AppService", () => {
let service: AppService
beforeAll(async () => {
const app = await Test.createTestingModule({
providers: [AppService],
}).compile();
providers: [AppService]
}).compile()
service = app.get<AppService>(AppService);
});
service = app.get<AppService>(AppService)
})
describe('getData', () => {
describe("getData", () => {
it('should return "Welcome to api!"', () => {
expect(service.getData()).toEqual({ message: 'Welcome to api!' });
});
});
});
expect(service.getData()).toEqual({ message: "Welcome to api!" })
})
})
})

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { Injectable } from "@nestjs/common"
@Injectable()
export class AppService {
getData(): { message: string } {
return { message: 'Welcome to api!' };
return { message: "Welcome to api!" }
}
}

View File

@@ -1,3 +1,3 @@
export const environment = {
production: true,
};
production: true
}

View File

@@ -1,3 +1,3 @@
export const environment = {
production: false,
};
production: false
}

View File

@@ -3,20 +3,20 @@
* This is only a minimal backend to get started.
*/
import { Logger } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { Logger } from "@nestjs/common"
import { NestFactory } from "@nestjs/core"
import { AppModule } from './app/app.module';
import { AppModule } from "./app/app.module"
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const globalPrefix = 'api';
app.setGlobalPrefix(globalPrefix);
const port = process.env.PORT || 3333;
await app.listen(port);
const app = await NestFactory.create(AppModule)
const globalPrefix = "api"
app.setGlobalPrefix(globalPrefix)
const port = process.env.PORT || 3333
await app.listen(port)
Logger.log(
`🚀 Application is running on: http://localhost:${port}/${globalPrefix}`
);
)
}
bootstrap();
bootstrap()

View File

@@ -1,5 +1,5 @@
import { getJestProjects } from '@nrwl/jest';
import { getJestProjects } from "@nrwl/jest"
export default {
projects: getJestProjects(),
};
projects: getJestProjects()
}

View File

@@ -1,3 +1,3 @@
const nxPreset = require('@nrwl/jest/preset').default;
const nxPreset = require("@nrwl/jest/preset").default
module.exports = { ...nxPreset };
module.exports = { ...nxPreset }