@biomejs/backend-jsonrpc 1.2.1 → 1.2.2-nightly.ee2e2ab

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 CHANGED
@@ -1 +1 @@
1
- {"name":"@biomejs/backend-jsonrpc","version":"1.2.1","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.1","@biomejs/cli-win32-arm64":"1.2.1","@biomejs/cli-darwin-x64":"1.2.1","@biomejs/cli-darwin-arm64":"1.2.1","@biomejs/cli-linux-x64":"1.2.1","@biomejs/cli-linux-arm64":"1.2.1"}}
1
+ {"name":"@biomejs/backend-jsonrpc","version":"1.2.2-nightly.ee2e2ab","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.ee2e2ab","@biomejs/cli-win32-arm64":"1.2.2-nightly.ee2e2ab","@biomejs/cli-darwin-x64":"1.2.2-nightly.ee2e2ab","@biomejs/cli-darwin-arm64":"1.2.2-nightly.ee2e2ab","@biomejs/cli-linux-x64":"1.2.2-nightly.ee2e2ab","@biomejs/cli-linux-arm64":"1.2.2-nightly.ee2e2ab"}}
package/src/command.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Gets the path of the Rome binary for the current platform
2
+ * Gets the path of the Biome binary for the current platform
3
3
  *
4
4
  * @returns Filesystem path to the binary, or null if no prebuilt distribution exists for the current platform
5
5
  */
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 Rome binary distribution
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 Rome daemon server is running and create a Socket connected to the RPC channel
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 Rome daemon binary
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 Rome daemon server JSON-RPC protocol over a Socket instance
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 tools will ignore files/folders that will match these patterns.
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
- * The size of the indentation, 2 by default
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 multiple space characters in regular expression literals
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 path in a class constructor before this is accessed if the class has a superclass
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 functions that exceed a given complexity score.
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,26 @@ 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 shorthand assign when variable appears on both sides.
730
+ */
731
+ noMisrefactoredShorthandAssign?: RuleConfiguration;
732
+ /**
733
+ * Disallow unused imports.
734
+ */
735
+ noUnusedImports?: RuleConfiguration;
736
+ /**
737
+ * Disallow else block when the if block breaks early.
738
+ */
739
+ noUselessElse?: RuleConfiguration;
680
740
  /**
681
741
  * Disallow the use of void operators, which is not a familiar operator.
682
742
  */
@@ -689,12 +749,16 @@ export interface Nursery {
689
749
  * Use arrow functions over function expressions.
690
750
  */
691
751
  useArrowFunction?: RuleConfiguration;
752
+ /**
753
+ * Enforce the use of as const over literal type and type annotation.
754
+ */
755
+ useAsConstAssertion?: RuleConfiguration;
692
756
  /**
693
757
  * Enforce using else if instead of nested if in else clauses.
694
758
  */
695
759
  useCollapsedElseIf?: RuleConfiguration;
696
760
  /**
697
- * Enforce all dependencies are correctly specified.
761
+ * Enforce all dependencies are correctly specified in a React hook.
698
762
  */
699
763
  useExhaustiveDependencies?: RuleConfiguration;
700
764
  /**
@@ -713,6 +777,10 @@ export interface Nursery {
713
777
  * Use Array.isArray() instead of instanceof Array.
714
778
  */
715
779
  useIsArray?: RuleConfiguration;
780
+ /**
781
+ * Require assignment operator shorthand where possible.
782
+ */
783
+ useShorthandAssign?: RuleConfiguration;
716
784
  }
717
785
  /**
718
786
  * A list of rules that belong to this group
@@ -781,7 +849,7 @@ export interface Style {
781
849
  */
782
850
  noNamespace?: RuleConfiguration;
783
851
  /**
784
- * Disallow negation in the condition of an if statement if it has an else clause
852
+ * Disallow negation in the condition of an if statement if it has an else clause.
785
853
  */
786
854
  noNegationElse?: RuleConfiguration;
787
855
  /**
@@ -817,7 +885,7 @@ export interface Style {
817
885
  */
818
886
  recommended?: boolean;
819
887
  /**
820
- * Requires following curly brace conventions. JavaScript allows the omission of curly braces when a block contains only one statement. However, it is considered by many to be best practice to never omit curly braces around blocks, even when they are optional, because it can lead to bugs and reduces code clarity.
888
+ * Requires following curly brace conventions.
821
889
  */
822
890
  useBlockStatements?: RuleConfiguration;
823
891
  /**
@@ -873,7 +941,7 @@ export interface Style {
873
941
  */
874
942
  useTemplate?: RuleConfiguration;
875
943
  /**
876
- * Enforce the use of while loops instead of for loops when the initializer and update expressions are not needed
944
+ * Enforce the use of while loops instead of for loops when the initializer and update expressions are not needed.
877
945
  */
878
946
  useWhile?: RuleConfiguration;
879
947
  }
@@ -938,7 +1006,7 @@ export interface Suspicious {
938
1006
  */
939
1007
  noDoubleEquals?: RuleConfiguration;
940
1008
  /**
941
- * Disallow duplicate case labels. If a switch statement has duplicate test expressions in case clauses, it is likely that a programmer copied a case clause but forgot to change the test expression.
1009
+ * Disallow duplicate case labels.
942
1010
  */
943
1011
  noDuplicateCase?: RuleConfiguration;
944
1012
  /**
@@ -950,7 +1018,7 @@ export interface Suspicious {
950
1018
  */
951
1019
  noDuplicateJsxProps?: RuleConfiguration;
952
1020
  /**
953
- * Prevents object literals having more than one property declaration for the same name. If an object property with the same name is defined multiple times (except when combining a getter with a setter), only the last definition makes it into the object and previous definitions are ignored, which is likely a mistake.
1021
+ * Prevents object literals having more than one property declaration for the same name.
954
1022
  */
955
1023
  noDuplicateObjectKeys?: RuleConfiguration;
956
1024
  /**
@@ -1202,7 +1270,6 @@ export type Category =
1202
1270
  | "lint/a11y/noSvgWithoutTitle"
1203
1271
  | "lint/a11y/useAltText"
1204
1272
  | "lint/a11y/useAnchorContent"
1205
- | "lint/a11y/useValidAriaValues"
1206
1273
  | "lint/a11y/useAriaPropsForRole"
1207
1274
  | "lint/a11y/useButtonType"
1208
1275
  | "lint/a11y/useHeadingContent"
@@ -1213,6 +1280,7 @@ export type Category =
1213
1280
  | "lint/a11y/useMediaCaption"
1214
1281
  | "lint/a11y/useValidAnchor"
1215
1282
  | "lint/a11y/useValidAriaProps"
1283
+ | "lint/a11y/useValidAriaValues"
1216
1284
  | "lint/a11y/useValidLang"
1217
1285
  | "lint/complexity/noBannedTypes"
1218
1286
  | "lint/complexity/noExtraBooleanCast"
@@ -1264,14 +1332,22 @@ export type Category =
1264
1332
  | "lint/correctness/useValidForDirection"
1265
1333
  | "lint/correctness/useYield"
1266
1334
  | "lint/nursery/noAccumulatingSpread"
1335
+ | "lint/nursery/noApproximativeNumericConstant"
1267
1336
  | "lint/nursery/noConfusingVoidType"
1268
1337
  | "lint/nursery/noDuplicateJsonKeys"
1338
+ | "lint/nursery/noEmptyCharacterClassInRegex"
1269
1339
  | "lint/nursery/noExcessiveComplexity"
1270
1340
  | "lint/nursery/noFallthroughSwitchClause"
1271
1341
  | "lint/nursery/noGlobalIsFinite"
1272
1342
  | "lint/nursery/noGlobalIsNan"
1343
+ | "lint/nursery/noInvalidNewBuiltin"
1344
+ | "lint/nursery/noMisleadingInstantiator"
1345
+ | "lint/nursery/noMisrefactoredShorthandAssign"
1346
+ | "lint/nursery/noUnusedImports"
1347
+ | "lint/nursery/noUselessElse"
1273
1348
  | "lint/nursery/noVoid"
1274
1349
  | "lint/nursery/useArrowFunction"
1350
+ | "lint/nursery/useAsConstAssertion"
1275
1351
  | "lint/nursery/useBiomeSuppressionComment"
1276
1352
  | "lint/nursery/useCollapsedElseIf"
1277
1353
  | "lint/nursery/useExhaustiveDependencies"
@@ -1279,6 +1355,7 @@ export type Category =
1279
1355
  | "lint/nursery/useHookAtTopLevel"
1280
1356
  | "lint/nursery/useImportRestrictions"
1281
1357
  | "lint/nursery/useIsArray"
1358
+ | "lint/nursery/useShorthandAssign"
1282
1359
  | "lint/performance/noDelete"
1283
1360
  | "lint/security/noDangerouslySetInnerHtml"
1284
1361
  | "lint/security/noDangerouslySetInnerHtmlWithChildren"
@@ -1439,6 +1516,8 @@ export type MarkupElement =
1439
1516
  | "Success"
1440
1517
  | "Warn"
1441
1518
  | "Info"
1519
+ | "Debug"
1520
+ | "Trace"
1442
1521
  | "Inverse"
1443
1522
  | { Hyperlink: { href: string } };
1444
1523
  export type CompressedOp =