@powerlines/plugin-biome 0.2.296 → 0.2.297
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/dist/index.cjs +33 -34
- package/dist/index.d.cts +6 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +6 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +33 -34
- package/dist/index.mjs.map +1 -1
- package/dist/types/plugin.d.cts +3 -9
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +3 -9
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,6 @@ let __stryke_cli_execute = require("@stryke/cli/execute");
|
|
|
3
3
|
let __stryke_fs_exists = require("@stryke/fs/exists");
|
|
4
4
|
let __stryke_fs_package_fns = require("@stryke/fs/package-fns");
|
|
5
5
|
let __stryke_path_join = require("@stryke/path/join");
|
|
6
|
-
let __stryke_path_replace = require("@stryke/path/replace");
|
|
7
6
|
|
|
8
7
|
//#region src/index.ts
|
|
9
8
|
/**
|
|
@@ -15,12 +14,12 @@ function plugin(options = {}) {
|
|
|
15
14
|
async config() {
|
|
16
15
|
this.debug("Providing default configuration for the Powerlines `biome` linting plugin.");
|
|
17
16
|
let configFile = options.configFile;
|
|
18
|
-
if (!configFile) if ((0, __stryke_fs_exists.existsSync)((0, __stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.
|
|
19
|
-
else if ((0, __stryke_fs_exists.existsSync)((0, __stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.
|
|
17
|
+
if (!configFile) if ((0, __stryke_fs_exists.existsSync)((0, __stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.root, "biome.json"))) configFile = (0, __stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.root, "biome.json");
|
|
18
|
+
else if ((0, __stryke_fs_exists.existsSync)((0, __stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.root, "biome.jsonc"))) configFile = (0, __stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.root, "biome.jsonc");
|
|
20
19
|
else if ((0, __stryke_fs_exists.existsSync)((0, __stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, "biome.json"))) configFile = (0, __stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, "biome.json");
|
|
21
20
|
else if ((0, __stryke_fs_exists.existsSync)((0, __stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, "biome.jsonc"))) configFile = (0, __stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, "biome.jsonc");
|
|
22
21
|
else throw new Error(`No Biome configuration file found. Please specify a valid config file path in the Biome plugin's \`configFile\` options.`);
|
|
23
|
-
return {
|
|
22
|
+
return { biome: {
|
|
24
23
|
configFile,
|
|
25
24
|
maxDiagnostics: 20,
|
|
26
25
|
diagnosticLevel: "info",
|
|
@@ -30,49 +29,49 @@ function plugin(options = {}) {
|
|
|
30
29
|
vcsEnabled: true,
|
|
31
30
|
vcsDefaultBranch: this.workspaceConfig.branch || "main",
|
|
32
31
|
...options
|
|
33
|
-
} }
|
|
32
|
+
} };
|
|
34
33
|
},
|
|
35
34
|
async lint() {
|
|
36
35
|
this.debug(`Linting project files with Biome.`);
|
|
37
36
|
const args = [];
|
|
38
|
-
if (this.config.
|
|
37
|
+
if (this.config.biome.params) args.push(...this.config.biome.params.split(" ").filter(Boolean));
|
|
39
38
|
if (!args.includes("--log-level")) args.push("--log-level", !this.config.logLevel || this.config.logLevel === "trace" || this.config.logLevel === "debug" ? "info" : this.config.logLevel);
|
|
40
39
|
if (!args.includes("--verbose") && (this.config.logLevel === "trace" || this.config.logLevel === "debug" || this.config.mode === "development")) args.push("--verbose");
|
|
41
|
-
if (this.config.
|
|
40
|
+
if (this.config.biome.fix !== false && !args.includes("--fix")) {
|
|
42
41
|
args.push("--fix");
|
|
43
|
-
if (this.config.
|
|
42
|
+
if (this.config.biome.fix === "unsafe" && !args.includes("--unsafe")) args.push("--unsafe");
|
|
44
43
|
}
|
|
45
|
-
if (this.config.
|
|
46
|
-
if (this.config.
|
|
47
|
-
if (this.config.
|
|
48
|
-
if (this.config.
|
|
49
|
-
if (this.config.
|
|
50
|
-
if (this.config.
|
|
51
|
-
if (this.config.
|
|
52
|
-
if (this.config.
|
|
53
|
-
if (this.config.
|
|
54
|
-
if (this.config.
|
|
55
|
-
if (this.config.
|
|
56
|
-
if (this.config.
|
|
57
|
-
if (this.config.
|
|
58
|
-
if (this.config.
|
|
59
|
-
if (this.config.
|
|
60
|
-
if (this.config.
|
|
61
|
-
if (this.config.
|
|
62
|
-
if (this.config.
|
|
44
|
+
if (this.config.biome.configFile && !args.includes("--config-path")) args.push("--config-path", this.config.biome.configFile);
|
|
45
|
+
if (this.config.biome.changed && !args.includes("--changed")) args.push("--changed");
|
|
46
|
+
if (this.config.biome.staged && !args.includes("--staged")) args.push("--staged");
|
|
47
|
+
if (this.config.biome.ignorePatterns && !args.includes("--ignore")) args.push("--ignore", Array.isArray(this.config.biome.ignorePatterns) ? this.config.biome.ignorePatterns.join(",") : this.config.biome.ignorePatterns);
|
|
48
|
+
if (this.config.biome.suppress && !args.includes("--suppress")) args.push("--suppress");
|
|
49
|
+
if (this.config.biome.only && !args.includes("--only")) args.push("--only", Array.isArray(this.config.biome.only) ? this.config.biome.only.join(",") : this.config.biome.only);
|
|
50
|
+
if (this.config.biome.skip && !args.includes("--skip")) args.push("--skip", Array.isArray(this.config.biome.skip) ? this.config.biome.skip.join(",") : this.config.biome.skip);
|
|
51
|
+
if (this.config.biome.stdinFilePath && !args.includes("--stdin-file-path")) args.push("--stdin-file-path", this.config.biome.stdinFilePath);
|
|
52
|
+
if (this.config.biome.maxDiagnostics !== void 0 && !args.includes("--max-diagnostics")) args.push("--max-diagnostics", this.config.biome.maxDiagnostics.toString());
|
|
53
|
+
if (this.config.biome.diagnosticLevel && !args.includes("--diagnostic-level")) args.push("--diagnostic-level", this.config.biome.diagnosticLevel);
|
|
54
|
+
if (this.config.biome.errorOnWarnings && !args.includes("--error-on-warnings")) args.push("--error-on-warnings");
|
|
55
|
+
if (this.config.biome.jsonParseAllowComments && !args.includes("--json-parse-allow-comments")) args.push("--json-parse-allow-comments");
|
|
56
|
+
if (this.config.biome.jsonParseAllowTrailingCommas && !args.includes("--json-parse-allow-trailing-commas")) args.push("--json-parse-allow-trailing-commas");
|
|
57
|
+
if (this.config.biome.reporter && !args.includes("--reporter")) args.push("--reporter", this.config.biome.reporter);
|
|
58
|
+
if (this.config.biome.logKind && !args.includes("--log-kind")) args.push("--log-kind", this.config.biome.logKind);
|
|
59
|
+
if (this.config.biome.filesMaxSize && !args.includes("--files-max-size")) args.push("--files-max-size", this.config.biome.filesMaxSize.toString());
|
|
60
|
+
if (this.config.biome.filesIgnoreUnknown && !args.includes("--files-ignore-unknown")) args.push("--files-ignore-unknown");
|
|
61
|
+
if (this.config.biome.vcsEnabled && !args.includes("--vcs-enabled")) {
|
|
63
62
|
args.push("--vcs-enabled");
|
|
64
63
|
if (!args.includes("--vcs-root")) args.push("--vcs-root", this.workspaceConfig.workspaceRoot);
|
|
65
|
-
if (this.config.
|
|
66
|
-
if (this.config.
|
|
67
|
-
if (this.config.
|
|
64
|
+
if (this.config.biome.vcsClientKind && !args.includes("--vcs-client-kind")) args.push("--vcs-client-kind", this.config.biome.vcsClientKind);
|
|
65
|
+
if (this.config.biome.vcsUseIgnoreFile && !args.includes("--vcs-use-ignore-file")) args.push("--vcs-use-ignore-file");
|
|
66
|
+
if (this.config.biome.vcsDefaultBranch && !args.includes("--vcs-default-branch")) args.push("--vcs-default-branch", this.config.biome.vcsDefaultBranch);
|
|
68
67
|
}
|
|
69
|
-
if (!this.config.
|
|
70
|
-
const isBiomeListed = await (0, __stryke_fs_package_fns.isPackageListed)("@biomejs/biome", this.config.
|
|
71
|
-
args.unshift(isBiomeListed ? (0,
|
|
72
|
-
const result = await (0, __stryke_cli_execute.executePackage)("biome", args, isBiomeListed ? (0, __stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.
|
|
68
|
+
if (!this.config.biome.biomePath) {
|
|
69
|
+
const isBiomeListed = await (0, __stryke_fs_package_fns.isPackageListed)("@biomejs/biome", this.config.root);
|
|
70
|
+
args.unshift(isBiomeListed ? "./" : (0, __stryke_path_join.joinPaths)(this.config.root, "src"));
|
|
71
|
+
const result = await (0, __stryke_cli_execute.executePackage)("biome", args, isBiomeListed ? (0, __stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.root) : this.config.root);
|
|
73
72
|
if (result.failed) throw new Error(`Biome process exited with code ${result.exitCode}.`);
|
|
74
73
|
} else {
|
|
75
|
-
args.unshift(this.config.
|
|
74
|
+
args.unshift(this.config.biome.biomePath, (0, __stryke_path_join.joinPaths)(this.config.root, "src"));
|
|
76
75
|
const result = await (0, __stryke_cli_execute.execute)(args.join(" "), this.workspaceConfig.workspaceRoot);
|
|
77
76
|
if (result.failed) throw new Error(`Biome process exited with code ${result.exitCode}.`);
|
|
78
77
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { BiomePluginContext, BiomePluginOptions, BiomePluginResolvedConfig, BiomePluginUserConfig, __ΩBiomePluginContext, __ΩBiomePluginOptions, __ΩBiomePluginResolvedConfig, __ΩBiomePluginUserConfig } from "./types/plugin.cjs";
|
|
2
2
|
import "./types/index.cjs";
|
|
3
|
-
import { Plugin } from "powerlines
|
|
3
|
+
import { Plugin } from "powerlines";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
|
-
|
|
6
|
+
declare module "powerlines" {
|
|
7
|
+
interface UserConfig {
|
|
8
|
+
biome?: BiomePluginOptions;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
7
11
|
/**
|
|
8
12
|
* A Powerlines plugin to assist in linting a project with Biome.
|
|
9
13
|
*/
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;IA6BwB,KAAA,CAAA,EAIZ,kBAJY;EAAA;;;;AAWxB;AACW,iBADK,MAAA,CACL,OAAA,CAAA,EAAA,kBAAA,CAAA,EACR,MADQ,CACD,kBADC,CAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { BiomePluginContext, BiomePluginOptions, BiomePluginResolvedConfig, BiomePluginUserConfig, __ΩBiomePluginContext, __ΩBiomePluginOptions, __ΩBiomePluginResolvedConfig, __ΩBiomePluginUserConfig } from "./types/plugin.mjs";
|
|
2
2
|
import "./types/index.mjs";
|
|
3
|
-
import { Plugin } from "powerlines
|
|
3
|
+
import { Plugin } from "powerlines";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
|
-
|
|
6
|
+
declare module "powerlines" {
|
|
7
|
+
interface UserConfig {
|
|
8
|
+
biome?: BiomePluginOptions;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
7
11
|
/**
|
|
8
12
|
* A Powerlines plugin to assist in linting a project with Biome.
|
|
9
13
|
*/
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;IA6BwB,KAAA,CAAA,EAIZ,kBAJY;EAAA;;;;AAWxB;AACW,iBADK,MAAA,CACL,OAAA,CAAA,EAAA,kBAAA,CAAA,EACR,MADQ,CACD,kBADC,CAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,6 @@ import { execute, executePackage } from "@stryke/cli/execute";
|
|
|
2
2
|
import { existsSync } from "@stryke/fs/exists";
|
|
3
3
|
import { isPackageListed } from "@stryke/fs/package-fns";
|
|
4
4
|
import { joinPaths } from "@stryke/path/join";
|
|
5
|
-
import { replacePath } from "@stryke/path/replace";
|
|
6
5
|
|
|
7
6
|
//#region src/index.ts
|
|
8
7
|
/**
|
|
@@ -14,12 +13,12 @@ function plugin(options = {}) {
|
|
|
14
13
|
async config() {
|
|
15
14
|
this.debug("Providing default configuration for the Powerlines `biome` linting plugin.");
|
|
16
15
|
let configFile = options.configFile;
|
|
17
|
-
if (!configFile) if (existsSync(joinPaths(this.workspaceConfig.workspaceRoot, this.config.
|
|
18
|
-
else if (existsSync(joinPaths(this.workspaceConfig.workspaceRoot, this.config.
|
|
16
|
+
if (!configFile) if (existsSync(joinPaths(this.workspaceConfig.workspaceRoot, this.config.root, "biome.json"))) configFile = joinPaths(this.workspaceConfig.workspaceRoot, this.config.root, "biome.json");
|
|
17
|
+
else if (existsSync(joinPaths(this.workspaceConfig.workspaceRoot, this.config.root, "biome.jsonc"))) configFile = joinPaths(this.workspaceConfig.workspaceRoot, this.config.root, "biome.jsonc");
|
|
19
18
|
else if (existsSync(joinPaths(this.workspaceConfig.workspaceRoot, "biome.json"))) configFile = joinPaths(this.workspaceConfig.workspaceRoot, "biome.json");
|
|
20
19
|
else if (existsSync(joinPaths(this.workspaceConfig.workspaceRoot, "biome.jsonc"))) configFile = joinPaths(this.workspaceConfig.workspaceRoot, "biome.jsonc");
|
|
21
20
|
else throw new Error(`No Biome configuration file found. Please specify a valid config file path in the Biome plugin's \`configFile\` options.`);
|
|
22
|
-
return {
|
|
21
|
+
return { biome: {
|
|
23
22
|
configFile,
|
|
24
23
|
maxDiagnostics: 20,
|
|
25
24
|
diagnosticLevel: "info",
|
|
@@ -29,49 +28,49 @@ function plugin(options = {}) {
|
|
|
29
28
|
vcsEnabled: true,
|
|
30
29
|
vcsDefaultBranch: this.workspaceConfig.branch || "main",
|
|
31
30
|
...options
|
|
32
|
-
} }
|
|
31
|
+
} };
|
|
33
32
|
},
|
|
34
33
|
async lint() {
|
|
35
34
|
this.debug(`Linting project files with Biome.`);
|
|
36
35
|
const args = [];
|
|
37
|
-
if (this.config.
|
|
36
|
+
if (this.config.biome.params) args.push(...this.config.biome.params.split(" ").filter(Boolean));
|
|
38
37
|
if (!args.includes("--log-level")) args.push("--log-level", !this.config.logLevel || this.config.logLevel === "trace" || this.config.logLevel === "debug" ? "info" : this.config.logLevel);
|
|
39
38
|
if (!args.includes("--verbose") && (this.config.logLevel === "trace" || this.config.logLevel === "debug" || this.config.mode === "development")) args.push("--verbose");
|
|
40
|
-
if (this.config.
|
|
39
|
+
if (this.config.biome.fix !== false && !args.includes("--fix")) {
|
|
41
40
|
args.push("--fix");
|
|
42
|
-
if (this.config.
|
|
41
|
+
if (this.config.biome.fix === "unsafe" && !args.includes("--unsafe")) args.push("--unsafe");
|
|
43
42
|
}
|
|
44
|
-
if (this.config.
|
|
45
|
-
if (this.config.
|
|
46
|
-
if (this.config.
|
|
47
|
-
if (this.config.
|
|
48
|
-
if (this.config.
|
|
49
|
-
if (this.config.
|
|
50
|
-
if (this.config.
|
|
51
|
-
if (this.config.
|
|
52
|
-
if (this.config.
|
|
53
|
-
if (this.config.
|
|
54
|
-
if (this.config.
|
|
55
|
-
if (this.config.
|
|
56
|
-
if (this.config.
|
|
57
|
-
if (this.config.
|
|
58
|
-
if (this.config.
|
|
59
|
-
if (this.config.
|
|
60
|
-
if (this.config.
|
|
61
|
-
if (this.config.
|
|
43
|
+
if (this.config.biome.configFile && !args.includes("--config-path")) args.push("--config-path", this.config.biome.configFile);
|
|
44
|
+
if (this.config.biome.changed && !args.includes("--changed")) args.push("--changed");
|
|
45
|
+
if (this.config.biome.staged && !args.includes("--staged")) args.push("--staged");
|
|
46
|
+
if (this.config.biome.ignorePatterns && !args.includes("--ignore")) args.push("--ignore", Array.isArray(this.config.biome.ignorePatterns) ? this.config.biome.ignorePatterns.join(",") : this.config.biome.ignorePatterns);
|
|
47
|
+
if (this.config.biome.suppress && !args.includes("--suppress")) args.push("--suppress");
|
|
48
|
+
if (this.config.biome.only && !args.includes("--only")) args.push("--only", Array.isArray(this.config.biome.only) ? this.config.biome.only.join(",") : this.config.biome.only);
|
|
49
|
+
if (this.config.biome.skip && !args.includes("--skip")) args.push("--skip", Array.isArray(this.config.biome.skip) ? this.config.biome.skip.join(",") : this.config.biome.skip);
|
|
50
|
+
if (this.config.biome.stdinFilePath && !args.includes("--stdin-file-path")) args.push("--stdin-file-path", this.config.biome.stdinFilePath);
|
|
51
|
+
if (this.config.biome.maxDiagnostics !== void 0 && !args.includes("--max-diagnostics")) args.push("--max-diagnostics", this.config.biome.maxDiagnostics.toString());
|
|
52
|
+
if (this.config.biome.diagnosticLevel && !args.includes("--diagnostic-level")) args.push("--diagnostic-level", this.config.biome.diagnosticLevel);
|
|
53
|
+
if (this.config.biome.errorOnWarnings && !args.includes("--error-on-warnings")) args.push("--error-on-warnings");
|
|
54
|
+
if (this.config.biome.jsonParseAllowComments && !args.includes("--json-parse-allow-comments")) args.push("--json-parse-allow-comments");
|
|
55
|
+
if (this.config.biome.jsonParseAllowTrailingCommas && !args.includes("--json-parse-allow-trailing-commas")) args.push("--json-parse-allow-trailing-commas");
|
|
56
|
+
if (this.config.biome.reporter && !args.includes("--reporter")) args.push("--reporter", this.config.biome.reporter);
|
|
57
|
+
if (this.config.biome.logKind && !args.includes("--log-kind")) args.push("--log-kind", this.config.biome.logKind);
|
|
58
|
+
if (this.config.biome.filesMaxSize && !args.includes("--files-max-size")) args.push("--files-max-size", this.config.biome.filesMaxSize.toString());
|
|
59
|
+
if (this.config.biome.filesIgnoreUnknown && !args.includes("--files-ignore-unknown")) args.push("--files-ignore-unknown");
|
|
60
|
+
if (this.config.biome.vcsEnabled && !args.includes("--vcs-enabled")) {
|
|
62
61
|
args.push("--vcs-enabled");
|
|
63
62
|
if (!args.includes("--vcs-root")) args.push("--vcs-root", this.workspaceConfig.workspaceRoot);
|
|
64
|
-
if (this.config.
|
|
65
|
-
if (this.config.
|
|
66
|
-
if (this.config.
|
|
63
|
+
if (this.config.biome.vcsClientKind && !args.includes("--vcs-client-kind")) args.push("--vcs-client-kind", this.config.biome.vcsClientKind);
|
|
64
|
+
if (this.config.biome.vcsUseIgnoreFile && !args.includes("--vcs-use-ignore-file")) args.push("--vcs-use-ignore-file");
|
|
65
|
+
if (this.config.biome.vcsDefaultBranch && !args.includes("--vcs-default-branch")) args.push("--vcs-default-branch", this.config.biome.vcsDefaultBranch);
|
|
67
66
|
}
|
|
68
|
-
if (!this.config.
|
|
69
|
-
const isBiomeListed = await isPackageListed("@biomejs/biome", this.config.
|
|
70
|
-
args.unshift(isBiomeListed ?
|
|
71
|
-
const result = await executePackage("biome", args, isBiomeListed ? joinPaths(this.workspaceConfig.workspaceRoot, this.config.
|
|
67
|
+
if (!this.config.biome.biomePath) {
|
|
68
|
+
const isBiomeListed = await isPackageListed("@biomejs/biome", this.config.root);
|
|
69
|
+
args.unshift(isBiomeListed ? "./" : joinPaths(this.config.root, "src"));
|
|
70
|
+
const result = await executePackage("biome", args, isBiomeListed ? joinPaths(this.workspaceConfig.workspaceRoot, this.config.root) : this.config.root);
|
|
72
71
|
if (result.failed) throw new Error(`Biome process exited with code ${result.exitCode}.`);
|
|
73
72
|
} else {
|
|
74
|
-
args.unshift(this.config.
|
|
73
|
+
args.unshift(this.config.biome.biomePath, joinPaths(this.config.root, "src"));
|
|
75
74
|
const result = await execute(args.join(" "), this.workspaceConfig.workspaceRoot);
|
|
76
75
|
if (result.failed) throw new Error(`Biome process exited with code ${result.exitCode}.`);
|
|
77
76
|
}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["args: string[]"],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { execute, executePackage } from \"@stryke/cli/execute\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { isPackageListed } from \"@stryke/fs/package-fns\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport {\n BiomePluginContext,\n BiomePluginOptions,\n BiomePluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./types\";\n\n/**\n * A Powerlines plugin to assist in linting a project with Biome.\n */\nexport function plugin(\n options: BiomePluginOptions = {}\n): Plugin<BiomePluginContext> {\n return {\n name: \"biome\",\n async config() {\n this.debug(\n \"Providing default configuration for the Powerlines `biome` linting plugin.\"\n );\n\n let configFile = options.configFile;\n if (!configFile) {\n if (\n existsSync(\n joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.projectRoot,\n \"biome.json\"\n )\n )\n ) {\n configFile = joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.projectRoot,\n \"biome.json\"\n );\n } else if (\n existsSync(\n joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.projectRoot,\n \"biome.jsonc\"\n )\n )\n ) {\n configFile = joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.projectRoot,\n \"biome.jsonc\"\n );\n } else if (\n existsSync(\n joinPaths(this.workspaceConfig.workspaceRoot, \"biome.json\")\n )\n ) {\n configFile = joinPaths(\n this.workspaceConfig.workspaceRoot,\n \"biome.json\"\n );\n } else if (\n existsSync(\n joinPaths(this.workspaceConfig.workspaceRoot, \"biome.jsonc\")\n )\n ) {\n configFile = joinPaths(\n this.workspaceConfig.workspaceRoot,\n \"biome.jsonc\"\n );\n } else {\n throw new Error(\n `No Biome configuration file found. Please specify a valid config file path in the Biome plugin's \\`configFile\\` options.`\n );\n }\n }\n\n return {\n lint: {\n biome: {\n configFile,\n maxDiagnostics: 20,\n diagnosticLevel: \"info\",\n fix: true,\n logKind: \"pretty\",\n format: \"stylish\",\n vcsEnabled: true,\n vcsDefaultBranch: this.workspaceConfig.branch || \"main\",\n ...options\n }\n }\n } as BiomePluginUserConfig;\n },\n async lint() {\n this.debug(`Linting project files with Biome.`);\n\n const args: string[] = [];\n\n if (this.config.lint.biome.params) {\n args.push(...this.config.lint.biome.params.split(\" \").filter(Boolean));\n }\n\n if (!args.includes(\"--log-level\")) {\n args.push(\n \"--log-level\",\n !this.config.logLevel ||\n this.config.logLevel === \"trace\" ||\n this.config.logLevel === \"debug\"\n ? \"info\"\n : this.config.logLevel\n );\n }\n\n if (\n !args.includes(\"--verbose\") &&\n (this.config.logLevel === \"trace\" ||\n this.config.logLevel === \"debug\" ||\n this.config.mode === \"development\")\n ) {\n args.push(\"--verbose\");\n }\n\n if (this.config.lint.biome.fix !== false && !args.includes(\"--fix\")) {\n args.push(\"--fix\");\n if (\n this.config.lint.biome.fix === \"unsafe\" &&\n !args.includes(\"--unsafe\")\n ) {\n args.push(\"--unsafe\");\n }\n }\n\n if (\n this.config.lint.biome.configFile &&\n !args.includes(\"--config-path\")\n ) {\n args.push(\"--config-path\", this.config.lint.biome.configFile);\n }\n\n if (this.config.lint.biome.changed && !args.includes(\"--changed\")) {\n args.push(\"--changed\");\n }\n\n if (this.config.lint.biome.staged && !args.includes(\"--staged\")) {\n args.push(\"--staged\");\n }\n\n if (this.config.lint.biome.ignorePatterns && !args.includes(\"--ignore\")) {\n args.push(\n \"--ignore\",\n Array.isArray(this.config.lint.biome.ignorePatterns)\n ? this.config.lint.biome.ignorePatterns.join(\",\")\n : this.config.lint.biome.ignorePatterns\n );\n }\n\n if (this.config.lint.biome.suppress && !args.includes(\"--suppress\")) {\n args.push(\"--suppress\");\n }\n\n if (this.config.lint.biome.only && !args.includes(\"--only\")) {\n args.push(\n \"--only\",\n Array.isArray(this.config.lint.biome.only)\n ? this.config.lint.biome.only.join(\",\")\n : this.config.lint.biome.only\n );\n }\n\n if (this.config.lint.biome.skip && !args.includes(\"--skip\")) {\n args.push(\n \"--skip\",\n Array.isArray(this.config.lint.biome.skip)\n ? this.config.lint.biome.skip.join(\",\")\n : this.config.lint.biome.skip\n );\n }\n\n if (\n this.config.lint.biome.stdinFilePath &&\n !args.includes(\"--stdin-file-path\")\n ) {\n args.push(\"--stdin-file-path\", this.config.lint.biome.stdinFilePath);\n }\n\n if (\n this.config.lint.biome.maxDiagnostics !== undefined &&\n !args.includes(\"--max-diagnostics\")\n ) {\n args.push(\n \"--max-diagnostics\",\n this.config.lint.biome.maxDiagnostics.toString()\n );\n }\n\n if (\n this.config.lint.biome.diagnosticLevel &&\n !args.includes(\"--diagnostic-level\")\n ) {\n args.push(\"--diagnostic-level\", this.config.lint.biome.diagnosticLevel);\n }\n\n if (\n this.config.lint.biome.errorOnWarnings &&\n !args.includes(\"--error-on-warnings\")\n ) {\n args.push(\"--error-on-warnings\");\n }\n\n if (\n this.config.lint.biome.jsonParseAllowComments &&\n !args.includes(\"--json-parse-allow-comments\")\n ) {\n args.push(\"--json-parse-allow-comments\");\n }\n\n if (\n this.config.lint.biome.jsonParseAllowTrailingCommas &&\n !args.includes(\"--json-parse-allow-trailing-commas\")\n ) {\n args.push(\"--json-parse-allow-trailing-commas\");\n }\n\n if (this.config.lint.biome.reporter && !args.includes(\"--reporter\")) {\n args.push(\"--reporter\", this.config.lint.biome.reporter);\n }\n\n if (this.config.lint.biome.logKind && !args.includes(\"--log-kind\")) {\n args.push(\"--log-kind\", this.config.lint.biome.logKind);\n }\n\n if (\n this.config.lint.biome.filesMaxSize &&\n !args.includes(\"--files-max-size\")\n ) {\n args.push(\n \"--files-max-size\",\n this.config.lint.biome.filesMaxSize.toString()\n );\n }\n\n if (\n this.config.lint.biome.filesIgnoreUnknown &&\n !args.includes(\"--files-ignore-unknown\")\n ) {\n args.push(\"--files-ignore-unknown\");\n }\n\n if (\n this.config.lint.biome.vcsEnabled &&\n !args.includes(\"--vcs-enabled\")\n ) {\n args.push(\"--vcs-enabled\");\n\n if (!args.includes(\"--vcs-root\")) {\n args.push(\"--vcs-root\", this.workspaceConfig.workspaceRoot);\n }\n\n if (\n this.config.lint.biome.vcsClientKind &&\n !args.includes(\"--vcs-client-kind\")\n ) {\n args.push(\"--vcs-client-kind\", this.config.lint.biome.vcsClientKind);\n }\n\n if (\n this.config.lint.biome.vcsUseIgnoreFile &&\n !args.includes(\"--vcs-use-ignore-file\")\n ) {\n args.push(\"--vcs-use-ignore-file\");\n }\n\n if (\n this.config.lint.biome.vcsDefaultBranch &&\n !args.includes(\"--vcs-default-branch\")\n ) {\n args.push(\n \"--vcs-default-branch\",\n this.config.lint.biome.vcsDefaultBranch\n );\n }\n }\n\n if (!this.config.lint.biome.biomePath) {\n const isBiomeListed = await isPackageListed(\n \"@biomejs/biome\",\n this.config.projectRoot\n );\n\n args.unshift(\n isBiomeListed\n ? replacePath(this.config.sourceRoot, this.config.projectRoot)\n : this.config.sourceRoot\n );\n\n const result = await executePackage(\n \"biome\",\n args,\n isBiomeListed\n ? joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.projectRoot\n )\n : this.config.projectRoot\n );\n if (result.failed) {\n throw new Error(`Biome process exited with code ${result.exitCode}.`);\n }\n } else {\n args.unshift(this.config.lint.biome.biomePath, this.config.sourceRoot);\n\n const result = await execute(\n args.join(\" \"),\n this.workspaceConfig.workspaceRoot\n );\n if (result.failed) {\n throw new Error(`Biome process exited with code ${result.exitCode}.`);\n }\n }\n }\n };\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;AAmCA,SAAgB,OACd,UAA8B,EAAE,EACJ;AAC5B,QAAO;EACL,MAAM;EACN,MAAM,SAAS;AACb,QAAK,MACH,6EACD;GA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E1B,QAAI,CAAC,KAAK,SAAS,aAAa,CAC9B,MAAK,KAAK,cAAc,KAAK,gBAAgB,cAAc;AAG7D,QACE,KAAK,OAAO,KAAK,MAAM,iBACvB,CAAC,KAAK,SAAS,oBAAoB,CAEnC,MAAK,KAAK,qBAAqB,KAAK,OAAO,KAAK,MAAM,cAAc;AAGtE,QACE,KAAK,OAAO,KAAK,MAAM,oBACvB,CAAC,KAAK,SAAS,wBAAwB,CAEvC,MAAK,KAAK,wBAAwB;AAGpC,QACE,KAAK,OAAO,KAAK,MAAM,oBACvB,CAAC,KAAK,SAAS,uBAAuB,CAEtC,MAAK,KACH,wBACA,KAAK,OAAO,KAAK,MAAM,iBACxB;;AAIL,OAAI,CAAC,KAAK,OAAO,KAAK,MAAM,WAAW;IACrC,MAAM,gBAAgB,MAAM,gBAC1B,kBACA,KAAK,OAAO,YACb;AAED,SAAK,QACH,gBACI,YAAY,KAAK,OAAO,YAAY,KAAK,OAAO,YAAY,GAC5D,KAAK,OAAO,WACjB;IAED,MAAM,SAAS,MAAM,eACnB,SACA,MACA,gBACI,UACE,KAAK,gBAAgB,eACrB,KAAK,OAAO,YACb,GACD,KAAK,OAAO,YACjB;AACD,QAAI,OAAO,OACT,OAAM,IAAI,MAAM,kCAAkC,OAAO,SAAS,GAAG;UAElE;AACL,SAAK,QAAQ,KAAK,OAAO,KAAK,MAAM,WAAW,KAAK,OAAO,WAAW;IAEtE,MAAM,SAAS,MAAM,QACnB,KAAK,KAAK,IAAI,EACd,KAAK,gBAAgB,cACtB;AACD,QAAI,OAAO,OACT,OAAM,IAAI,MAAM,kCAAkC,OAAO,SAAS,GAAG;;;EAI5E;;AAGH,kBAAe"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["args: string[]"],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { execute, executePackage } from \"@stryke/cli/execute\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { isPackageListed } from \"@stryke/fs/package-fns\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { Plugin } from \"powerlines\";\nimport {\n BiomePluginContext,\n BiomePluginOptions,\n BiomePluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n export interface UserConfig {\n biome?: BiomePluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in linting a project with Biome.\n */\nexport function plugin(\n options: BiomePluginOptions = {}\n): Plugin<BiomePluginContext> {\n return {\n name: \"biome\",\n async config() {\n this.debug(\n \"Providing default configuration for the Powerlines `biome` linting plugin.\"\n );\n\n let configFile = options.configFile;\n if (!configFile) {\n if (\n existsSync(\n joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.root,\n \"biome.json\"\n )\n )\n ) {\n configFile = joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.root,\n \"biome.json\"\n );\n } else if (\n existsSync(\n joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.root,\n \"biome.jsonc\"\n )\n )\n ) {\n configFile = joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.root,\n \"biome.jsonc\"\n );\n } else if (\n existsSync(\n joinPaths(this.workspaceConfig.workspaceRoot, \"biome.json\")\n )\n ) {\n configFile = joinPaths(\n this.workspaceConfig.workspaceRoot,\n \"biome.json\"\n );\n } else if (\n existsSync(\n joinPaths(this.workspaceConfig.workspaceRoot, \"biome.jsonc\")\n )\n ) {\n configFile = joinPaths(\n this.workspaceConfig.workspaceRoot,\n \"biome.jsonc\"\n );\n } else {\n throw new Error(\n `No Biome configuration file found. Please specify a valid config file path in the Biome plugin's \\`configFile\\` options.`\n );\n }\n }\n\n return {\n biome: {\n configFile,\n maxDiagnostics: 20,\n diagnosticLevel: \"info\",\n fix: true,\n logKind: \"pretty\",\n format: \"stylish\",\n vcsEnabled: true,\n vcsDefaultBranch: this.workspaceConfig.branch || \"main\",\n ...options\n }\n } as BiomePluginUserConfig;\n },\n async lint() {\n this.debug(`Linting project files with Biome.`);\n\n const args: string[] = [];\n\n if (this.config.biome.params) {\n args.push(...this.config.biome.params.split(\" \").filter(Boolean));\n }\n\n if (!args.includes(\"--log-level\")) {\n args.push(\n \"--log-level\",\n !this.config.logLevel ||\n this.config.logLevel === \"trace\" ||\n this.config.logLevel === \"debug\"\n ? \"info\"\n : this.config.logLevel\n );\n }\n\n if (\n !args.includes(\"--verbose\") &&\n (this.config.logLevel === \"trace\" ||\n this.config.logLevel === \"debug\" ||\n this.config.mode === \"development\")\n ) {\n args.push(\"--verbose\");\n }\n\n if (this.config.biome.fix !== false && !args.includes(\"--fix\")) {\n args.push(\"--fix\");\n if (this.config.biome.fix === \"unsafe\" && !args.includes(\"--unsafe\")) {\n args.push(\"--unsafe\");\n }\n }\n\n if (this.config.biome.configFile && !args.includes(\"--config-path\")) {\n args.push(\"--config-path\", this.config.biome.configFile);\n }\n\n if (this.config.biome.changed && !args.includes(\"--changed\")) {\n args.push(\"--changed\");\n }\n\n if (this.config.biome.staged && !args.includes(\"--staged\")) {\n args.push(\"--staged\");\n }\n\n if (this.config.biome.ignorePatterns && !args.includes(\"--ignore\")) {\n args.push(\n \"--ignore\",\n Array.isArray(this.config.biome.ignorePatterns)\n ? this.config.biome.ignorePatterns.join(\",\")\n : this.config.biome.ignorePatterns\n );\n }\n\n if (this.config.biome.suppress && !args.includes(\"--suppress\")) {\n args.push(\"--suppress\");\n }\n\n if (this.config.biome.only && !args.includes(\"--only\")) {\n args.push(\n \"--only\",\n Array.isArray(this.config.biome.only)\n ? this.config.biome.only.join(\",\")\n : this.config.biome.only\n );\n }\n\n if (this.config.biome.skip && !args.includes(\"--skip\")) {\n args.push(\n \"--skip\",\n Array.isArray(this.config.biome.skip)\n ? this.config.biome.skip.join(\",\")\n : this.config.biome.skip\n );\n }\n\n if (\n this.config.biome.stdinFilePath &&\n !args.includes(\"--stdin-file-path\")\n ) {\n args.push(\"--stdin-file-path\", this.config.biome.stdinFilePath);\n }\n\n if (\n this.config.biome.maxDiagnostics !== undefined &&\n !args.includes(\"--max-diagnostics\")\n ) {\n args.push(\n \"--max-diagnostics\",\n this.config.biome.maxDiagnostics.toString()\n );\n }\n\n if (\n this.config.biome.diagnosticLevel &&\n !args.includes(\"--diagnostic-level\")\n ) {\n args.push(\"--diagnostic-level\", this.config.biome.diagnosticLevel);\n }\n\n if (\n this.config.biome.errorOnWarnings &&\n !args.includes(\"--error-on-warnings\")\n ) {\n args.push(\"--error-on-warnings\");\n }\n\n if (\n this.config.biome.jsonParseAllowComments &&\n !args.includes(\"--json-parse-allow-comments\")\n ) {\n args.push(\"--json-parse-allow-comments\");\n }\n\n if (\n this.config.biome.jsonParseAllowTrailingCommas &&\n !args.includes(\"--json-parse-allow-trailing-commas\")\n ) {\n args.push(\"--json-parse-allow-trailing-commas\");\n }\n\n if (this.config.biome.reporter && !args.includes(\"--reporter\")) {\n args.push(\"--reporter\", this.config.biome.reporter);\n }\n\n if (this.config.biome.logKind && !args.includes(\"--log-kind\")) {\n args.push(\"--log-kind\", this.config.biome.logKind);\n }\n\n if (\n this.config.biome.filesMaxSize &&\n !args.includes(\"--files-max-size\")\n ) {\n args.push(\n \"--files-max-size\",\n this.config.biome.filesMaxSize.toString()\n );\n }\n\n if (\n this.config.biome.filesIgnoreUnknown &&\n !args.includes(\"--files-ignore-unknown\")\n ) {\n args.push(\"--files-ignore-unknown\");\n }\n\n if (this.config.biome.vcsEnabled && !args.includes(\"--vcs-enabled\")) {\n args.push(\"--vcs-enabled\");\n\n if (!args.includes(\"--vcs-root\")) {\n args.push(\"--vcs-root\", this.workspaceConfig.workspaceRoot);\n }\n\n if (\n this.config.biome.vcsClientKind &&\n !args.includes(\"--vcs-client-kind\")\n ) {\n args.push(\"--vcs-client-kind\", this.config.biome.vcsClientKind);\n }\n\n if (\n this.config.biome.vcsUseIgnoreFile &&\n !args.includes(\"--vcs-use-ignore-file\")\n ) {\n args.push(\"--vcs-use-ignore-file\");\n }\n\n if (\n this.config.biome.vcsDefaultBranch &&\n !args.includes(\"--vcs-default-branch\")\n ) {\n args.push(\"--vcs-default-branch\", this.config.biome.vcsDefaultBranch);\n }\n }\n\n if (!this.config.biome.biomePath) {\n const isBiomeListed = await isPackageListed(\n \"@biomejs/biome\",\n this.config.root\n );\n\n args.unshift(isBiomeListed ? \"./\" : joinPaths(this.config.root, \"src\"));\n\n const result = await executePackage(\n \"biome\",\n args,\n isBiomeListed\n ? joinPaths(this.workspaceConfig.workspaceRoot, this.config.root)\n : this.config.root\n );\n if (result.failed) {\n throw new Error(`Biome process exited with code ${result.exitCode}.`);\n }\n } else {\n args.unshift(\n this.config.biome.biomePath,\n joinPaths(this.config.root, \"src\")\n );\n\n const result = await execute(\n args.join(\" \"),\n this.workspaceConfig.workspaceRoot\n );\n if (result.failed) {\n throw new Error(`Biome process exited with code ${result.exitCode}.`);\n }\n }\n }\n };\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;AAwCA,SAAgB,OACd,UAA8B,EAAE,EACJ;AAC5B,QAAO;EACL,MAAM;EACN,MAAM,SAAS;AACb,QAAK,MACH,6EACD;GAED,IAAI,aAAa,QAAQ;AACzB,OAAI,CAAC,WACH,KACE,WACE,UACE,KAAK,gBAAgB,eACrB,KAAK,OAAO,MACZ,aACD,CACF,CAED,cAAa,UACX,KAAK,gBAAgB,eACrB,KAAK,OAAO,MACZ,aACD;YAED,WACE,UACE,KAAK,gBAAgB,eACrB,KAAK,OAAO,MACZ,cACD,CACF,CAED,cAAa,UACX,KAAK,gBAAgB,eACrB,KAAK,OAAO,MACZ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,gBAAgB,OAAO,UAAU,KAAK,OAAO,MAAM,MAAM,CAAC;IAEvE,MAAM,SAAS,MAAM,eACnB,SACA,MACA,gBACI,UAAU,KAAK,gBAAgB,eAAe,KAAK,OAAO,KAAK,GAC/D,KAAK,OAAO,KACjB;AACD,QAAI,OAAO,OACT,OAAM,IAAI,MAAM,kCAAkC,OAAO,SAAS,GAAG;UAElE;AACL,SAAK,QACH,KAAK,OAAO,MAAM,WAClB,UAAU,KAAK,OAAO,MAAM,MAAM,CACnC;IAED,MAAM,SAAS,MAAM,QACnB,KAAK,KAAK,IAAI,EACd,KAAK,gBAAgB,cACtB;AACD,QAAI,OAAO,OACT,OAAM,IAAI,MAAM,kCAAkC,OAAO,SAAS,GAAG;;;EAI5E;;AAGH,kBAAe"}
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { UserConfig } from "powerlines
|
|
2
|
-
import { PluginContext } from "powerlines/types/context";
|
|
3
|
-
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
1
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
4
2
|
|
|
5
3
|
//#region src/types/plugin.d.ts
|
|
6
4
|
interface BiomePluginOptions {
|
|
@@ -149,17 +147,13 @@ interface BiomePluginUserConfig extends UserConfig {
|
|
|
149
147
|
/**
|
|
150
148
|
* Options for the Biome plugin.
|
|
151
149
|
*/
|
|
152
|
-
|
|
153
|
-
biome?: BiomePluginOptions;
|
|
154
|
-
};
|
|
150
|
+
biome?: BiomePluginOptions;
|
|
155
151
|
}
|
|
156
152
|
interface BiomePluginResolvedConfig extends ResolvedConfig {
|
|
157
153
|
/**
|
|
158
154
|
* Options for the Biome plugin.
|
|
159
155
|
*/
|
|
160
|
-
|
|
161
|
-
biome: BiomePluginOptions;
|
|
162
|
-
};
|
|
156
|
+
biome: BiomePluginOptions;
|
|
163
157
|
}
|
|
164
158
|
type BiomePluginContext<TResolvedConfig extends BiomePluginResolvedConfig = BiomePluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
165
159
|
declare type __ΩBiomePluginOptions = any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;UAoBiB,kBAAA;;AAAjB;AAqLA;EAOiB,cAAA,CAAA,EAAA,MAAA,GAAA,MAA0B,EAAA;EAO/B;;;;;EAEK,UAAA,CAAA,EAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAhBA,qBAAA,SAA8B;;;;UAIrC;;UAGO,yBAAA,SAAkC;;;;SAI1C;;KAGG,2CACc,4BAA4B,6BAClD,cAAc"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { UserConfig } from "powerlines
|
|
2
|
-
import { PluginContext } from "powerlines/types/context";
|
|
3
|
-
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
1
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
4
2
|
|
|
5
3
|
//#region src/types/plugin.d.ts
|
|
6
4
|
interface BiomePluginOptions {
|
|
@@ -149,17 +147,13 @@ interface BiomePluginUserConfig extends UserConfig {
|
|
|
149
147
|
/**
|
|
150
148
|
* Options for the Biome plugin.
|
|
151
149
|
*/
|
|
152
|
-
|
|
153
|
-
biome?: BiomePluginOptions;
|
|
154
|
-
};
|
|
150
|
+
biome?: BiomePluginOptions;
|
|
155
151
|
}
|
|
156
152
|
interface BiomePluginResolvedConfig extends ResolvedConfig {
|
|
157
153
|
/**
|
|
158
154
|
* Options for the Biome plugin.
|
|
159
155
|
*/
|
|
160
|
-
|
|
161
|
-
biome: BiomePluginOptions;
|
|
162
|
-
};
|
|
156
|
+
biome: BiomePluginOptions;
|
|
163
157
|
}
|
|
164
158
|
type BiomePluginContext<TResolvedConfig extends BiomePluginResolvedConfig = BiomePluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
165
159
|
declare type __ΩBiomePluginOptions = any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;UAoBiB,kBAAA;;AAAjB;AAqLA;EAOiB,cAAA,CAAA,EAAA,MAAA,GAAA,MAA0B,EAAA;EAO/B;;;;;EAEK,UAAA,CAAA,EAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAhBA,qBAAA,SAA8B;;;;UAIrC;;UAGO,yBAAA,SAAkC;;;;SAI1C;;KAGG,2CACc,4BAA4B,6BAClD,cAAc"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-biome",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.297",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for running Biome linting on the codebase.",
|
|
6
6
|
"repository": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"default": "./dist/index.mjs"
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
"
|
|
56
|
+
"./*": "./*",
|
|
57
57
|
"./types": {
|
|
58
58
|
"require": {
|
|
59
59
|
"types": "./dist/types/index.d.cts",
|
|
@@ -88,21 +88,21 @@
|
|
|
88
88
|
"peerDependencies": { "@biomejs/biome": ">=2.0.0" },
|
|
89
89
|
"peerDependenciesMeta": { "@biomejs/biome": { "optional": false } },
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@storm-software/config-tools": "^1.189.
|
|
91
|
+
"@storm-software/config-tools": "^1.189.10",
|
|
92
92
|
"@stryke/cli": "^0.13.15",
|
|
93
93
|
"@stryke/convert": "^0.6.40",
|
|
94
94
|
"@stryke/fs": "^0.33.43",
|
|
95
95
|
"@stryke/path": "^0.26.6",
|
|
96
96
|
"defu": "^6.1.4",
|
|
97
|
-
"powerlines": "^0.
|
|
97
|
+
"powerlines": "^0.39.0"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
101
|
-
"@types/node": "^25.3.
|
|
100
|
+
"@powerlines/plugin-plugin": "^0.12.242",
|
|
101
|
+
"@types/node": "^25.3.2"
|
|
102
102
|
},
|
|
103
103
|
"publishConfig": { "access": "public" },
|
|
104
104
|
"main": "./dist/index.cjs",
|
|
105
105
|
"module": "./dist/index.mjs",
|
|
106
106
|
"types": "./dist/index.d.cts",
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "0dcb16f054b8a69915b074578e6d4dfa3ecc1529"
|
|
108
108
|
}
|