Skip to content

Commit c45d8a1

Browse files
committed
chore(js) add prettier
1 parent d597ab4 commit c45d8a1

File tree

6 files changed

+50
-0
lines changed

6 files changed

+50
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules/
2+
dist/
3+
src/proto/
4+
.idea
5+
coverage/*
6+
*.log
7+
api/*
8+
CHANGELOG.md
9+
README.md

openfeature-provider/js/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ install: $(INSTALL_STAMP) $(GEN_TS)
4242
build: $(BUILD_STAMP)
4343

4444
test: $(WASM_ARTIFACT) $(INSTALL_STAMP) $(GEN_TS)
45+
yarn format:check
4546
yarn test --run --exclude='**/*.e2e.test.ts'
4647

4748
test-e2e: $(WASM_ARTIFACT) $(INSTALL_STAMP) $(GEN_TS)

openfeature-provider/js/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,11 @@ The package exports a browser ESM build that compiles the WASM via streaming and
182182
## License
183183

184184
See the root `LICENSE`.
185+
186+
## Formatting
187+
188+
Code is formatted using prettier, you can format all files by running
189+
190+
```sh
191+
yarn format
192+
```

openfeature-provider/js/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
"scripts": {
3333
"build": "tsdown",
3434
"dev": "tsdown --watch",
35+
"format": "prettier --config prettier.config.cjs -w .",
36+
"format:check": "prettier --config prettier.config.cjs -c .",
3537
"test": "vitest",
3638
"proto:gen": "rm -rf src/proto && mkdir -p src/proto && protoc --plugin=node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt useOptionals=messages --ts_proto_opt esModuleInterop=true --ts_proto_out src/proto -Iproto api.proto messages.proto test-only.proto"
3739
},
@@ -41,11 +43,13 @@
4143
"devDependencies": {
4244
"@openfeature/core": "^1.9.0",
4345
"@openfeature/server-sdk": "^1.19.0",
46+
"@spotify/prettier-config": "^15.0.0",
4447
"@types/debug": "^4",
4548
"@types/node": "^24.0.1",
4649
"@vitest/coverage-v8": "^3.2.4",
4750
"debug": "^4.4.3",
4851
"dotenv": "^17.2.2",
52+
"prettier": "^2.8.8",
4953
"rolldown": "1.0.0-beta.38",
5054
"ts-proto": "^2.7.3",
5155
"tsdown": "latest",
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const baseConfig = require('@spotify/prettier-config');
2+
3+
module.exports = {
4+
...baseConfig,
5+
tabWidth: 2,
6+
useTabs: false,
7+
printWidth: 120,
8+
};

openfeature-provider/js/yarn.lock

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,11 +691,13 @@ __metadata:
691691
"@bufbuild/protobuf": "npm:^2.9.0"
692692
"@openfeature/core": "npm:^1.9.0"
693693
"@openfeature/server-sdk": "npm:^1.19.0"
694+
"@spotify/prettier-config": "npm:^15.0.0"
694695
"@types/debug": "npm:^4"
695696
"@types/node": "npm:^24.0.1"
696697
"@vitest/coverage-v8": "npm:^3.2.4"
697698
debug: "npm:^4.4.3"
698699
dotenv: "npm:^17.2.2"
700+
prettier: "npm:^2.8.8"
699701
rolldown: "npm:1.0.0-beta.38"
700702
ts-proto: "npm:^2.7.3"
701703
tsdown: "npm:latest"
@@ -708,6 +710,15 @@ __metadata:
708710
languageName: unknown
709711
linkType: soft
710712

713+
"@spotify/prettier-config@npm:^15.0.0":
714+
version: 15.0.0
715+
resolution: "@spotify/prettier-config@npm:15.0.0"
716+
peerDependencies:
717+
prettier: 2.x
718+
checksum: 10c0/d7033f9f3ab255b490084f72928d4df086f6a51bb6f88b0d3678a5a63e46fc58ad025a0a709f96d8ae91b82093d991d54ea6a48b7d3f2c7f3f747c1853b76532
719+
languageName: node
720+
linkType: hard
721+
711722
"@tybys/wasm-util@npm:^0.10.1":
712723
version: 0.10.1
713724
resolution: "@tybys/wasm-util@npm:0.10.1"
@@ -1845,6 +1856,15 @@ __metadata:
18451856
languageName: node
18461857
linkType: hard
18471858

1859+
"prettier@npm:^2.8.8":
1860+
version: 2.8.8
1861+
resolution: "prettier@npm:2.8.8"
1862+
bin:
1863+
prettier: bin-prettier.js
1864+
checksum: 10c0/463ea8f9a0946cd5b828d8cf27bd8b567345cf02f56562d5ecde198b91f47a76b7ac9eae0facd247ace70e927143af6135e8cf411986b8cb8478784a4d6d724a
1865+
languageName: node
1866+
linkType: hard
1867+
18481868
"proc-log@npm:^5.0.0":
18491869
version: 5.0.0
18501870
resolution: "proc-log@npm:5.0.0"

0 commit comments

Comments
 (0)