├── .gitignore ├── .dockerignore ├── .env ├── src ├── index.ts ├── enum │ ├── code.enum.ts │ └── status.enum.ts ├── interface │ └── patient.ts ├── routes │ └── patient.routes.ts ├── config │ └── mysql.config.ts ├── domain │ └── response.ts ├── query │ └── patient.query.ts ├── app.ts └── controller │ └── patient.controller.ts ├── Dockerfile ├── package.json ├── docker-compose.yml ├── dbinit └── init.sql └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | Dockerfile 3 | docker-compose.yml 4 | .gitignore 5 | .env 6 | .gitignore 7 | .git 8 | .dockerignore 9 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | DB_HOST=localhost 2 | DB_USER=root 3 | DB_PASSWORD=letmein 4 | DB_NAME=patientsdb 5 | DB_CONNECTION_LIMIT=10 6 | DB_PORT=3306 7 | SERVER_PORT=5000 8 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from './app'; 2 | 3 | const start = (): void => { 4 | const app = new App(); 5 | app.listen(); 6 | } 7 | 8 | start(); 9 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:17.2.0 2 | WORKDIR /usr/code 3 | COPY package.json . 4 | RUN npm install 5 | COPY . . 6 | EXPOSE 3000 7 | CMD ["npm", "run", "start:prod"] 8 | -------------------------------------------------------------------------------- /src/enum/code.enum.ts: -------------------------------------------------------------------------------- 1 | export enum Code { 2 | OK = 200, 3 | NOT_FOUND = 404, 4 | BAD_REQUEST = 400, 5 | CREATED = 201, 6 | INTERNAL_SERVER_ERROR = 500 7 | } -------------------------------------------------------------------------------- /src/enum/status.enum.ts: -------------------------------------------------------------------------------- 1 | export enum Status { 2 | OK = 'OK', 3 | NOT_FOUND = 'NOT_FOUND', 4 | BAD_REQUEST = 'BAD_REQUEST', 5 | CREATED = 'CREATED', 6 | INTERNAL_SERVER_ERROR = 'INTERNAL_SERVER_ERROR', 7 | } 8 | -------------------------------------------------------------------------------- /src/interface/patient.ts: -------------------------------------------------------------------------------- 1 | export interface Patient { 2 | id: number; 3 | first_name: string; 4 | last_name: string; 5 | email: string; 6 | phone: string; 7 | address: string; 8 | diagnosis: string; 9 | image_url: string; 10 | created_at: Date; 11 | } -------------------------------------------------------------------------------- /src/routes/patient.routes.ts: -------------------------------------------------------------------------------- 1 | import { Router } from 'express'; 2 | import { createPatient, deletePatient, getPatient, getPatients, updatePatient } from '../controller/patient.controller'; 3 | 4 | const patientRoutes = Router(); 5 | 6 | patientRoutes.route('/') 7 | .get(getPatients) 8 | .post(createPatient); 9 | 10 | patientRoutes.route('/:patientId') 11 | .get(getPatient) 12 | .put(updatePatient) 13 | .delete(deletePatient); 14 | 15 | export default patientRoutes; 16 | -------------------------------------------------------------------------------- /src/config/mysql.config.ts: -------------------------------------------------------------------------------- 1 | import { createPool } from 'mysql2/promise'; 2 | import dotenv from 'dotenv'; 3 | 4 | dotenv.config(); 5 | export const connection = async () => { 6 | const pool = await createPool({ 7 | host: process.env.DB_HOST, 8 | user: process.env.DB_USER, 9 | password: process.env.DB_PASSWORD, 10 | database: process.env.DB_NAME, 11 | port: 3306 || process.env.DB_PORT, 12 | connectionLimit: 10 || process.env.DB_CONNECTION_LIMIT 13 | }); 14 | return pool; 15 | }; 16 | -------------------------------------------------------------------------------- /src/domain/response.ts: -------------------------------------------------------------------------------- 1 | import { Code } from '../enum/code.enum'; 2 | import { Status } from '../enum/status.enum'; 3 | 4 | export class HttpResponse { 5 | private timeStamp: string; 6 | constructor(private statusCode: Code, private httpStatus: Status, private message: string, private data?: {}) { 7 | this.timeStamp = new Date().toLocaleString(); 8 | this.statusCode = statusCode; 9 | this.httpStatus = httpStatus; 10 | this.message = message; 11 | this.data = data; 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /src/query/patient.query.ts: -------------------------------------------------------------------------------- 1 | export const QUERY = { 2 | SELECT_PATIENTS: 'SELECT * FROM patients ORDER BY created_at DESC LIMIT 50', 3 | SELECT_PATIENT: 'SELECT * FROM patients WHERE id = ?', 4 | CREATE_PATIENT: 'INSERT INTO patients(first_name, last_name, email, address, diagnosis, phone, status, image_url) VALUES (?, ?, ?, ?, ?, ?, ?, ?);', 5 | UPDATE_PATIENT: 'UPDATE patients SET first_name = ?, last_name = ?, email = ?, address = ?, diagnosis = ?, phone = ?, status = ?, image_url = ? WHERE id = ?', 6 | DELETE_PATIENT: 'DELETE FROM patients WHERE id = ?' 7 | }; 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tsnodemysql", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "start:build": "tsc -p .", 8 | "start:dev": "nodemon --exec ts-node src/index.ts", 9 | "start:prod": "tsc -p . && NODE_ENV=prod node dist/index.js" 10 | }, 11 | "author": "Junior RT", 12 | "license": "ISC", 13 | "devDependencies": { 14 | "@types/cors": "^2.8.12", 15 | "@types/express": "^4.17.13", 16 | "@types/ip": "^1.1.0", 17 | "@types/mysql2": "github:types/mysql2", 18 | "@types/node": "^17.0.8", 19 | "nodemon": "^2.0.13", 20 | "ts-node": "^10.2.1", 21 | "typescript": "^4.4.3" 22 | }, 23 | "dependencies": { 24 | "cors": "^2.8.5", 25 | "dotenv": "^10.0.0", 26 | "express": "^4.17.1", 27 | "ip": "^1.1.5", 28 | "mysql2": "^2.3.0" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | mysqldb: 3 | image: mysql:8.0 4 | container_name: mysqlcontainer 5 | command: --default-authentication-plugin=mysql_native_password 6 | restart: unless-stopped 7 | volumes: 8 | - ./dbinit/init.sql:/docker-entrypoint-initdb.d/0_init.sql 9 | - $HOME/database:/var/lib/mysql 10 | ports: 11 | - 3306:3306 12 | expose: 13 | - 3306 14 | environment: 15 | MYSQL_DATABASE: patientsdb 16 | MYSQL_USER: admin 17 | MYSQL_PASSWORD: letmein 18 | MYSQL_ROOT_PASSWORD: letmein 19 | SERVICE_TAGS: dev 20 | SERVICE_NAME: mysqldb 21 | networks: 22 | - internalnet 23 | 24 | nodeapp: 25 | container_name: nodeappcontainer 26 | build: . 27 | image: nodeapp:v1 28 | environment: 29 | DB_HOST: mysqldb 30 | DB_USER: 'root' 31 | DB_PASSWORD: 'letmein' 32 | DB_NAME: patients 33 | DB_PORT: 3306 34 | DB_CONNECTION_LIMIT: 10 35 | SERVER_PORT: 3000 36 | ports: 37 | - 3000:3000 38 | expose: 39 | - 3000 40 | depends_on: 41 | - mysqldb 42 | networks: 43 | - internalnet 44 | 45 | networks: 46 | internalnet: 47 | driver: bridge 48 | -------------------------------------------------------------------------------- /dbinit/init.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE IF NOT EXISTS patientsdb; 2 | 3 | USE patientsdb; 4 | 5 | DROP TABLE IF EXISTS patients; 6 | 7 | CREATE TABLE patients 8 | ( 9 | id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, 10 | first_name VARCHAR(255) DEFAULT NULL, 11 | last_name VARCHAR(255) DEFAULT NULL, 12 | email VARCHAR(255) DEFAULT NULL, 13 | address VARCHAR(255) DEFAULT NULL, 14 | diagnosis VARCHAR(255) DEFAULT NULL, 15 | phone VARCHAR(30) DEFAULT NULL, 16 | status VARCHAR(30) DEFAULT 'Pending', 17 | created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, 18 | image_url VARCHAR(255) DEFAULT NULL, 19 | PRIMARY KEY (id), 20 | CONSTRAINT UQ_Users_Email UNIQUE (email) 21 | ) AUTO_INCREMENT = 1; 22 | 23 | DELIMITER // 24 | CREATE PROCEDURE create_and_return(IN first_name VARCHAR(255), IN last_name VARCHAR(255), IN email VARCHAR(255), IN address VARCHAR(255), IN diagnosis VARCHAR(255), IN phone VARCHAR(255), IN image_url VARCHAR(255)) 25 | BEGIN 26 | 27 | INSERT INTO patients(first_name, last_name, email, address, diagnosis, phone, image_url) VALUES (first_name, last_name, email, address, diagnosis, phone, image_url); 28 | 29 | SET @PATIENT_ID = LAST_INSERT_ID(); 30 | 31 | SELECT * FROM patients WHERE id=@PATIENT_ID; 32 | 33 | END // 34 | DELIMITER ; 35 | -------------------------------------------------------------------------------- /src/app.ts: -------------------------------------------------------------------------------- 1 | import express, { Request, Response, Application } from 'express'; 2 | import ip from 'ip'; 3 | import cors from 'cors'; 4 | import patientRoutes from './routes/patient.routes'; 5 | import { HttpResponse } from './domain/response'; 6 | import { Code } from './enum/code.enum'; 7 | import { Status } from './enum/status.enum'; 8 | 9 | export class App { 10 | private readonly app: Application; 11 | private readonly APPLICATION_RUNNING = 'application is running on:'; 12 | private readonly ROUTE_NOT_FOUND = 'Route does not exist on the server'; 13 | 14 | constructor(private readonly port: (string | number) = process.env.SERVER_PORT || 3000) { 15 | this.app = express(); 16 | this.middleWare(); 17 | this.routes(); 18 | } 19 | 20 | listen(): void { 21 | this.app.listen(this.port); 22 | console.info(`${this.APPLICATION_RUNNING} ${ip.address()}:${this.port}`); 23 | } 24 | 25 | private middleWare(): void { 26 | this.app.use(cors({ origin: '*' })); 27 | this.app.use(express.json()); 28 | } 29 | 30 | private routes(): void { 31 | this.app.use('/patients', patientRoutes); 32 | this.app.get('/', (_: Request, res: Response)=> res.status(Code.OK).send(new HttpResponse(Code.OK, Status.OK, 'Welcome to the Patients API v1.0.0'))); 33 | this.app.all('*', (_: Request, res: Response)=> res.status(Code.NOT_FOUND).send(new HttpResponse(Code.NOT_FOUND, Status.NOT_FOUND, this.ROUTE_NOT_FOUND))); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/controller/patient.controller.ts: -------------------------------------------------------------------------------- 1 | import { Request, Response } from 'express'; 2 | import { FieldPacket, OkPacket, ResultSetHeader, RowDataPacket } from 'mysql2'; 3 | import { connection } from '../config/mysql.config'; 4 | import { HttpResponse } from '../domain/response'; 5 | import { Code } from '../enum/code.enum'; 6 | import { Status } from '../enum/status.enum'; 7 | import { Patient } from '../interface/patient'; 8 | import { QUERY } from '../query/patient.query'; 9 | 10 | type ResultSet = [RowDataPacket[] | RowDataPacket[][] | OkPacket | OkPacket[] | ResultSetHeader, FieldPacket[]]; 11 | 12 | export const getPatients = async (req: Request, res: Response): Promise> => { 13 | console.info(`[${new Date().toLocaleString()}] Incoming ${req.method}${req.originalUrl} Request from ${req.rawHeaders[0]} ${req.rawHeaders[1]}`); 14 | try { 15 | const pool = await connection(); 16 | const result: ResultSet = await pool.query(QUERY.SELECT_PATIENTS); 17 | return res.status(Code.OK) 18 | .send(new HttpResponse(Code.OK, Status.OK, 'Patients retrieved', result[0])); 19 | } catch (error: unknown) { 20 | console.error(error); 21 | return res.status(Code.INTERNAL_SERVER_ERROR) 22 | .send(new HttpResponse(Code.INTERNAL_SERVER_ERROR, Status.INTERNAL_SERVER_ERROR, 'An error occurred')); 23 | } 24 | }; 25 | 26 | export const getPatient = async (req: Request, res: Response): Promise> => { 27 | console.info(`[${new Date().toLocaleString()}] Incoming ${req.method}${req.originalUrl} Request from ${req.rawHeaders[0]} ${req.rawHeaders[1]}`); 28 | try { 29 | const pool = await connection(); 30 | const result: ResultSet = await pool.query(QUERY.SELECT_PATIENT, [req.params.patientId]); 31 | if (((result[0]) as Array).length > 0) { 32 | return res.status(Code.OK) 33 | .send(new HttpResponse(Code.OK, Status.OK, 'Patient retrieved', result[0])); 34 | } else { 35 | return res.status(Code.NOT_FOUND) 36 | .send(new HttpResponse(Code.NOT_FOUND, Status.NOT_FOUND, 'Patient not found')); 37 | } 38 | } catch (error: unknown) { 39 | console.error(error); 40 | return res.status(Code.INTERNAL_SERVER_ERROR) 41 | .send(new HttpResponse(Code.INTERNAL_SERVER_ERROR, Status.INTERNAL_SERVER_ERROR, 'An error occurred')); 42 | } 43 | }; 44 | 45 | export const createPatient = async (req: Request, res: Response): Promise> => { 46 | console.info(`[${new Date().toLocaleString()}] Incoming ${req.method}${req.originalUrl} Request from ${req.rawHeaders[0]} ${req.rawHeaders[1]}`); 47 | let patient: Patient = { ...req.body }; 48 | try { 49 | const pool = await connection(); 50 | const result: ResultSet = await pool.query(QUERY.CREATE_PATIENT, Object.values(patient)); 51 | patient = { id: (result[0] as ResultSetHeader).insertId, ...req.body }; 52 | return res.status(Code.CREATED) 53 | .send(new HttpResponse(Code.CREATED, Status.CREATED, 'Patient created', patient)); 54 | } catch (error: unknown) { 55 | console.error(error); 56 | return res.status(Code.INTERNAL_SERVER_ERROR) 57 | .send(new HttpResponse(Code.INTERNAL_SERVER_ERROR, Status.INTERNAL_SERVER_ERROR, 'An error occurred')); 58 | } 59 | }; 60 | 61 | export const updatePatient = async (req: Request, res: Response): Promise> => { 62 | console.info(`[${new Date().toLocaleString()}] Incoming ${req.method}${req.originalUrl} Request from ${req.rawHeaders[0]} ${req.rawHeaders[1]}`); 63 | let patient: Patient = { ...req.body }; 64 | try { 65 | const pool = await connection(); 66 | const result: ResultSet = await pool.query(QUERY.SELECT_PATIENT, [req.params.patientId]); 67 | if (((result[0]) as Array).length > 0) { 68 | const result: ResultSet = await pool.query(QUERY.UPDATE_PATIENT, [...Object.values(patient), req.params.patientId]); 69 | return res.status(Code.OK) 70 | .send(new HttpResponse(Code.OK, Status.OK, 'Patient updated', { ...patient, id: req.params.patientId })); 71 | } else { 72 | return res.status(Code.NOT_FOUND) 73 | .send(new HttpResponse(Code.NOT_FOUND, Status.NOT_FOUND, 'Patient not found')); 74 | } 75 | } catch (error: unknown) { 76 | console.error(error); 77 | return res.status(Code.INTERNAL_SERVER_ERROR) 78 | .send(new HttpResponse(Code.INTERNAL_SERVER_ERROR, Status.INTERNAL_SERVER_ERROR, 'An error occurred')); 79 | } 80 | }; 81 | 82 | export const deletePatient = async (req: Request, res: Response): Promise> => { 83 | console.info(`[${new Date().toLocaleString()}] Incoming ${req.method}${req.originalUrl} Request from ${req.rawHeaders[0]} ${req.rawHeaders[1]}`); 84 | try { 85 | const pool = await connection(); 86 | const result: ResultSet = await pool.query(QUERY.SELECT_PATIENT, [req.params.patientId]); 87 | if (((result[0]) as Array).length > 0) { 88 | const result: ResultSet = await pool.query(QUERY.DELETE_PATIENT, [req.params.patientId]); 89 | return res.status(Code.OK) 90 | .send(new HttpResponse(Code.OK, Status.OK, 'Patient deleted')); 91 | } else { 92 | return res.status(Code.NOT_FOUND) 93 | .send(new HttpResponse(Code.NOT_FOUND, Status.NOT_FOUND, 'Patient not found')); 94 | } 95 | } catch (error: unknown) { 96 | console.error(error); 97 | return res.status(Code.INTERNAL_SERVER_ERROR) 98 | .send(new HttpResponse(Code.INTERNAL_SERVER_ERROR, Status.INTERNAL_SERVER_ERROR, 'An error occurred')); 99 | } 100 | }; 101 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Projects */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 | // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ 9 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */ 10 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 11 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 12 | 13 | /* Language and Environment */ 14 | "target": "es6", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ 15 | // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 16 | // "jsx": "preserve", /* Specify what JSX code is generated. */ 17 | // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ 18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */ 20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */ 22 | // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */ 23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 | 26 | /* Modules */ 27 | "module": "commonjs", /* Specify what module code is generated. */ 28 | "rootDir": "./src", /* Specify the root folder within your source files. */ 29 | "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ 30 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 31 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 32 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 33 | // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ 34 | // "types": [], /* Specify type package names to be included without being referenced in a source file. */ 35 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 36 | // "resolveJsonModule": true, /* Enable importing .json files */ 37 | // "noResolve": true, /* Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project. */ 38 | 39 | /* JavaScript Support */ 40 | // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ 41 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 42 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ 43 | 44 | /* Emit */ 45 | // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 46 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 47 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 48 | // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 49 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ 50 | "outDir": "./dist", /* Specify an output folder for all emitted files. */ 51 | // "removeComments": true, /* Disable emitting comments. */ 52 | // "noEmit": true, /* Disable emitting files from a compilation. */ 53 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 54 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */ 55 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 56 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 57 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 58 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 59 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 60 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 61 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 62 | // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */ 63 | // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ 64 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 65 | // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ 66 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 67 | 68 | /* Interop Constraints */ 69 | // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 70 | // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 71 | "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */ 72 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 73 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 74 | 75 | /* Type Checking */ 76 | "strict": true, /* Enable all strict type-checking options. */ 77 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ 78 | // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */ 79 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 80 | // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */ 81 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 82 | // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */ 83 | // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */ 84 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 85 | // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */ 86 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */ 87 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 88 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 89 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 90 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ 91 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 92 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */ 93 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 94 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 95 | 96 | /* Completeness */ 97 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 98 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 99 | } 100 | } 101 | --------------------------------------------------------------------------------