Skip to content

Commit 8a38e71

Browse files
committed
fix: add prettier and format:check, format:fix scripts
Signed-off-by: Denis Golovin <[email protected]>
1 parent 647edb7 commit 8a38e71

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

.prettierrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"bracketSameLine": true,
3+
"singleQuote": true,
4+
"arrowParens": "avoid",
5+
"printWidth": 120,
6+
"trailingComma": "all",
7+
"plugins": []
8+
}
9+

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
"scripts": {
2222
"build": "rollup --bundleConfigAsCjs --config rollup.config.js --compact --environment BUILD:production && node ./scripts/build.js",
2323
"watch": "rollup --bundleConfigAsCjs --config rollup.config.js -w",
24+
"format:check": "prettier --cache --check \"{src,types,scripts}/**/*.{ts,js}\"",
25+
"format:fix": "prettier --cache --write \"{src,types,scripts}/**/*.{ts,js}\"",
2426
"test": "vitest run --coverage"
2527
},
2628
"dependencies": {
@@ -41,6 +43,7 @@
4143
"@types/js-yaml": "^4.0.5",
4244
"@vitest/coverage-v8": "^1.2.1",
4345
"mkdirp": "^2.1.3",
46+
"prettier": "^3.2.5",
4447
"rollup": "^3.20.4",
4548
"tslib": "^2.5.0",
4649
"typescript": "^5.0.4",

yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,11 @@ postcss@^8.4.32:
10641064
picocolors "^1.0.0"
10651065
source-map-js "^1.0.2"
10661066

1067+
prettier@^3.2.5:
1068+
version "3.2.5"
1069+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368"
1070+
integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==
1071+
10671072
pretty-format@^29.7.0:
10681073
version "29.7.0"
10691074
resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz"

0 commit comments

Comments
 (0)