Skip to content

Commit bc62493

Browse files
1 parent 3374370 commit bc62493

File tree

14 files changed

+214
-274
lines changed

14 files changed

+214
-274
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@typespec/compiler",
5+
"comment": "Upgrade formatter to prettier 3.1",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@typespec/compiler"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@typespec/html-program-viewer",
5+
"comment": "Upgrade formatter to prettier 3.1",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@typespec/html-program-viewer"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@typespec/migrate",
5+
"comment": "Upgrade formatter to prettier 3.1",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@typespec/migrate"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@typespec/prettier-plugin-typespec",
5+
"comment": "Upgrade formatter to prettier 3.1",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@typespec/prettier-plugin-typespec"
10+
}

common/config/rush/pnpm-lock.yaml

+18-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/compiler/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"globby": "~13.2.2",
7979
"yaml": "~2.3.2",
8080
"mustache": "~4.2.0",
81-
"prettier": "~3.0.3",
81+
"prettier": "~3.1.0",
8282
"prompts": "~2.4.2",
8383
"semver": "^7.5.4",
8484
"vscode-languageserver": "~9.0.0",

packages/compiler/src/core/checker.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -1160,14 +1160,14 @@ export function createChecker(program: Program): Checker {
11601160
return sym.flags & SymbolFlags.Model
11611161
? checkModelStatement(node as ModelStatementNode, mapper)
11621162
: sym.flags & SymbolFlags.Scalar
1163-
? checkScalar(node as ScalarStatementNode, mapper)
1164-
: sym.flags & SymbolFlags.Alias
1165-
? checkAlias(node as AliasStatementNode, mapper)
1166-
: sym.flags & SymbolFlags.Interface
1167-
? checkInterface(node as InterfaceStatementNode, mapper)
1168-
: sym.flags & SymbolFlags.Operation
1169-
? checkOperation(node as OperationStatementNode, mapper)
1170-
: checkUnion(node as UnionStatementNode, mapper);
1163+
? checkScalar(node as ScalarStatementNode, mapper)
1164+
: sym.flags & SymbolFlags.Alias
1165+
? checkAlias(node as AliasStatementNode, mapper)
1166+
: sym.flags & SymbolFlags.Interface
1167+
? checkInterface(node as InterfaceStatementNode, mapper)
1168+
: sym.flags & SymbolFlags.Operation
1169+
? checkOperation(node as OperationStatementNode, mapper)
1170+
: checkUnion(node as UnionStatementNode, mapper);
11711171
}
11721172

11731173
function getOrInstantiateTemplate(

packages/compiler/src/core/schema-validator.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ function ajvErrorToDiagnostic(
6565
target === NoTarget
6666
? target
6767
: "kind" in target
68-
? getLocationInYamlScript(target, getErrorPath(error), "key")
69-
: { file: target, pos: 0, end: 0 },
68+
? getLocationInYamlScript(target, getErrorPath(error), "key")
69+
: { file: target, pos: 0, end: 0 },
7070
};
7171
}
7272

packages/compiler/src/formatter/print/printer.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,8 @@ function printDoc(
494494
const printed = isIndentableBlockComment(rawComment)
495495
? printIndentableBlockCommentContent(rawComment)
496496
: rawComment.includes("\n")
497-
? rawComment
498-
: ` ${rawComment.trim()} `;
497+
? rawComment
498+
: ` ${rawComment.trim()} `;
499499
return ["/**", printed, "*/"];
500500
}
501501

packages/html-program-viewer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@typespec/compiler": "workspace:~0.50.0"
5151
},
5252
"dependencies": {
53-
"prettier": "~3.0.3",
53+
"prettier": "~3.1.0",
5454
"react": "~18.2.0",
5555
"react-dom": "~18.2.0",
5656
"react-is": "~18.1.0",

packages/migrate/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@typespec/compiler-v0.41": "npm:@typespec/compiler@0.41.0",
4646
"@typespec/compiler-v0.42": "npm:@typespec/compiler@0.42.0",
4747
"globby": "~13.2.2",
48-
"prettier": "~3.0.3",
48+
"prettier": "~3.1.0",
4949
"semver": "^7.5.4",
5050
"yargs": "~17.7.2",
5151
"yaml": "~2.3.2"

0 commit comments

Comments
 (0)