Skip to content

Commit 54211c3

Browse files
committed
Add prettier to project
1 parent a91fa08 commit 54211c3

File tree

5 files changed

+37
-3
lines changed

5 files changed

+37
-3
lines changed

.prettierrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @see https://prettier.io/docs/configuration
3+
* @type {import("prettier").Config}
4+
*/
5+
const config = {
6+
trailingComma: "es5",
7+
tabWidth: 4,
8+
semi: false,
9+
singleQuote: true,
10+
};
11+
12+
export default config;

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ restart: stop start dev ## Stop and restart container
3737
types: ## Run type check and generator
3838
docker compose exec mct_web npm run types
3939

40+
prettier: ## Run prettier the opinionated code formatter in code
41+
docker compose exec mct_web npm run prettier
42+
4043
types-watch: ## Run type check and generator
4144
docker compose exec mct_web npm run types-watch
4245

4346
clear: stop ./compose.yml ## Stop and remove container and orphans
4447
docker compose down -v --remove-orphans
4548

46-
.PHONY: bash build clean help logs start stop types types-watch
49+
.PHONY: bash build clean help logs start stop types types-watch prettier

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"test:unit": "vitest --environment jsdom --root src/ run",
1414
"test-watch:unit": "vitest --environment jsdom --root src/ watch",
1515
"types": "tsc",
16-
"types-watch": "tsc --watch"
16+
"types-watch": "tsc --watch",
17+
"prettier": "prettier src/ --write"
1718
},
1819
"devDependencies": {
1920
"chart.js": "^4.2.1",
@@ -25,6 +26,7 @@
2526
"naive-ui": "^2.43.1",
2627
"nodemon": "^2.0.22",
2728
"npm-run-all": "^4.1.5",
29+
"prettier": "3.6.2",
2830
"typescript": "^5.9.3",
2931
"vite": "^4.2.0",
3032
"vue": "^3.5.24",

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"skipLibCheck": true,
1111
"paths": {
1212
"@/*": ["./src/*"]
13-
}
13+
},
14+
"lib": ["ES2020", "DOM"]
1415
},
1516
"exclude": ["node_modules", "dist"],
1617
"include": ["src/**/*"]

0 commit comments

Comments
 (0)