Skip to content

Commit 968b951

Browse files
KKonstantinovihrpr
andauthored
MCP SDK: Add Prettier to Typescript SDK (#976)
Co-authored-by: ihrpr <inna@anthropic.com>
1 parent 856d9ec commit 968b951

File tree

5 files changed

+70
-2
lines changed

5 files changed

+70
-2
lines changed

.prettierignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Ignore artifacts:
2+
build
3+
dist
4+
coverage
5+
*-lock.*
6+
node_modules
7+
**/build
8+
**/dist
9+
.github/CODEOWNERS
10+
pnpm-lock.yaml

.prettierrc.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"printWidth": 140,
3+
"tabWidth": 4,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "none",
8+
"bracketSpacing": true,
9+
"bracketSameLine": false,
10+
"proseWrap": "always",
11+
"arrowParens": "avoid",
12+
"overrides": [
13+
{
14+
"files": "**/*.md",
15+
"options": {
16+
"printWidth": 280
17+
}
18+
}
19+
]
20+
}

eslint.config.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import eslint from '@eslint/js';
44
import tseslint from 'typescript-eslint';
5+
import eslintConfigPrettier from 'eslint-config-prettier/flat';
56

67
export default tseslint.config(
78
eslint.configs.recommended,
@@ -22,5 +23,6 @@ export default tseslint.config(
2223
rules: {
2324
"no-console": "error"
2425
}
25-
}
26+
},
27+
eslintConfigPrettier
2628
);

package-lock.json

Lines changed: 34 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
@@ -55,7 +55,7 @@
5555
"build:cjs:w": "npm run build:cjs -- -w",
5656
"examples:simple-server:w": "tsx --watch src/examples/server/simpleStreamableHttp.ts --oauth",
5757
"prepack": "npm run build:esm && npm run build:cjs",
58-
"lint": "eslint src/",
58+
"lint": "eslint src/ && prettier --check .",
5959
"test": "npm run fetch:spec-types && jest",
6060
"start": "npm run server",
6161
"server": "tsx watch --clear-screen=false src/cli.ts server",
@@ -89,6 +89,8 @@
8989
"@types/supertest": "^6.0.2",
9090
"@types/ws": "^8.5.12",
9191
"eslint": "^9.8.0",
92+
"eslint-config-prettier": "^10.1.8",
93+
"prettier": "3.6.2",
9294
"jest": "^29.7.0",
9395
"supertest": "^7.0.0",
9496
"ts-jest": "^29.2.4",

0 commit comments

Comments
 (0)