@typespec/prettier-plugin-typespec 0.59.0-dev.1 → 0.60.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -652,6 +652,12 @@ const diagnostics = {
|
|
|
652
652
|
default: paramMessage `Path "${"path"}" cannot be relative. Use {cwd} or {project-root} to specify what the path should be relative to.`,
|
|
653
653
|
},
|
|
654
654
|
},
|
|
655
|
+
"path-unix-style": {
|
|
656
|
+
severity: "warning",
|
|
657
|
+
messages: {
|
|
658
|
+
default: paramMessage `Path should use unix style separators. Use "/" instead of "\\".`,
|
|
659
|
+
},
|
|
660
|
+
},
|
|
655
661
|
"config-path-not-found": {
|
|
656
662
|
severity: "error",
|
|
657
663
|
messages: {
|
|
@@ -891,6 +897,7 @@ const diagnostics = {
|
|
|
891
897
|
wrongType: paramMessage `Encoding '${"encoding"}' cannot be used on type '${"type"}'. Expected: ${"expected"}.`,
|
|
892
898
|
wrongEncodingType: paramMessage `Encoding '${"encoding"}' on type '${"type"}' is expected to be serialized as '${"expected"}' but got '${"actual"}'.`,
|
|
893
899
|
wrongNumericEncodingType: paramMessage `Encoding '${"encoding"}' on type '${"type"}' is expected to be serialized as '${"expected"}' but got '${"actual"}'. Set '@encode' 2nd parameter to be of type ${"expected"}. e.g. '@encode("${"encoding"}", int32)'`,
|
|
900
|
+
firstArg: `First argument of "@encode" must be the encoding name or the string type when encoding numeric types.`,
|
|
894
901
|
},
|
|
895
902
|
},
|
|
896
903
|
"invalid-mime-type": {
|
|
@@ -3641,7 +3648,7 @@ function createParser(code, options = {}) {
|
|
|
3641
3648
|
break;
|
|
3642
3649
|
case Token.NamespaceKeyword:
|
|
3643
3650
|
const ns = parseNamespaceStatement(pos, decorators, docs, directives);
|
|
3644
|
-
if (
|
|
3651
|
+
if (isBlocklessNamespace(ns)) {
|
|
3645
3652
|
error({ code: "blockless-namespace-first", messageId: "topLevel", target: ns });
|
|
3646
3653
|
}
|
|
3647
3654
|
item = ns;
|