rsbuild-plugin-biome 0.1.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Rspack Contrib
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # rsbuild-plugin-biome
2
+
3
+ rslint plugin for Rsbuild.
4
+
5
+ <p>
6
+ <a href="https://npmjs.com/package/rsbuild-plugin-biome">
7
+ <img src="https://img.shields.io/npm/v/rsbuild-plugin-biome?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" />
8
+ </a>
9
+ <img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" />
10
+ <a href="https://npmcharts.com/compare/rsbuild-plugin-biome?minimal=true"><img src="https://img.shields.io/npm/dm/rsbuild-plugin-example.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="downloads" /></a>
11
+ </p>
12
+
13
+ ## Usage
14
+
15
+ Install:
16
+
17
+ ```bash
18
+ npm add rsbuild-plugin-biome -D
19
+ ```
20
+
21
+ Add plugin to your `rsbuild.config.ts`:
22
+
23
+ ```ts
24
+ // rsbuild.config.ts
25
+ import { linterPlugin } from 'rsbuild-plugin-biome';
26
+
27
+ export default {
28
+ plugins: [linterPlugin()],
29
+ };
30
+ ```
31
+
32
+ ## License
33
+
34
+ [MIT](./LICENSE).
@@ -0,0 +1,68 @@
1
+ import type { RsbuildPluginAPI } from '@rsbuild/core';
2
+ export interface Options {
3
+ path?: string;
4
+ /**@description Set the file path to the configuration file, or the directory path to find biome.json or biome.jsonc. If used, it disables the default configuration file resolution.*/
5
+ configFile?: string;
6
+ failOnError?: boolean;
7
+ failOnWarning?: boolean;
8
+ lintOnStart?: boolean;
9
+ lintOnHotUpdate?: boolean;
10
+ linterPath?: string;
11
+ /**@description Set the formatting mode for markup: “off” prints everything as plain text, “force” forces the formatting of markup using ANSI even if the console output is determined to be incompatible.*/
12
+ colors?: 'off' | 'force';
13
+ /**@description Connect to a running instance of the Biome daemon server.*/
14
+ useServer?: string;
15
+ /**@description Print additional diagnostics, and some diagnostics show more information. Also, print out what files were processed and which ones were modified.*/
16
+ verbose?: string;
17
+ /**
18
+ * @description Cap the amount of diagnostics displayed. When none is provided, the limit is lifted.
19
+ * @default 20
20
+ */
21
+ maxDiagnostics?: number | 'none';
22
+ /**@description Skip over files containing syntax errors instead of emitting an error diagnostic.*/
23
+ skipParseErrors?: boolean;
24
+ /**@description Silence errors that would be emitted in case no files were processed during the execution of the command.*/
25
+ noErrorsOnUnmatched?: boolean;
26
+ /**Tell Biome to exit with an error code if some diagnostics emit warnings.*/
27
+ errorOnWarnings?: boolean;
28
+ /**
29
+ * @description The level of diagnostics to show. In order, from the lowest to the most important: info, warn, error. Passing --diagnostic-level=error will cause Biome to print only diagnostics that contain only errors.
30
+ * @default info
31
+ * */
32
+ diagnosticLevel?: 'info' | 'warn' | 'error';
33
+ }
34
+ export type Code = {
35
+ url: string;
36
+ value: string;
37
+ };
38
+ export type End = {
39
+ column: number;
40
+ line: number;
41
+ };
42
+ export type Start = {
43
+ column: number;
44
+ line: number;
45
+ };
46
+ export type Location = {
47
+ path: string;
48
+ range: RangeItem;
49
+ };
50
+ export type RangeItem = {
51
+ end: End;
52
+ start: Start;
53
+ };
54
+ export type Suggestion = {
55
+ range: RangeItem;
56
+ text: string;
57
+ };
58
+ export type Issue = {
59
+ code: Code;
60
+ location: Location;
61
+ message: string;
62
+ suggestions: Suggestion[];
63
+ };
64
+ export declare const linterPlugin: (options?: Options) => {
65
+ setup(api: RsbuildPluginAPI): void;
66
+ name: string;
67
+ };
68
+ export default linterPlugin;