@biomejs/wasm-nodejs 2.0.0-beta.5 → 2.0.0-beta.6

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/biome_wasm.d.ts CHANGED
@@ -40,7 +40,7 @@ interface Configuration {
40
40
  /**
41
41
  * A list of paths to other JSON files, used to extends the current configuration.
42
42
  */
43
- extends?: string[];
43
+ extends?: Extends;
44
44
  /**
45
45
  * The configuration of the filesystem
46
46
  */
@@ -127,7 +127,28 @@ interface CssConfiguration {
127
127
  */
128
128
  parser?: CssParserConfiguration;
129
129
  }
130
+ type Extends = string[] | string;
130
131
  interface FilesConfiguration {
132
+ /**
133
+ * Set of file and folder names that should be unconditionally ignored by Biome's scanner.
134
+
135
+ Biome maintains an internal list of default ignore entries, which is based on user feedback and which may change in any release. This setting allows overriding this internal list completely.
136
+
137
+ This is considered an advanced feature that users _should_ not need to tweak themselves, but they can as a last resort. This setting can only be configured in root configurations, and is ignored in nested configs.
138
+
139
+ Entries must be file or folder *names*. Specific paths and globs are not supported.
140
+
141
+ Examples where this may be useful:
142
+
143
+ ```jsonc { "files": { "experimentalScannerIgnores": [ // You almost certainly don't want to scan your `.git` // folder, which is why it's already ignored by default: ".git",
144
+
145
+ // But the scanner does scan `node_modules` by default. If // you *really* don't want this, you can ignore it like // this: "node_modules",
146
+
147
+ // But it's probably better to ignore a specific dependency. // For instance, one that happens to be particularly slow to // scan: "RedisCommander.d.ts", ], } } ```
148
+
149
+ Please be aware that rules relying on the module graph or type inference information may be negatively affected if dependencies of your project aren't (fully) scanned.
150
+ */
151
+ experimentalScannerIgnores?: string[];
131
152
  /**
132
153
  * Tells Biome to not emit diagnostics when handling files that doesn't know
133
154
  */
@@ -709,6 +730,10 @@ interface OverridePattern {
709
730
  * Specific configuration for the Json language
710
731
  */
711
732
  linter?: OverrideLinterConfiguration;
733
+ /**
734
+ * Specific configuration for additional plugins
735
+ */
736
+ plugins?: Plugins;
712
737
  }
713
738
  type PluginConfiguration = string;
714
739
  type VcsClientKind = "git";
@@ -990,10 +1015,18 @@ interface Complexity {
990
1015
  * Disallow unclear usage of consecutive space characters in regular expression literals
991
1016
  */
992
1017
  noAdjacentSpacesInRegex?: RuleFixConfiguration_for_Null;
1018
+ /**
1019
+ * Disallow the use of arguments.
1020
+ */
1021
+ noArguments?: RuleConfiguration_for_Null;
993
1022
  /**
994
1023
  * Disallow primitive type aliases and misleading types.
995
1024
  */
996
1025
  noBannedTypes?: RuleFixConfiguration_for_Null;
1026
+ /**
1027
+ * Disallow comma operator.
1028
+ */
1029
+ noCommaOperator?: RuleConfiguration_for_Null;
997
1030
  /**
998
1031
  * Disallow empty type parameters in type aliases and interfaces.
999
1032
  */
@@ -1406,6 +1439,10 @@ interface Nursery {
1406
1439
  * Disallow the use of process global.
1407
1440
  */
1408
1441
  noProcessGlobal?: RuleFixConfiguration_for_Null;
1442
+ /**
1443
+ * Disallow assigning to React component props.
1444
+ */
1445
+ noReactPropAssign?: RuleConfiguration_for_Null;
1409
1446
  /**
1410
1447
  * Disallow the use of configured elements.
1411
1448
  */
@@ -1458,6 +1495,10 @@ interface Nursery {
1458
1495
  * Require the consistent declaration of object literals. Defaults to explicit definitions.
1459
1496
  */
1460
1497
  useConsistentObjectDefinition?: RuleFixConfiguration_for_UseConsistentObjectDefinitionOptions;
1498
+ /**
1499
+ * Use static Response methods instead of new Response() constructor when possible.
1500
+ */
1501
+ useConsistentResponse?: RuleFixConfiguration_for_Null;
1461
1502
  /**
1462
1503
  * Require switch-case statements to be exhaustive.
1463
1504
  */
@@ -1478,10 +1519,18 @@ interface Nursery {
1478
1519
  * Ensure the preconnect attribute is used when using Google Fonts.
1479
1520
  */
1480
1521
  useGoogleFontPreconnect?: RuleFixConfiguration_for_Null;
1522
+ /**
1523
+ * Prefer Array#{indexOf,lastIndexOf}() over Array#{findIndex,findLastIndex}() when looking for the index of an item.
1524
+ */
1525
+ useIndexOf?: RuleFixConfiguration_for_Null;
1481
1526
  /**
1482
1527
  * Enforce consistent return values in iterable callbacks.
1483
1528
  */
1484
1529
  useIterableCallbackReturn?: RuleConfiguration_for_Null;
1530
+ /**
1531
+ * Enforces the use of with { type: "json" } for JSON module imports.
1532
+ */
1533
+ useJsonImportAttribute?: RuleFixConfiguration_for_Null;
1485
1534
  /**
1486
1535
  * Enforce specifying the name of GraphQL operations.
1487
1536
  */
@@ -1494,6 +1543,10 @@ interface Nursery {
1494
1543
  * Enforce the use of numeric separators in numeric literals.
1495
1544
  */
1496
1545
  useNumericSeparators?: RuleFixConfiguration_for_Null;
1546
+ /**
1547
+ * Prefer object spread over Object.assign() when constructing new objects.
1548
+ */
1549
+ useObjectSpread?: RuleFixConfiguration_for_Null;
1497
1550
  /**
1498
1551
  * Enforce the consistent use of the radix argument when using parseInt().
1499
1552
  */
@@ -1510,6 +1563,10 @@ interface Nursery {
1510
1563
  * Require a description parameter for the Symbol().
1511
1564
  */
1512
1565
  useSymbolDescription?: RuleConfiguration_for_Null;
1566
+ /**
1567
+ * Prevent the usage of static string literal id attribute on elements.
1568
+ */
1569
+ useUniqueElementIds?: RuleConfiguration_for_Null;
1513
1570
  }
1514
1571
  interface Performance {
1515
1572
  /**
@@ -1572,14 +1629,6 @@ interface Security {
1572
1629
  recommended?: boolean;
1573
1630
  }
1574
1631
  interface Style {
1575
- /**
1576
- * Disallow the use of arguments.
1577
- */
1578
- noArguments?: RuleConfiguration_for_Null;
1579
- /**
1580
- * Disallow comma operator.
1581
- */
1582
- noCommaOperator?: RuleConfiguration_for_Null;
1583
1632
  /**
1584
1633
  * Disallow use of CommonJs module system in favor of ESM style imports.
1585
1634
  */
@@ -3136,7 +3185,9 @@ type Category =
3136
3185
  | "lint/a11y/useValidAutocomplete"
3137
3186
  | "lint/a11y/useValidLang"
3138
3187
  | "lint/complexity/noAdjacentSpacesInRegex"
3188
+ | "lint/complexity/noArguments"
3139
3189
  | "lint/complexity/noBannedTypes"
3190
+ | "lint/complexity/noCommaOperator"
3140
3191
  | "lint/complexity/noEmptyTypeParameters"
3141
3192
  | "lint/complexity/noExcessiveCognitiveComplexity"
3142
3193
  | "lint/complexity/noExcessiveNestedTestSuites"
@@ -3250,6 +3301,7 @@ type Category =
3250
3301
  | "lint/nursery/noNestedComponentDefinitions"
3251
3302
  | "lint/nursery/noNoninteractiveElementInteractions"
3252
3303
  | "lint/nursery/noProcessGlobal"
3304
+ | "lint/nursery/noReactPropAssign"
3253
3305
  | "lint/nursery/noReactSpecificProps"
3254
3306
  | "lint/nursery/noRestrictedElements"
3255
3307
  | "lint/nursery/noSecrets"
@@ -3273,6 +3325,7 @@ type Category =
3273
3325
  | "lint/nursery/useAdjacentGetterSetter"
3274
3326
  | "lint/nursery/useBiomeSuppressionComment"
3275
3327
  | "lint/nursery/useConsistentObjectDefinition"
3328
+ | "lint/nursery/useConsistentResponse"
3276
3329
  | "lint/nursery/useExhaustiveSwitchCases"
3277
3330
  | "lint/nursery/useExplicitFunctionReturnType"
3278
3331
  | "lint/nursery/useExplicitType"
@@ -3280,16 +3333,20 @@ type Category =
3280
3333
  | "lint/nursery/useForComponent"
3281
3334
  | "lint/nursery/useGoogleFontPreconnect"
3282
3335
  | "lint/nursery/useImportRestrictions"
3336
+ | "lint/nursery/useIndexOf"
3283
3337
  | "lint/nursery/useIterableCallbackReturn"
3338
+ | "lint/nursery/useJsonImportAttribute"
3284
3339
  | "lint/nursery/useJsxCurlyBraceConvention"
3285
3340
  | "lint/nursery/useNamedOperation"
3286
3341
  | "lint/nursery/useNamingConvention"
3287
3342
  | "lint/nursery/useNumericSeparators"
3343
+ | "lint/nursery/useObjectSpread"
3288
3344
  | "lint/nursery/useParseIntRadix"
3289
3345
  | "lint/nursery/useSingleJsDocAsterisk"
3290
3346
  | "lint/nursery/useSortedClasses"
3291
3347
  | "lint/nursery/useSortedProperties"
3292
3348
  | "lint/nursery/useSymbolDescription"
3349
+ | "lint/nursery/useUniqueElementIds"
3293
3350
  | "lint/performance/noAccumulatingSpread"
3294
3351
  | "lint/performance/noBarrelFile"
3295
3352
  | "lint/performance/noDelete"
@@ -3302,8 +3359,6 @@ type Category =
3302
3359
  | "lint/security/noDangerouslySetInnerHtml"
3303
3360
  | "lint/security/noDangerouslySetInnerHtmlWithChildren"
3304
3361
  | "lint/security/noGlobalEval"
3305
- | "lint/style/noArguments"
3306
- | "lint/style/noCommaOperator"
3307
3362
  | "lint/style/noCommonJs"
3308
3363
  | "lint/style/noDefaultExport"
3309
3364
  | "lint/style/noDescendingSpecificity"
@@ -3558,6 +3613,10 @@ interface BacktraceSymbol {
3558
3613
  name?: string;
3559
3614
  }
3560
3615
  interface OpenProjectParams {
3616
+ /**
3617
+ * Whether the client wants to run only certain rules. This is needed to compute the kind of [ScanKind].
3618
+ */
3619
+ onlyRules?: RuleCode[];
3561
3620
  /**
3562
3621
  * Whether the folder should be opened as a project, even if no `biome.json` can be found.
3563
3622
  */
@@ -3566,7 +3625,23 @@ interface OpenProjectParams {
3566
3625
  * The path to open
3567
3626
  */
3568
3627
  path: BiomePath;
3628
+ /**
3629
+ * Whether the client wants to skip some lint rule. This is needed to compute the kind of [ScanKind].
3630
+ */
3631
+ skipRules?: RuleCode[];
3569
3632
  }
3633
+ type RuleCode = string;
3634
+ interface OpenProjectResult {
3635
+ /**
3636
+ * A unique identifier for this project
3637
+ */
3638
+ projectKey: ProjectKey;
3639
+ /**
3640
+ * How to scan this project
3641
+ */
3642
+ scanKind: ScanKind;
3643
+ }
3644
+ type ScanKind = "none" | "knownFiles" | "project";
3570
3645
  interface OpenFileParams {
3571
3646
  content: FileContent;
3572
3647
  documentFileSource?: DocumentFileSource;
@@ -3695,7 +3770,6 @@ interface PullDiagnosticsParams {
3695
3770
  skip?: RuleCode[];
3696
3771
  }
3697
3772
  type RuleCategories = RuleCategory[];
3698
- type RuleCode = string;
3699
3773
  type RuleCategory = "syntax" | "lint" | "action" | "transformation";
3700
3774
  interface PullDiagnosticsResult {
3701
3775
  diagnostics: Diagnostic[];
@@ -3871,7 +3945,7 @@ export class Workspace {
3871
3945
  constructor();
3872
3946
  fileFeatures(params: SupportsFeatureParams): FileFeaturesResult;
3873
3947
  updateSettings(params: UpdateSettingsParams): UpdateSettingsResult;
3874
- openProject(params: OpenProjectParams): ProjectKey;
3948
+ openProject(params: OpenProjectParams): OpenProjectResult;
3875
3949
  openFile(params: OpenFileParams): void;
3876
3950
  getFileContent(params: GetFileContentParams): string;
3877
3951
  getSyntaxTree(params: GetSyntaxTreeParams): GetSyntaxTreeResult;
package/biome_wasm.js CHANGED
@@ -302,7 +302,7 @@ class Workspace {
302
302
  }
303
303
  /**
304
304
  * @param {OpenProjectParams} params
305
- * @returns {ProjectKey}
305
+ * @returns {OpenProjectResult}
306
306
  */
307
307
  openProject(params) {
308
308
  const ret = wasm.workspace_openProject(this.__wbg_ptr, params);
Binary file
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "Biome Developers and Contributors"
5
5
  ],
6
6
  "description": "WebAssembly bindings to the Biome workspace API",
7
- "version": "2.0.0-beta.5",
7
+ "version": "2.0.0-beta.6",
8
8
  "license": "MIT OR Apache-2.0",
9
9
  "repository": {
10
10
  "type": "git",