Skip to content

Commit

Permalink
Upgrade to prettier 3.1 (#2666)
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin authored Nov 14, 2023
1 parent 3374370 commit bc62493
Show file tree
Hide file tree
Showing 14 changed files with 214 additions and 274 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/compiler",
"comment": "Upgrade formatter to prettier 3.1",
"type": "none"
}
],
"packageName": "@typespec/compiler"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/html-program-viewer",
"comment": "Upgrade formatter to prettier 3.1",
"type": "none"
}
],
"packageName": "@typespec/html-program-viewer"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/migrate",
"comment": "Upgrade formatter to prettier 3.1",
"type": "none"
}
],
"packageName": "@typespec/migrate"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/prettier-plugin-typespec",
"comment": "Upgrade formatter to prettier 3.1",
"type": "none"
}
],
"packageName": "@typespec/prettier-plugin-typespec"
}
36 changes: 18 additions & 18 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"globby": "~13.2.2",
"yaml": "~2.3.2",
"mustache": "~4.2.0",
"prettier": "~3.0.3",
"prettier": "~3.1.0",
"prompts": "~2.4.2",
"semver": "^7.5.4",
"vscode-languageserver": "~9.0.0",
Expand Down
16 changes: 8 additions & 8 deletions packages/compiler/src/core/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1160,14 +1160,14 @@ export function createChecker(program: Program): Checker {
return sym.flags & SymbolFlags.Model
? checkModelStatement(node as ModelStatementNode, mapper)
: sym.flags & SymbolFlags.Scalar
? checkScalar(node as ScalarStatementNode, mapper)
: sym.flags & SymbolFlags.Alias
? checkAlias(node as AliasStatementNode, mapper)
: sym.flags & SymbolFlags.Interface
? checkInterface(node as InterfaceStatementNode, mapper)
: sym.flags & SymbolFlags.Operation
? checkOperation(node as OperationStatementNode, mapper)
: checkUnion(node as UnionStatementNode, mapper);
? checkScalar(node as ScalarStatementNode, mapper)
: sym.flags & SymbolFlags.Alias
? checkAlias(node as AliasStatementNode, mapper)
: sym.flags & SymbolFlags.Interface
? checkInterface(node as InterfaceStatementNode, mapper)
: sym.flags & SymbolFlags.Operation
? checkOperation(node as OperationStatementNode, mapper)
: checkUnion(node as UnionStatementNode, mapper);
}

function getOrInstantiateTemplate(
Expand Down
4 changes: 2 additions & 2 deletions packages/compiler/src/core/schema-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ function ajvErrorToDiagnostic(
target === NoTarget
? target
: "kind" in target
? getLocationInYamlScript(target, getErrorPath(error), "key")
: { file: target, pos: 0, end: 0 },
? getLocationInYamlScript(target, getErrorPath(error), "key")
: { file: target, pos: 0, end: 0 },
};
}

Expand Down
4 changes: 2 additions & 2 deletions packages/compiler/src/formatter/print/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,8 @@ function printDoc(
const printed = isIndentableBlockComment(rawComment)
? printIndentableBlockCommentContent(rawComment)
: rawComment.includes("\n")
? rawComment
: ` ${rawComment.trim()} `;
? rawComment
: ` ${rawComment.trim()} `;
return ["/**", printed, "*/"];
}

Expand Down
2 changes: 1 addition & 1 deletion packages/html-program-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@typespec/compiler": "workspace:~0.50.0"
},
"dependencies": {
"prettier": "~3.0.3",
"prettier": "~3.1.0",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"react-is": "~18.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/migrate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@typespec/compiler-v0.41": "npm:@typespec/[email protected]",
"@typespec/compiler-v0.42": "npm:@typespec/[email protected]",
"globby": "~13.2.2",
"prettier": "~3.0.3",
"prettier": "~3.1.0",
"semver": "^7.5.4",
"yargs": "~17.7.2",
"yaml": "~2.3.2"
Expand Down
Loading

0 comments on commit bc62493

Please sign in to comment.