@biomejs/backend-jsonrpc 1.2.1 → 1.2.2-nightly.1e3fc94
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/package.json +1 -1
- package/src/command.ts +1 -1
- package/src/index.ts +1 -1
- package/src/socket.ts +2 -2
- package/src/transport.ts +1 -1
- package/src/workspace.ts +85 -11
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@biomejs/backend-jsonrpc","version":"1.2.
|
|
1
|
+
{"name":"@biomejs/backend-jsonrpc","version":"1.2.2-nightly.1e3fc94","main":"dist/index.js","scripts":{"test":"vitest","test:ci":"pnpm build && vitest --run","tsc":"tsc --noEmit","build":"tsc"},"homepage":"https://biomejs.dev","repository":{"type":"git","url":"https://github.com/biomejs/biome.git","directory":"npm/backend-jsonrpc"},"author":"Biome Developers and Contributors","bugs":"https://github.com/biomejs/biome/issues","description":"Bindings to the JSON-RPC Workspace API of the Biome daemon","keywords":["JavaScript","TypeScript","format","lint","toolchain"],"engines":{"node":">=14.*"},"license":"MIT","devDependencies":{"@types/node":"^18.7.2","typescript":"^4.8.2","vite":"^3.0.8","vitest":"^0.22.0"},"optionalDependencies":{"@biomejs/cli-win32-x64":"1.2.2-nightly.1e3fc94","@biomejs/cli-win32-arm64":"1.2.2-nightly.1e3fc94","@biomejs/cli-darwin-x64":"1.2.2-nightly.1e3fc94","@biomejs/cli-darwin-arm64":"1.2.2-nightly.1e3fc94","@biomejs/cli-linux-x64":"1.2.2-nightly.1e3fc94","@biomejs/cli-linux-arm64":"1.2.2-nightly.1e3fc94"}}
|
package/src/command.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -27,7 +27,7 @@ export async function createWorkspace(): Promise<Workspace | null> {
|
|
|
27
27
|
* instance through the JSON-RPC protocol, using the provided command to spawn
|
|
28
28
|
* the daemon if necessary
|
|
29
29
|
*
|
|
30
|
-
* @param command Path to the
|
|
30
|
+
* @param command Path to the Biome binary distribution
|
|
31
31
|
* @returns A Workspace client, or null if the underlying platform is not supported
|
|
32
32
|
*/
|
|
33
33
|
export async function createWorkspaceWithBinary(
|
package/src/socket.ts
CHANGED
|
@@ -29,9 +29,9 @@ function getSocket(command: string): Promise<string> {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* Ensure the
|
|
32
|
+
* Ensure the Biome daemon server is running and create a Socket connected to the RPC channel
|
|
33
33
|
*
|
|
34
|
-
* @param command Path to the
|
|
34
|
+
* @param command Path to the Biome daemon binary
|
|
35
35
|
* @returns Socket instance connected to the daemon
|
|
36
36
|
*/
|
|
37
37
|
export async function createSocket(command: string): Promise<Socket> {
|
package/src/transport.ts
CHANGED
|
@@ -96,7 +96,7 @@ interface PendingRequest {
|
|
|
96
96
|
const MIME_JSONRPC = "application/vscode-jsonrpc";
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
|
-
* Implements the
|
|
99
|
+
* Implements the Biome daemon server JSON-RPC protocol over a Socket instance
|
|
100
100
|
*/
|
|
101
101
|
export class Transport {
|
|
102
102
|
/**
|
package/src/workspace.ts
CHANGED
|
@@ -66,13 +66,17 @@ export type StringSet = string[];
|
|
|
66
66
|
*/
|
|
67
67
|
export interface FilesConfiguration {
|
|
68
68
|
/**
|
|
69
|
-
* A list of Unix shell style patterns. Biome
|
|
69
|
+
* A list of Unix shell style patterns. Biome will ignore files/folders that will match these patterns.
|
|
70
70
|
*/
|
|
71
71
|
ignore?: StringSet;
|
|
72
72
|
/**
|
|
73
73
|
* Tells Biome to not emit diagnostics when handling files that doesn't know
|
|
74
74
|
*/
|
|
75
75
|
ignoreUnknown?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* A list of Unix shell style patterns. Biome will handle only those files/folders that will match these patterns.
|
|
78
|
+
*/
|
|
79
|
+
include?: StringSet;
|
|
76
80
|
/**
|
|
77
81
|
* The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reasons. Defaults to 1 MiB
|
|
78
82
|
*/
|
|
@@ -92,13 +96,21 @@ export interface FormatterConfiguration {
|
|
|
92
96
|
*/
|
|
93
97
|
ignore?: StringSet;
|
|
94
98
|
/**
|
|
95
|
-
*
|
|
99
|
+
* A list of Unix shell style patterns. The formatter will include files/folders that will match these patterns.
|
|
100
|
+
*/
|
|
101
|
+
include?: StringSet;
|
|
102
|
+
/**
|
|
103
|
+
* The size of the indentation, 2 by default (deprecated, use `indent-width`)
|
|
96
104
|
*/
|
|
97
105
|
indentSize?: number;
|
|
98
106
|
/**
|
|
99
107
|
* The indent style.
|
|
100
108
|
*/
|
|
101
109
|
indentStyle?: PlainIndentStyle;
|
|
110
|
+
/**
|
|
111
|
+
* The size of the indentation, 2 by default
|
|
112
|
+
*/
|
|
113
|
+
indentWidth?: number;
|
|
102
114
|
/**
|
|
103
115
|
* What's the max width of a line. Defaults to 80.
|
|
104
116
|
*/
|
|
@@ -146,6 +158,10 @@ export interface LinterConfiguration {
|
|
|
146
158
|
* A list of Unix shell style patterns. The formatter will ignore files/folders that will match these patterns.
|
|
147
159
|
*/
|
|
148
160
|
ignore?: StringSet;
|
|
161
|
+
/**
|
|
162
|
+
* A list of Unix shell style patterns. The formatter will include files/folders that will match these patterns.
|
|
163
|
+
*/
|
|
164
|
+
include?: StringSet;
|
|
149
165
|
/**
|
|
150
166
|
* List of rules
|
|
151
167
|
*/
|
|
@@ -160,6 +176,10 @@ export interface OrganizeImports {
|
|
|
160
176
|
* A list of Unix shell style patterns. The formatter will ignore files/folders that will match these patterns.
|
|
161
177
|
*/
|
|
162
178
|
ignore?: StringSet;
|
|
179
|
+
/**
|
|
180
|
+
* A list of Unix shell style patterns. The formatter will include files/folders that will match these patterns.
|
|
181
|
+
*/
|
|
182
|
+
include?: StringSet;
|
|
163
183
|
}
|
|
164
184
|
/**
|
|
165
185
|
* Set of properties to integrate Biome with a VCS software.
|
|
@@ -211,6 +231,10 @@ export interface JavascriptFormatter {
|
|
|
211
231
|
* The indent style applied to JavaScript (and its super languages) files.
|
|
212
232
|
*/
|
|
213
233
|
indentStyle?: PlainIndentStyle;
|
|
234
|
+
/**
|
|
235
|
+
* The size of the indentation applied to JavaScript (and its super languages) files. Default to 2.
|
|
236
|
+
*/
|
|
237
|
+
indentWidth?: number;
|
|
214
238
|
/**
|
|
215
239
|
* The type of quotes used in JSX. Defaults to double.
|
|
216
240
|
*/
|
|
@@ -261,6 +285,10 @@ export interface JsonFormatter {
|
|
|
261
285
|
* The indent style applied to JSON (and its super languages) files.
|
|
262
286
|
*/
|
|
263
287
|
indentStyle?: PlainIndentStyle;
|
|
288
|
+
/**
|
|
289
|
+
* The size of the indentation applied to JSON (and its super languages) files. Default to 2.
|
|
290
|
+
*/
|
|
291
|
+
indentWidth?: number;
|
|
264
292
|
/**
|
|
265
293
|
* What's the max width of a line, applied to JSON (and its super languages) files. Defaults to 80.
|
|
266
294
|
*/
|
|
@@ -274,6 +302,10 @@ export interface JsonParser {
|
|
|
274
302
|
* Allow parsing comments in `.json` files
|
|
275
303
|
*/
|
|
276
304
|
allowComments?: boolean;
|
|
305
|
+
/**
|
|
306
|
+
* Allow parsing trailing commas in `.json` files
|
|
307
|
+
*/
|
|
308
|
+
allowTrailingCommas?: boolean;
|
|
277
309
|
}
|
|
278
310
|
export interface Rules {
|
|
279
311
|
a11y?: A11y;
|
|
@@ -440,7 +472,7 @@ export interface Complexity {
|
|
|
440
472
|
*/
|
|
441
473
|
noForEach?: RuleConfiguration;
|
|
442
474
|
/**
|
|
443
|
-
* Disallow unclear usage of
|
|
475
|
+
* Disallow unclear usage of consecutive space characters in regular expression literals
|
|
444
476
|
*/
|
|
445
477
|
noMultipleSpacesInRegularExpressionLiterals?: RuleConfiguration;
|
|
446
478
|
/**
|
|
@@ -597,7 +629,7 @@ export interface Correctness {
|
|
|
597
629
|
*/
|
|
598
630
|
noUnreachable?: RuleConfiguration;
|
|
599
631
|
/**
|
|
600
|
-
* Ensures the super() constructor is called exactly once on every code
|
|
632
|
+
* Ensures the super() constructor is called exactly once on every code path in a class constructor before this is accessed if the class has a superclass
|
|
601
633
|
*/
|
|
602
634
|
noUnreachableSuper?: RuleConfiguration;
|
|
603
635
|
/**
|
|
@@ -653,6 +685,10 @@ export interface Nursery {
|
|
|
653
685
|
* Disallow the use of spread (...) syntax on accumulators.
|
|
654
686
|
*/
|
|
655
687
|
noAccumulatingSpread?: RuleConfiguration;
|
|
688
|
+
/**
|
|
689
|
+
* Usually, the definition in the standard library is more precise than what people come up with or the used constant exceeds the maximum precision of the number type.
|
|
690
|
+
*/
|
|
691
|
+
noApproximativeNumericConstant?: RuleConfiguration;
|
|
656
692
|
/**
|
|
657
693
|
* Disallow void type outside of generic or return types.
|
|
658
694
|
*/
|
|
@@ -662,7 +698,11 @@ export interface Nursery {
|
|
|
662
698
|
*/
|
|
663
699
|
noDuplicateJsonKeys?: RuleConfiguration;
|
|
664
700
|
/**
|
|
665
|
-
* Disallow
|
|
701
|
+
* Disallow empty character classes in regular expression literals.
|
|
702
|
+
*/
|
|
703
|
+
noEmptyCharacterClassInRegex?: RuleConfiguration;
|
|
704
|
+
/**
|
|
705
|
+
* Disallow functions that exceed a given Cognitive Complexity score.
|
|
666
706
|
*/
|
|
667
707
|
noExcessiveComplexity?: RuleConfiguration;
|
|
668
708
|
/**
|
|
@@ -677,6 +717,22 @@ export interface Nursery {
|
|
|
677
717
|
* Use Number.isNaN instead of global isNaN.
|
|
678
718
|
*/
|
|
679
719
|
noGlobalIsNan?: RuleConfiguration;
|
|
720
|
+
/**
|
|
721
|
+
* Disallow new operators with global non-constructor functions.
|
|
722
|
+
*/
|
|
723
|
+
noInvalidNewBuiltin?: RuleConfiguration;
|
|
724
|
+
/**
|
|
725
|
+
* Enforce proper usage of new and constructor.
|
|
726
|
+
*/
|
|
727
|
+
noMisleadingInstantiator?: RuleConfiguration;
|
|
728
|
+
/**
|
|
729
|
+
* Disallow unused imports.
|
|
730
|
+
*/
|
|
731
|
+
noUnusedImports?: RuleConfiguration;
|
|
732
|
+
/**
|
|
733
|
+
* Disallow else block when the if block breaks early.
|
|
734
|
+
*/
|
|
735
|
+
noUselessElse?: RuleConfiguration;
|
|
680
736
|
/**
|
|
681
737
|
* Disallow the use of void operators, which is not a familiar operator.
|
|
682
738
|
*/
|
|
@@ -689,6 +745,10 @@ export interface Nursery {
|
|
|
689
745
|
* Use arrow functions over function expressions.
|
|
690
746
|
*/
|
|
691
747
|
useArrowFunction?: RuleConfiguration;
|
|
748
|
+
/**
|
|
749
|
+
* Enforce the use of as const over literal type and type annotation.
|
|
750
|
+
*/
|
|
751
|
+
useAsConstAssertion?: RuleConfiguration;
|
|
692
752
|
/**
|
|
693
753
|
* Enforce using else if instead of nested if in else clauses.
|
|
694
754
|
*/
|
|
@@ -713,6 +773,10 @@ export interface Nursery {
|
|
|
713
773
|
* Use Array.isArray() instead of instanceof Array.
|
|
714
774
|
*/
|
|
715
775
|
useIsArray?: RuleConfiguration;
|
|
776
|
+
/**
|
|
777
|
+
* Require assignment operator shorthand where possible.
|
|
778
|
+
*/
|
|
779
|
+
useShorthandAssign?: RuleConfiguration;
|
|
716
780
|
}
|
|
717
781
|
/**
|
|
718
782
|
* A list of rules that belong to this group
|
|
@@ -781,7 +845,7 @@ export interface Style {
|
|
|
781
845
|
*/
|
|
782
846
|
noNamespace?: RuleConfiguration;
|
|
783
847
|
/**
|
|
784
|
-
* Disallow negation in the condition of an if statement if it has an else clause
|
|
848
|
+
* Disallow negation in the condition of an if statement if it has an else clause.
|
|
785
849
|
*/
|
|
786
850
|
noNegationElse?: RuleConfiguration;
|
|
787
851
|
/**
|
|
@@ -817,7 +881,7 @@ export interface Style {
|
|
|
817
881
|
*/
|
|
818
882
|
recommended?: boolean;
|
|
819
883
|
/**
|
|
820
|
-
* Requires following curly brace conventions.
|
|
884
|
+
* Requires following curly brace conventions.
|
|
821
885
|
*/
|
|
822
886
|
useBlockStatements?: RuleConfiguration;
|
|
823
887
|
/**
|
|
@@ -873,7 +937,7 @@ export interface Style {
|
|
|
873
937
|
*/
|
|
874
938
|
useTemplate?: RuleConfiguration;
|
|
875
939
|
/**
|
|
876
|
-
* Enforce the use of while loops instead of for loops when the initializer and update expressions are not needed
|
|
940
|
+
* Enforce the use of while loops instead of for loops when the initializer and update expressions are not needed.
|
|
877
941
|
*/
|
|
878
942
|
useWhile?: RuleConfiguration;
|
|
879
943
|
}
|
|
@@ -938,7 +1002,7 @@ export interface Suspicious {
|
|
|
938
1002
|
*/
|
|
939
1003
|
noDoubleEquals?: RuleConfiguration;
|
|
940
1004
|
/**
|
|
941
|
-
* Disallow duplicate case labels.
|
|
1005
|
+
* Disallow duplicate case labels.
|
|
942
1006
|
*/
|
|
943
1007
|
noDuplicateCase?: RuleConfiguration;
|
|
944
1008
|
/**
|
|
@@ -950,7 +1014,7 @@ export interface Suspicious {
|
|
|
950
1014
|
*/
|
|
951
1015
|
noDuplicateJsxProps?: RuleConfiguration;
|
|
952
1016
|
/**
|
|
953
|
-
* Prevents object literals having more than one property declaration for the same name.
|
|
1017
|
+
* Prevents object literals having more than one property declaration for the same name.
|
|
954
1018
|
*/
|
|
955
1019
|
noDuplicateObjectKeys?: RuleConfiguration;
|
|
956
1020
|
/**
|
|
@@ -1202,7 +1266,6 @@ export type Category =
|
|
|
1202
1266
|
| "lint/a11y/noSvgWithoutTitle"
|
|
1203
1267
|
| "lint/a11y/useAltText"
|
|
1204
1268
|
| "lint/a11y/useAnchorContent"
|
|
1205
|
-
| "lint/a11y/useValidAriaValues"
|
|
1206
1269
|
| "lint/a11y/useAriaPropsForRole"
|
|
1207
1270
|
| "lint/a11y/useButtonType"
|
|
1208
1271
|
| "lint/a11y/useHeadingContent"
|
|
@@ -1213,6 +1276,7 @@ export type Category =
|
|
|
1213
1276
|
| "lint/a11y/useMediaCaption"
|
|
1214
1277
|
| "lint/a11y/useValidAnchor"
|
|
1215
1278
|
| "lint/a11y/useValidAriaProps"
|
|
1279
|
+
| "lint/a11y/useValidAriaValues"
|
|
1216
1280
|
| "lint/a11y/useValidLang"
|
|
1217
1281
|
| "lint/complexity/noBannedTypes"
|
|
1218
1282
|
| "lint/complexity/noExtraBooleanCast"
|
|
@@ -1264,14 +1328,21 @@ export type Category =
|
|
|
1264
1328
|
| "lint/correctness/useValidForDirection"
|
|
1265
1329
|
| "lint/correctness/useYield"
|
|
1266
1330
|
| "lint/nursery/noAccumulatingSpread"
|
|
1331
|
+
| "lint/nursery/noApproximativeNumericConstant"
|
|
1267
1332
|
| "lint/nursery/noConfusingVoidType"
|
|
1268
1333
|
| "lint/nursery/noDuplicateJsonKeys"
|
|
1334
|
+
| "lint/nursery/noEmptyCharacterClassInRegex"
|
|
1269
1335
|
| "lint/nursery/noExcessiveComplexity"
|
|
1270
1336
|
| "lint/nursery/noFallthroughSwitchClause"
|
|
1271
1337
|
| "lint/nursery/noGlobalIsFinite"
|
|
1272
1338
|
| "lint/nursery/noGlobalIsNan"
|
|
1339
|
+
| "lint/nursery/noInvalidNewBuiltin"
|
|
1340
|
+
| "lint/nursery/noMisleadingInstantiator"
|
|
1341
|
+
| "lint/nursery/noUnusedImports"
|
|
1342
|
+
| "lint/nursery/noUselessElse"
|
|
1273
1343
|
| "lint/nursery/noVoid"
|
|
1274
1344
|
| "lint/nursery/useArrowFunction"
|
|
1345
|
+
| "lint/nursery/useAsConstAssertion"
|
|
1275
1346
|
| "lint/nursery/useBiomeSuppressionComment"
|
|
1276
1347
|
| "lint/nursery/useCollapsedElseIf"
|
|
1277
1348
|
| "lint/nursery/useExhaustiveDependencies"
|
|
@@ -1279,6 +1350,7 @@ export type Category =
|
|
|
1279
1350
|
| "lint/nursery/useHookAtTopLevel"
|
|
1280
1351
|
| "lint/nursery/useImportRestrictions"
|
|
1281
1352
|
| "lint/nursery/useIsArray"
|
|
1353
|
+
| "lint/nursery/useShorthandAssign"
|
|
1282
1354
|
| "lint/performance/noDelete"
|
|
1283
1355
|
| "lint/security/noDangerouslySetInnerHtml"
|
|
1284
1356
|
| "lint/security/noDangerouslySetInnerHtmlWithChildren"
|
|
@@ -1439,6 +1511,8 @@ export type MarkupElement =
|
|
|
1439
1511
|
| "Success"
|
|
1440
1512
|
| "Warn"
|
|
1441
1513
|
| "Info"
|
|
1514
|
+
| "Debug"
|
|
1515
|
+
| "Trace"
|
|
1442
1516
|
| "Inverse"
|
|
1443
1517
|
| { Hyperlink: { href: string } };
|
|
1444
1518
|
export type CompressedOp =
|