if you save a file in your project, the IDE should "autoformat" the file following a given ruleset (ESLint and Prettier configurations).
Example of adding semicolons on save:
| package com.holnor.moviedatabase.controller; | |
| import com.holnor.moviedatabase.dto.CreateMovieCommand; | |
| import com.holnor.moviedatabase.dto.MovieDetailsItem; | |
| import com.holnor.moviedatabase.dto.MovieListItem; | |
| import com.holnor.moviedatabase.service.MovieService; | |
| import jakarta.validation.Valid; | |
| import org.springframework.dao.DataIntegrityViolationException; | |
| import org.springframework.http.HttpStatus; | |
| import org.springframework.http.ResponseEntity; |
| sysctl -n hw.ncpu |
| # shows what would be removed, but not removing anything | |
| git clean -d -n | |
| # removes files and folders | |
| git clean -d -f |
| const xlsx = require('xlsx'); | |
| const deleteWorksheet = (filePath, workSheetName) => { | |
| const workBook = xlsx.readFile(filePath); | |
| const workSheetNames = Object.keys(workBook.Sheets); | |
| if (workSheetNames.includes(workSheetName)) { | |
| delete workBook.Sheets[workSheetName]; | |
| delete workBook.SheetNames[workSheetName]; | |
| indexToDelete = workBook.SheetNames.indexOf(workSheetName); |
| ``` | |
| git checkout feature/TICKET-123 | |
| git merge master | |
| git reset master | |
| git add . | |
| git commit -m "TICKET-123 add something" | |
| git push -f origin feature/TICKET-123 | |
| ``` |
| import { Request, Response } from "express"; | |
| import { findAllUsers } from "../services/userService"; | |
| export default function getAllUsers(request: Request, response: Response) { | |
| const users = findAllUsers(); | |
| response.statusCode = 200; | |
| response.send().json({ users }); | |
| } |
| import { Request, Response } from 'express'; | |
| import GetAllUsers from './getAllUsers'; | |
| describe('Get all users request', () => { | |
| let mockRequest: Partial<Request>; | |
| let mockResponse: Partial<Response>; | |
| let responseObject = {}; | |
| beforeEach(() => { | |
| mockRequest = { |
| const express = require('express'); | |
| const router = express.Router(); | |
| router.get('/excel/example', (request, response) => { | |
| response.download('./excelFiles/foods.xlsx', 'example.xlsx'); | |
| }); | |
| module.exports = router; |
| export type User = { | |
| name: string, | |
| age: number, | |
| roles: Role[]; | |
| } | |
| export function isValidUser(user: unknown): user is User { | |
| return !!(user as User).name && | |
| !!(user as User).age && | |
| !!(user as User).roles && |