@typespec/prettier-plugin-typespec 0.63.0-dev.0 → 0.63.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 +26 -20
- package/dist/index.js.map +1 -1
- package/package.json +4 -5
package/dist/index.js
CHANGED
|
@@ -436,12 +436,6 @@ const diagnostics = {
|
|
|
436
436
|
typeofTarget: "Typeof expects a value literal or value reference.",
|
|
437
437
|
},
|
|
438
438
|
},
|
|
439
|
-
"trailing-token": {
|
|
440
|
-
severity: "error",
|
|
441
|
-
messages: {
|
|
442
|
-
default: paramMessage `Trailing ${"token"}`,
|
|
443
|
-
},
|
|
444
|
-
},
|
|
445
439
|
"unknown-directive": {
|
|
446
440
|
severity: "error",
|
|
447
441
|
messages: {
|
|
@@ -1060,6 +1054,12 @@ const diagnostics = {
|
|
|
1060
1054
|
/**
|
|
1061
1055
|
* Decorator
|
|
1062
1056
|
*/
|
|
1057
|
+
"invalid-pattern-regex": {
|
|
1058
|
+
severity: "warning",
|
|
1059
|
+
messages: {
|
|
1060
|
+
default: "@pattern decorator expects a valid regular expression pattern.",
|
|
1061
|
+
},
|
|
1062
|
+
},
|
|
1063
1063
|
"decorator-wrong-target": {
|
|
1064
1064
|
severity: "error",
|
|
1065
1065
|
messages: {
|
|
@@ -1285,6 +1285,26 @@ const diagnostics = {
|
|
|
1285
1285
|
default: "Conflict marker encountered.",
|
|
1286
1286
|
},
|
|
1287
1287
|
},
|
|
1288
|
+
// #region Visibility
|
|
1289
|
+
"visibility-sealed": {
|
|
1290
|
+
severity: "error",
|
|
1291
|
+
messages: {
|
|
1292
|
+
default: paramMessage `Visibility of property '${"propName"}' is sealed and cannot be changed.`,
|
|
1293
|
+
},
|
|
1294
|
+
},
|
|
1295
|
+
"visibility-mixed-legacy": {
|
|
1296
|
+
severity: "error",
|
|
1297
|
+
messages: {
|
|
1298
|
+
default: "Cannot apply both string (legacy) visibility modifiers and enum-based visibility modifiers to a property.",
|
|
1299
|
+
},
|
|
1300
|
+
},
|
|
1301
|
+
"default-visibility-not-member": {
|
|
1302
|
+
severity: "error",
|
|
1303
|
+
messages: {
|
|
1304
|
+
default: "The default visibility modifiers of a class must be members of the class enum.",
|
|
1305
|
+
},
|
|
1306
|
+
},
|
|
1307
|
+
// #endregion
|
|
1288
1308
|
// #region CLI
|
|
1289
1309
|
"no-compatible-vs-installed": {
|
|
1290
1310
|
severity: "error",
|
|
@@ -3376,7 +3396,6 @@ var ListKind;
|
|
|
3376
3396
|
const PropertiesBase = {
|
|
3377
3397
|
allowEmpty: true,
|
|
3378
3398
|
toleratedDelimiterIsValid: true,
|
|
3379
|
-
trailingDelimiterIsValid: true,
|
|
3380
3399
|
allowedStatementKeyword: Token.None,
|
|
3381
3400
|
};
|
|
3382
3401
|
ListKind.OperationParameters = {
|
|
@@ -3442,7 +3461,6 @@ var ListKind;
|
|
|
3442
3461
|
delimiter: Token.Comma,
|
|
3443
3462
|
toleratedDelimiter: Token.Semicolon,
|
|
3444
3463
|
toleratedDelimiterIsValid: false,
|
|
3445
|
-
trailingDelimiterIsValid: false,
|
|
3446
3464
|
invalidAnnotationTarget: "expression",
|
|
3447
3465
|
allowedStatementKeyword: Token.None,
|
|
3448
3466
|
};
|
|
@@ -5929,22 +5947,10 @@ function createParser(code, options = {}) {
|
|
|
5929
5947
|
mutate(item).directives = directives;
|
|
5930
5948
|
}
|
|
5931
5949
|
r.items.push(item);
|
|
5932
|
-
const delimiter = token();
|
|
5933
|
-
const delimiterPos = tokenPos();
|
|
5934
5950
|
if (parseOptionalDelimiter(kind)) {
|
|
5935
5951
|
// Delimiter found: check if it's trailing.
|
|
5936
5952
|
if (parseOptional(kind.close)) {
|
|
5937
5953
|
mutate(r.range).end = previousTokenEnd;
|
|
5938
|
-
if (!kind.trailingDelimiterIsValid) {
|
|
5939
|
-
error({
|
|
5940
|
-
code: "trailing-token",
|
|
5941
|
-
format: { token: TokenDisplay[delimiter] },
|
|
5942
|
-
target: {
|
|
5943
|
-
pos: delimiterPos,
|
|
5944
|
-
end: delimiterPos + 1,
|
|
5945
|
-
},
|
|
5946
|
-
});
|
|
5947
|
-
}
|
|
5948
5954
|
// It was trailing and we've consumed the close token.
|
|
5949
5955
|
break;
|
|
5950
5956
|
}
|