@biomejs/wasm-web 2.0.0-beta.5 → 2.0.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/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";
@@ -744,7 +769,7 @@ type QuoteProperties = "asNeeded" | "preserve";
744
769
  type Semicolons = "always" | "asNeeded";
745
770
  type TrailingCommas = "all" | "es5" | "none";
746
771
  type TrailingCommas2 = "none" | "all";
747
- type RuleDomain = "react" | "test" | "solid" | "next" | "project";
772
+ type RuleDomain = "react" | "test" | "solid" | "next" | "vue" | "project";
748
773
  type RuleDomainValue = "all" | "none" | "recommended";
749
774
  type SeverityOrGroup_for_A11y = GroupPlainConfiguration | A11y;
750
775
  type SeverityOrGroup_for_Complexity = GroupPlainConfiguration | Complexity;
@@ -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
  */
@@ -1635,7 +1684,7 @@ interface Style {
1635
1684
  /**
1636
1685
  * Disallow reassigning function parameters.
1637
1686
  */
1638
- noParameterAssign?: RuleConfiguration_for_Null;
1687
+ noParameterAssign?: RuleConfiguration_for_NoParameterAssignOptions;
1639
1688
  /**
1640
1689
  * Disallow the use of parameter properties in class constructors.
1641
1690
  */
@@ -2243,6 +2292,9 @@ type RuleFixConfiguration_for_UtilityClassSortingOptions =
2243
2292
  type RuleFixConfiguration_for_NoBlankTargetOptions =
2244
2293
  | RulePlainConfiguration
2245
2294
  | RuleWithFixOptions_for_NoBlankTargetOptions;
2295
+ type RuleConfiguration_for_NoParameterAssignOptions =
2296
+ | RulePlainConfiguration
2297
+ | RuleWithOptions_for_NoParameterAssignOptions;
2246
2298
  type RuleConfiguration_for_RestrictedGlobalsOptions =
2247
2299
  | RulePlainConfiguration
2248
2300
  | RuleWithOptions_for_RestrictedGlobalsOptions;
@@ -2528,6 +2580,16 @@ interface RuleWithFixOptions_for_NoBlankTargetOptions {
2528
2580
  */
2529
2581
  options: NoBlankTargetOptions;
2530
2582
  }
2583
+ interface RuleWithOptions_for_NoParameterAssignOptions {
2584
+ /**
2585
+ * The severity of the emitted diagnostics by the rule
2586
+ */
2587
+ level: RulePlainConfiguration;
2588
+ /**
2589
+ * Rule's options
2590
+ */
2591
+ options: NoParameterAssignOptions;
2592
+ }
2531
2593
  interface RuleWithOptions_for_RestrictedGlobalsOptions {
2532
2594
  /**
2533
2595
  * The severity of the emitted diagnostics by the rule
@@ -2754,7 +2816,7 @@ interface UndeclaredVariablesOptions {
2754
2816
  }
2755
2817
  interface NoUnusedVariablesOptions {
2756
2818
  /**
2757
- * Whether to ignore unused variables from an object destructuring with a spread (i.e.: whether `a` and `b` in `const { a, b, ...rest } = obj` should be ignored by this rule).
2819
+ * Whether to ignore unused variables from an object destructuring with a spread.
2758
2820
  */
2759
2821
  ignoreRestSiblings?: boolean;
2760
2822
  }
@@ -2829,6 +2891,12 @@ interface NoBlankTargetOptions {
2829
2891
  */
2830
2892
  allowNoReferrer?: boolean;
2831
2893
  }
2894
+ interface NoParameterAssignOptions {
2895
+ /**
2896
+ * Whether to report an error when a dependency is listed in the dependencies array but isn't used. Defaults to `allow`.
2897
+ */
2898
+ propertyAssignment?: PropertyAssignmentMode;
2899
+ }
2832
2900
  interface RestrictedGlobalsOptions {
2833
2901
  /**
2834
2902
  * A list of names that should trigger the rule
@@ -2949,6 +3017,7 @@ For example, for React's `useRef()` hook the value would be `true`, while for `u
2949
3017
  }
2950
3018
  type CustomRestrictedElements = Record<string, string>;
2951
3019
  type ObjectPropertySyntax = "explicit" | "shorthand";
3020
+ type PropertyAssignmentMode = "allow" | "deny";
2952
3021
  type CustomRestrictedImport = string | CustomRestrictedImportOptions;
2953
3022
  type CustomRestrictedType = string | CustomRestrictedTypeOptions;
2954
3023
  type ConsistentArrayType = "shorthand" | "generic";
@@ -3136,7 +3205,9 @@ type Category =
3136
3205
  | "lint/a11y/useValidAutocomplete"
3137
3206
  | "lint/a11y/useValidLang"
3138
3207
  | "lint/complexity/noAdjacentSpacesInRegex"
3208
+ | "lint/complexity/noArguments"
3139
3209
  | "lint/complexity/noBannedTypes"
3210
+ | "lint/complexity/noCommaOperator"
3140
3211
  | "lint/complexity/noEmptyTypeParameters"
3141
3212
  | "lint/complexity/noExcessiveCognitiveComplexity"
3142
3213
  | "lint/complexity/noExcessiveNestedTestSuites"
@@ -3250,6 +3321,7 @@ type Category =
3250
3321
  | "lint/nursery/noNestedComponentDefinitions"
3251
3322
  | "lint/nursery/noNoninteractiveElementInteractions"
3252
3323
  | "lint/nursery/noProcessGlobal"
3324
+ | "lint/nursery/noReactPropAssign"
3253
3325
  | "lint/nursery/noReactSpecificProps"
3254
3326
  | "lint/nursery/noRestrictedElements"
3255
3327
  | "lint/nursery/noSecrets"
@@ -3273,6 +3345,7 @@ type Category =
3273
3345
  | "lint/nursery/useAdjacentGetterSetter"
3274
3346
  | "lint/nursery/useBiomeSuppressionComment"
3275
3347
  | "lint/nursery/useConsistentObjectDefinition"
3348
+ | "lint/nursery/useConsistentResponse"
3276
3349
  | "lint/nursery/useExhaustiveSwitchCases"
3277
3350
  | "lint/nursery/useExplicitFunctionReturnType"
3278
3351
  | "lint/nursery/useExplicitType"
@@ -3280,16 +3353,20 @@ type Category =
3280
3353
  | "lint/nursery/useForComponent"
3281
3354
  | "lint/nursery/useGoogleFontPreconnect"
3282
3355
  | "lint/nursery/useImportRestrictions"
3356
+ | "lint/nursery/useIndexOf"
3283
3357
  | "lint/nursery/useIterableCallbackReturn"
3358
+ | "lint/nursery/useJsonImportAttribute"
3284
3359
  | "lint/nursery/useJsxCurlyBraceConvention"
3285
3360
  | "lint/nursery/useNamedOperation"
3286
3361
  | "lint/nursery/useNamingConvention"
3287
3362
  | "lint/nursery/useNumericSeparators"
3363
+ | "lint/nursery/useObjectSpread"
3288
3364
  | "lint/nursery/useParseIntRadix"
3289
3365
  | "lint/nursery/useSingleJsDocAsterisk"
3290
3366
  | "lint/nursery/useSortedClasses"
3291
3367
  | "lint/nursery/useSortedProperties"
3292
3368
  | "lint/nursery/useSymbolDescription"
3369
+ | "lint/nursery/useUniqueElementIds"
3293
3370
  | "lint/performance/noAccumulatingSpread"
3294
3371
  | "lint/performance/noBarrelFile"
3295
3372
  | "lint/performance/noDelete"
@@ -3302,8 +3379,6 @@ type Category =
3302
3379
  | "lint/security/noDangerouslySetInnerHtml"
3303
3380
  | "lint/security/noDangerouslySetInnerHtmlWithChildren"
3304
3381
  | "lint/security/noGlobalEval"
3305
- | "lint/style/noArguments"
3306
- | "lint/style/noCommaOperator"
3307
3382
  | "lint/style/noCommonJs"
3308
3383
  | "lint/style/noDefaultExport"
3309
3384
  | "lint/style/noDescendingSpecificity"
@@ -3558,6 +3633,10 @@ interface BacktraceSymbol {
3558
3633
  name?: string;
3559
3634
  }
3560
3635
  interface OpenProjectParams {
3636
+ /**
3637
+ * Whether the client wants to run only certain rules. This is needed to compute the kind of [ScanKind].
3638
+ */
3639
+ onlyRules?: RuleCode[];
3561
3640
  /**
3562
3641
  * Whether the folder should be opened as a project, even if no `biome.json` can be found.
3563
3642
  */
@@ -3566,7 +3645,23 @@ interface OpenProjectParams {
3566
3645
  * The path to open
3567
3646
  */
3568
3647
  path: BiomePath;
3648
+ /**
3649
+ * Whether the client wants to skip some lint rule. This is needed to compute the kind of [ScanKind].
3650
+ */
3651
+ skipRules?: RuleCode[];
3569
3652
  }
3653
+ type RuleCode = string;
3654
+ interface OpenProjectResult {
3655
+ /**
3656
+ * A unique identifier for this project
3657
+ */
3658
+ projectKey: ProjectKey;
3659
+ /**
3660
+ * How to scan this project
3661
+ */
3662
+ scanKind: ScanKind;
3663
+ }
3664
+ type ScanKind = "none" | "knownFiles" | "project";
3570
3665
  interface OpenFileParams {
3571
3666
  content: FileContent;
3572
3667
  documentFileSource?: DocumentFileSource;
@@ -3695,7 +3790,6 @@ interface PullDiagnosticsParams {
3695
3790
  skip?: RuleCode[];
3696
3791
  }
3697
3792
  type RuleCategories = RuleCategory[];
3698
- type RuleCode = string;
3699
3793
  type RuleCategory = "syntax" | "lint" | "action" | "transformation";
3700
3794
  interface PullDiagnosticsResult {
3701
3795
  diagnostics: Diagnostic[];
@@ -3703,6 +3797,7 @@ interface PullDiagnosticsResult {
3703
3797
  skippedDiagnostics: number;
3704
3798
  }
3705
3799
  interface PullActionsParams {
3800
+ categories?: RuleCategories;
3706
3801
  enabledRules?: RuleCode[];
3707
3802
  only?: RuleCode[];
3708
3803
  path: BiomePath;
@@ -3871,7 +3966,7 @@ export class Workspace {
3871
3966
  constructor();
3872
3967
  fileFeatures(params: SupportsFeatureParams): FileFeaturesResult;
3873
3968
  updateSettings(params: UpdateSettingsParams): UpdateSettingsResult;
3874
- openProject(params: OpenProjectParams): ProjectKey;
3969
+ openProject(params: OpenProjectParams): OpenProjectResult;
3875
3970
  openFile(params: OpenFileParams): void;
3876
3971
  getFileContent(params: GetFileContentParams): string;
3877
3972
  getSyntaxTree(params: GetSyntaxTreeParams): GetSyntaxTreeResult;
package/biome_wasm.js CHANGED
@@ -297,7 +297,7 @@ export class Workspace {
297
297
  }
298
298
  /**
299
299
  * @param {OpenProjectParams} params
300
- * @returns {ProjectKey}
300
+ * @returns {OpenProjectResult}
301
301
  */
302
302
  openProject(params) {
303
303
  const ret = wasm.workspace_openProject(this.__wbg_ptr, params);
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Biome Developers and Contributors"
6
6
  ],
7
7
  "description": "WebAssembly bindings to the Biome workspace API",
8
- "version": "2.0.0-beta.5",
8
+ "version": "2.0.0",
9
9
  "license": "MIT OR Apache-2.0",
10
10
  "repository": {
11
11
  "type": "git",