Skip to content
Snippets Groups Projects
Commit d9a887b2 authored by Paolo.Brasolin's avatar Paolo.Brasolin
Browse files

feat: comfy dev env (ts, jest, prettier, eslint)

parent c39c9ccb
No related branches found
No related tags found
No related merge requests found
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.{js,ts,json}]
indent_size = 2
indent_style = space
coverage
dist
node_modules
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier", "jest"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"no-console": 1,
"prettier/prettier": 2
},
"env": {
"browser": true,
"node": true,
"jest/globals": true
}
}
coverage
dist
node_modules
{
"trailingComma": "all",
"printWidth": 80
}
{
"transform": {
"^.+\\.ts$": "ts-jest"
},
"collectCoverage": false,
"collectCoverageFrom": ["src/**/*.ts", "!src/**/*.spec.ts"],
"notify": true,
"testEnvironment": "node",
"testRegex": "/src/.+\\.spec\\.ts$",
"roots": ["<rootDir>/src"]
}
This diff is collapsed.
......@@ -4,12 +4,38 @@
"description": "Ötzi game backend.",
"main": "src/index.js",
"scripts": {
"start": "node src/index.js",
"watch": "nodemon src/index.js"
"start": "ts-node src/index.ts",
"watch": "nodemon src/index.ts",
"build": "tsc",
"lint:check": "eslint .",
"lint:fix": "eslint . --fix",
"format:check": "prettier . --check",
"format:fix": "prettier . --write",
"style:check": "npm-run-all --serial format:check lint:check",
"style:fix": "npm-run-all --serial format:fix lint:fix",
"test": "jest",
"coverage": "jest --coverage",
"watch:test": "jest --watch"
},
"dependencies": {
"fastify": "^3.27.1",
"nodemon": "^2.0.15"
"fastify": "^3.27.1"
},
"devDependencies": {
"@types/jest": "^27.0.3",
"@types/node": "^16.11.11",
"@typescript-eslint/eslint-plugin": "^5.5.0",
"@typescript-eslint/parser": "^5.5.0",
"eslint": "^8.3.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jest": "^25.3.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^27.4.2",
"node-notifier": "^10.0.1",
"nodemon": "^2.0.15",
"prettier": "^2.5.1",
"ts-jest": "^27.0.7",
"ts-node": "^10.5.0",
"typescript": "^4.5.2"
},
"engines": {
"node": "16.x"
......
describe("test", () => {
test("true is true", async () => {
expect(true).toEqual(true);
});
});
const server = require("fastify")({
import fastify from "fastify";
const server = fastify({
logger: false,
});
......@@ -6,7 +8,7 @@ server.get("/", function (request, reply) {
reply.code(200).send("Hello, World!");
});
server.listen(process.env.PORT, "0.0.0.0", function (err, address) {
server.listen(process.env.PORT as string, "0.0.0.0", function (err, address) {
if (err) {
server.log.error(err);
process.exit(1);
......
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"declaration": true,
"lib": ["ES6", "DOM"],
"outDir": "dist",
"rootDir": "src",
"strict": true,
"typeRoots": ["./node_modules/@types"]
},
"include": ["src/**/*"],
"exclude": ["src/**/*.spec.ts"]
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment