add prettier to backend

This commit is contained in:
iamBadgers
2024-03-05 12:36:42 -08:00
parent 37efd3949d
commit f346bcafc0
4 changed files with 35 additions and 8 deletions

8
backend/.prettierrc.json Normal file
View File

@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
}

View File

@@ -16,6 +16,7 @@
"@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1", "@typescript-eslint/parser": "^7.1.1",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"prettier": "^3.2.5",
"typescript": "^5.3.3" "typescript": "^5.3.3"
} }
}, },
@@ -2009,6 +2010,21 @@
"node": ">= 0.8.0" "node": ">= 0.8.0"
} }
}, },
"node_modules/prettier": {
"version": "3.2.5",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz",
"integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==",
"dev": true,
"bin": {
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/proxy-addr": { "node_modules/proxy-addr": {
"version": "2.0.7", "version": "2.0.7",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",

View File

@@ -4,7 +4,9 @@
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"format": "prettier --write src/"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
@@ -14,6 +16,7 @@
"@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1", "@typescript-eslint/parser": "^7.1.1",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"prettier": "^3.2.5",
"typescript": "^5.3.3" "typescript": "^5.3.3"
}, },
"dependencies": { "dependencies": {

View File

@@ -1,11 +1,11 @@
import express from 'express'; import express from 'express'
const app = express(); const app = express()
const port = 3000; const port = 3000
app.get('/', (req, res) => { app.get('/', (req, res) => {
res.send('Hello World!'); res.send('Hello World!')
}); })
app.listen(port, () => { app.listen(port, () => {
return console.log(`Express is listening at http://localhost:${port}`); return console.log(`Express is listening at http://localhost:${port}`)
}); })