@powerlines/plugin-oxlint 0.7.121 → 0.7.122

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.
@@ -1,4 +1,14 @@
1
- let e=require(`@stryke/convert/neutral`);function t(t={}){return`{
1
+ let __stryke_convert_neutral = require("@stryke/convert/neutral");
2
+
3
+ //#region src/helpers/generate-config.ts
4
+ /**
5
+ * Generates an Oxlint configuration file content based on the provided options.
6
+ *
7
+ * @param options - The options for the Oxlint plugin.
8
+ * @returns The generated configuration as a string.
9
+ */
10
+ function generateConfig(options = {}) {
11
+ return `{
2
12
  "$schema": "./node_modules/oxlint/configuration_schema.json",
3
13
  "plugins": [
4
14
  "import",
@@ -14,9 +24,8 @@ let e=require(`@stryke/convert/neutral`);function t(t={}){return`{
14
24
  "coverage/**",
15
25
  "node_modules/**",
16
26
  "temp/**",
17
- "tests/fixtures/**"${t.ignorePatterns?`,
18
- ${(0,e.toArray)(t.ignorePatterns).map(e=>`"${e}"`).join(`,
19
- `)}`:``}
27
+ "tests/fixtures/**"${options.ignorePatterns ? `,
28
+ ${(0, __stryke_convert_neutral.toArray)(options.ignorePatterns).map((pattern) => `"${pattern}"`).join(",\n ")}` : ""}
20
29
  ],
21
30
  "rules": {
22
31
  "import/named": "error",
@@ -42,4 +51,8 @@ let e=require(`@stryke/convert/neutral`);function t(t={}){return`{
42
51
  ],
43
52
  "unicorn/prefer-node-protocol": "error"
44
53
  }
45
- }`}exports.generateConfig=t;
54
+ }`;
55
+ }
56
+
57
+ //#endregion
58
+ exports.generateConfig = generateConfig;
@@ -1,4 +1,14 @@
1
- import{toArray as e}from"@stryke/convert/neutral";function t(t={}){return`{
1
+ import { toArray } from "@stryke/convert/neutral";
2
+
3
+ //#region src/helpers/generate-config.ts
4
+ /**
5
+ * Generates an Oxlint configuration file content based on the provided options.
6
+ *
7
+ * @param options - The options for the Oxlint plugin.
8
+ * @returns The generated configuration as a string.
9
+ */
10
+ function generateConfig(options = {}) {
11
+ return `{
2
12
  "$schema": "./node_modules/oxlint/configuration_schema.json",
3
13
  "plugins": [
4
14
  "import",
@@ -14,9 +24,8 @@ import{toArray as e}from"@stryke/convert/neutral";function t(t={}){return`{
14
24
  "coverage/**",
15
25
  "node_modules/**",
16
26
  "temp/**",
17
- "tests/fixtures/**"${t.ignorePatterns?`,
18
- ${e(t.ignorePatterns).map(e=>`"${e}"`).join(`,
19
- `)}`:``}
27
+ "tests/fixtures/**"${options.ignorePatterns ? `,
28
+ ${toArray(options.ignorePatterns).map((pattern) => `"${pattern}"`).join(",\n ")}` : ""}
20
29
  ],
21
30
  "rules": {
22
31
  "import/named": "error",
@@ -42,4 +51,8 @@ import{toArray as e}from"@stryke/convert/neutral";function t(t={}){return`{
42
51
  ],
43
52
  "unicorn/prefer-node-protocol": "error"
44
53
  }
45
- }`}export{t as generateConfig};
54
+ }`;
55
+ }
56
+
57
+ //#endregion
58
+ export { generateConfig };
@@ -1 +1,3 @@
1
- const e=require(`./generate-config.cjs`);exports.generateConfig=e.generateConfig;
1
+ const require_helpers_generate_config = require('./generate-config.cjs');
2
+
3
+ exports.generateConfig = require_helpers_generate_config.generateConfig;
@@ -1 +1,3 @@
1
- import{generateConfig as e}from"./generate-config.mjs";export{e as generateConfig};
1
+ import { generateConfig } from "./generate-config.mjs";
2
+
3
+ export { generateConfig };
package/dist/index.cjs CHANGED
@@ -1 +1,81 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});let e=require(`@storm-software/config-tools/types`),t=require(`@stryke/cli/execute`),n=require(`@stryke/convert/to-array`),r=require(`@stryke/fs/exists`),i=require(`@stryke/fs/get-parent-path`),a=require(`@stryke/fs/package-fns`),o=require(`@stryke/path/join`),s=require(`@stryke/path/replace`);function c(c={}){return{name:`oxlint`,async config(){return this.log(e.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `oxlint` linting plugin."),{lint:{oxlint:{configFile:`.oxlintrc.json`,deny:[],allow:[],warn:[],typeAware:!0,fix:!0,format:`stylish`,...c}}}},configResolved(){this.devDependencies.oxlint=`^1.24.0`,this.config.lint.oxlint.typeAware&&(this.devDependencies[`oxlint-tsgolint`]=`^0.2.1`)},async lint(){this.log(e.LogLevelLabel.TRACE,`Linting project files with Oxlint.`);let c=[];if(this.config.lint.oxlint.params&&c.push(...this.config.lint.oxlint.params.split(` `).filter(Boolean)),!c.includes(`--ignore-pattern`)&&this.config.lint.oxlint.ignorePatterns&&c.push(`--ignore-pattern=${(0,n.toArray)(this.config.lint.oxlint.ignorePatterns).join(`,`)}`),this.config.lint.oxlint.deny.forEach(e=>c.push(`-D`,e)),this.config.lint.oxlint.allow.forEach(e=>c.push(`-A`,e)),this.config.lint.oxlint.warn.forEach(e=>c.push(`-W`,e)),!c.includes(`-c`)&&!c.includes(`--config`)){let e=(0,i.getParentPath)(this.config.lint.oxlint.configFile,this.config.projectRoot,{ignoreCase:!0,skipCwd:!1,includeNameInResults:!0});e&&!(0,r.existsSync)(e)&&this.config.lint.oxlint.configFile!==`.oxlintrc.json`&&(e=(0,i.getParentPath)(`.oxlintrc.json`,this.config.projectRoot,{ignoreCase:!0,skipCwd:!1,includeNameInResults:!0})),e&&(0,r.existsSync)(e)&&c.push(`-c`,e)}if(!c.includes(`--type-aware`)&&this.config.lint.oxlint.typeAware&&c.push(`--type-aware`),c.includes(`--tsconfig`)||c.push(`--tsconfig`,this.tsconfig.tsconfigFilePath),!c.includes(`-f`)&&!c.includes(`--format`)&&c.push(`-f`,this.config.lint.oxlint.format||`stylish`),this.config.lint.oxlint.fix!==!1&&!c.includes(`--fix`)&&!c.includes(`--fix-suggestions`)&&!c.includes(`--fix-dangerously`)&&(this.config.lint.oxlint.fix===!0?c.push(`--fix`):this.config.lint.oxlint.fix===`suggestions`?c.push(`--fix-suggestions`):this.config.lint.oxlint.fix===`dangerously`&&c.push(`--fix-dangerously`)),this.config.lint.oxlint.oxlintPath){c.unshift(this.config.lint.oxlint.oxlintPath,this.config.sourceRoot);let e=await(0,t.execute)(c.join(` `),this.workspaceConfig.workspaceRoot);if(e.failed)throw Error(`Oxlint process exited with code ${e.exitCode}.`)}else{let e=await(0,a.isPackageListed)(`oxlint`,this.config.projectRoot);c.unshift(e?(0,s.replacePath)(this.config.sourceRoot,this.config.projectRoot):this.config.sourceRoot);let n=await(0,t.executePackage)(`oxlint`,c,e?(0,o.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot):this.workspaceConfig.workspaceRoot);if(n.failed)throw Error(`Oxlint process exited with code ${n.exitCode}.`)}}}}var l=c;exports.default=l,exports.plugin=c;
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+ let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
3
+ let __stryke_cli_execute = require("@stryke/cli/execute");
4
+ let __stryke_convert_to_array = require("@stryke/convert/to-array");
5
+ let __stryke_fs_exists = require("@stryke/fs/exists");
6
+ let __stryke_fs_get_parent_path = require("@stryke/fs/get-parent-path");
7
+ let __stryke_fs_package_fns = require("@stryke/fs/package-fns");
8
+ let __stryke_path_join = require("@stryke/path/join");
9
+ let __stryke_path_replace = require("@stryke/path/replace");
10
+
11
+ //#region src/index.ts
12
+ /**
13
+ * A Powerlines plugin to assist in linting a project with Biome.
14
+ */
15
+ function plugin(options = {}) {
16
+ return {
17
+ name: "oxlint",
18
+ async config() {
19
+ this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, "Providing default configuration for the Powerlines `oxlint` linting plugin.");
20
+ return { lint: { oxlint: {
21
+ configFile: ".oxlintrc.json",
22
+ deny: [],
23
+ allow: [],
24
+ warn: [],
25
+ typeAware: true,
26
+ fix: true,
27
+ format: "stylish",
28
+ ...options
29
+ } } };
30
+ },
31
+ configResolved() {
32
+ this.devDependencies.oxlint = "^1.24.0";
33
+ if (this.config.lint.oxlint.typeAware) this.devDependencies["oxlint-tsgolint"] = "^0.2.1";
34
+ },
35
+ async lint() {
36
+ this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Linting project files with Oxlint.`);
37
+ const args = [];
38
+ if (this.config.lint.oxlint.params) args.push(...this.config.lint.oxlint.params.split(" ").filter(Boolean));
39
+ if (!args.includes("--ignore-pattern") && this.config.lint.oxlint.ignorePatterns) args.push(`--ignore-pattern=${(0, __stryke_convert_to_array.toArray)(this.config.lint.oxlint.ignorePatterns).join(",")}`);
40
+ this.config.lint.oxlint.deny.forEach((d) => args.push("-D", d));
41
+ this.config.lint.oxlint.allow.forEach((a) => args.push("-A", a));
42
+ this.config.lint.oxlint.warn.forEach((w) => args.push("-W", w));
43
+ if (!args.includes("-c") && !args.includes("--config")) {
44
+ let configFile = (0, __stryke_fs_get_parent_path.getParentPath)(this.config.lint.oxlint.configFile, this.config.projectRoot, {
45
+ ignoreCase: true,
46
+ skipCwd: false,
47
+ includeNameInResults: true
48
+ });
49
+ if (configFile && !(0, __stryke_fs_exists.existsSync)(configFile) && this.config.lint.oxlint.configFile !== ".oxlintrc.json") configFile = (0, __stryke_fs_get_parent_path.getParentPath)(".oxlintrc.json", this.config.projectRoot, {
50
+ ignoreCase: true,
51
+ skipCwd: false,
52
+ includeNameInResults: true
53
+ });
54
+ if (configFile && (0, __stryke_fs_exists.existsSync)(configFile)) args.push("-c", configFile);
55
+ }
56
+ if (!args.includes("--type-aware") && this.config.lint.oxlint.typeAware) args.push("--type-aware");
57
+ if (!args.includes("--tsconfig")) args.push("--tsconfig", this.tsconfig.tsconfigFilePath);
58
+ if (!args.includes("-f") && !args.includes("--format")) args.push("-f", this.config.lint.oxlint.format || "stylish");
59
+ if (this.config.lint.oxlint.fix !== false && !args.includes("--fix") && !args.includes("--fix-suggestions") && !args.includes("--fix-dangerously")) {
60
+ if (this.config.lint.oxlint.fix === true) args.push("--fix");
61
+ else if (this.config.lint.oxlint.fix === "suggestions") args.push("--fix-suggestions");
62
+ else if (this.config.lint.oxlint.fix === "dangerously") args.push("--fix-dangerously");
63
+ }
64
+ if (!this.config.lint.oxlint.oxlintPath) {
65
+ const isOxlintListed = await (0, __stryke_fs_package_fns.isPackageListed)("oxlint", this.config.projectRoot);
66
+ args.unshift(isOxlintListed ? (0, __stryke_path_replace.replacePath)(this.config.sourceRoot, this.config.projectRoot) : this.config.sourceRoot);
67
+ const result = await (0, __stryke_cli_execute.executePackage)("oxlint", args, isOxlintListed ? (0, __stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.projectRoot) : this.workspaceConfig.workspaceRoot);
68
+ if (result.failed) throw new Error(`Oxlint process exited with code ${result.exitCode}.`);
69
+ } else {
70
+ args.unshift(this.config.lint.oxlint.oxlintPath, this.config.sourceRoot);
71
+ const result = await (0, __stryke_cli_execute.execute)(args.join(" "), this.workspaceConfig.workspaceRoot);
72
+ if (result.failed) throw new Error(`Oxlint process exited with code ${result.exitCode}.`);
73
+ }
74
+ }
75
+ };
76
+ }
77
+ var src_default = plugin;
78
+
79
+ //#endregion
80
+ exports.default = src_default;
81
+ exports.plugin = plugin;
package/dist/index.mjs CHANGED
@@ -1 +1,79 @@
1
- import{LogLevelLabel as e}from"@storm-software/config-tools/types";import{execute as t,executePackage as n}from"@stryke/cli/execute";import{toArray as r}from"@stryke/convert/to-array";import{existsSync as i}from"@stryke/fs/exists";import{getParentPath as a}from"@stryke/fs/get-parent-path";import{isPackageListed as o}from"@stryke/fs/package-fns";import{joinPaths as s}from"@stryke/path/join";import{replacePath as c}from"@stryke/path/replace";function l(l={}){return{name:`oxlint`,async config(){return this.log(e.TRACE,"Providing default configuration for the Powerlines `oxlint` linting plugin."),{lint:{oxlint:{configFile:`.oxlintrc.json`,deny:[],allow:[],warn:[],typeAware:!0,fix:!0,format:`stylish`,...l}}}},configResolved(){this.devDependencies.oxlint=`^1.24.0`,this.config.lint.oxlint.typeAware&&(this.devDependencies[`oxlint-tsgolint`]=`^0.2.1`)},async lint(){this.log(e.TRACE,`Linting project files with Oxlint.`);let l=[];if(this.config.lint.oxlint.params&&l.push(...this.config.lint.oxlint.params.split(` `).filter(Boolean)),!l.includes(`--ignore-pattern`)&&this.config.lint.oxlint.ignorePatterns&&l.push(`--ignore-pattern=${r(this.config.lint.oxlint.ignorePatterns).join(`,`)}`),this.config.lint.oxlint.deny.forEach(e=>l.push(`-D`,e)),this.config.lint.oxlint.allow.forEach(e=>l.push(`-A`,e)),this.config.lint.oxlint.warn.forEach(e=>l.push(`-W`,e)),!l.includes(`-c`)&&!l.includes(`--config`)){let e=a(this.config.lint.oxlint.configFile,this.config.projectRoot,{ignoreCase:!0,skipCwd:!1,includeNameInResults:!0});e&&!i(e)&&this.config.lint.oxlint.configFile!==`.oxlintrc.json`&&(e=a(`.oxlintrc.json`,this.config.projectRoot,{ignoreCase:!0,skipCwd:!1,includeNameInResults:!0})),e&&i(e)&&l.push(`-c`,e)}if(!l.includes(`--type-aware`)&&this.config.lint.oxlint.typeAware&&l.push(`--type-aware`),l.includes(`--tsconfig`)||l.push(`--tsconfig`,this.tsconfig.tsconfigFilePath),!l.includes(`-f`)&&!l.includes(`--format`)&&l.push(`-f`,this.config.lint.oxlint.format||`stylish`),this.config.lint.oxlint.fix!==!1&&!l.includes(`--fix`)&&!l.includes(`--fix-suggestions`)&&!l.includes(`--fix-dangerously`)&&(this.config.lint.oxlint.fix===!0?l.push(`--fix`):this.config.lint.oxlint.fix===`suggestions`?l.push(`--fix-suggestions`):this.config.lint.oxlint.fix===`dangerously`&&l.push(`--fix-dangerously`)),this.config.lint.oxlint.oxlintPath){l.unshift(this.config.lint.oxlint.oxlintPath,this.config.sourceRoot);let e=await t(l.join(` `),this.workspaceConfig.workspaceRoot);if(e.failed)throw Error(`Oxlint process exited with code ${e.exitCode}.`)}else{let e=await o(`oxlint`,this.config.projectRoot);l.unshift(e?c(this.config.sourceRoot,this.config.projectRoot):this.config.sourceRoot);let t=await n(`oxlint`,l,e?s(this.workspaceConfig.workspaceRoot,this.config.projectRoot):this.workspaceConfig.workspaceRoot);if(t.failed)throw Error(`Oxlint process exited with code ${t.exitCode}.`)}}}}var u=l;export{u as default,l as plugin};
1
+ import { LogLevelLabel } from "@storm-software/config-tools/types";
2
+ import { execute, executePackage } from "@stryke/cli/execute";
3
+ import { toArray } from "@stryke/convert/to-array";
4
+ import { existsSync } from "@stryke/fs/exists";
5
+ import { getParentPath } from "@stryke/fs/get-parent-path";
6
+ import { isPackageListed } from "@stryke/fs/package-fns";
7
+ import { joinPaths } from "@stryke/path/join";
8
+ import { replacePath } from "@stryke/path/replace";
9
+
10
+ //#region src/index.ts
11
+ /**
12
+ * A Powerlines plugin to assist in linting a project with Biome.
13
+ */
14
+ function plugin(options = {}) {
15
+ return {
16
+ name: "oxlint",
17
+ async config() {
18
+ this.log(LogLevelLabel.TRACE, "Providing default configuration for the Powerlines `oxlint` linting plugin.");
19
+ return { lint: { oxlint: {
20
+ configFile: ".oxlintrc.json",
21
+ deny: [],
22
+ allow: [],
23
+ warn: [],
24
+ typeAware: true,
25
+ fix: true,
26
+ format: "stylish",
27
+ ...options
28
+ } } };
29
+ },
30
+ configResolved() {
31
+ this.devDependencies.oxlint = "^1.24.0";
32
+ if (this.config.lint.oxlint.typeAware) this.devDependencies["oxlint-tsgolint"] = "^0.2.1";
33
+ },
34
+ async lint() {
35
+ this.log(LogLevelLabel.TRACE, `Linting project files with Oxlint.`);
36
+ const args = [];
37
+ if (this.config.lint.oxlint.params) args.push(...this.config.lint.oxlint.params.split(" ").filter(Boolean));
38
+ if (!args.includes("--ignore-pattern") && this.config.lint.oxlint.ignorePatterns) args.push(`--ignore-pattern=${toArray(this.config.lint.oxlint.ignorePatterns).join(",")}`);
39
+ this.config.lint.oxlint.deny.forEach((d) => args.push("-D", d));
40
+ this.config.lint.oxlint.allow.forEach((a) => args.push("-A", a));
41
+ this.config.lint.oxlint.warn.forEach((w) => args.push("-W", w));
42
+ if (!args.includes("-c") && !args.includes("--config")) {
43
+ let configFile = getParentPath(this.config.lint.oxlint.configFile, this.config.projectRoot, {
44
+ ignoreCase: true,
45
+ skipCwd: false,
46
+ includeNameInResults: true
47
+ });
48
+ if (configFile && !existsSync(configFile) && this.config.lint.oxlint.configFile !== ".oxlintrc.json") configFile = getParentPath(".oxlintrc.json", this.config.projectRoot, {
49
+ ignoreCase: true,
50
+ skipCwd: false,
51
+ includeNameInResults: true
52
+ });
53
+ if (configFile && existsSync(configFile)) args.push("-c", configFile);
54
+ }
55
+ if (!args.includes("--type-aware") && this.config.lint.oxlint.typeAware) args.push("--type-aware");
56
+ if (!args.includes("--tsconfig")) args.push("--tsconfig", this.tsconfig.tsconfigFilePath);
57
+ if (!args.includes("-f") && !args.includes("--format")) args.push("-f", this.config.lint.oxlint.format || "stylish");
58
+ if (this.config.lint.oxlint.fix !== false && !args.includes("--fix") && !args.includes("--fix-suggestions") && !args.includes("--fix-dangerously")) {
59
+ if (this.config.lint.oxlint.fix === true) args.push("--fix");
60
+ else if (this.config.lint.oxlint.fix === "suggestions") args.push("--fix-suggestions");
61
+ else if (this.config.lint.oxlint.fix === "dangerously") args.push("--fix-dangerously");
62
+ }
63
+ if (!this.config.lint.oxlint.oxlintPath) {
64
+ const isOxlintListed = await isPackageListed("oxlint", this.config.projectRoot);
65
+ args.unshift(isOxlintListed ? replacePath(this.config.sourceRoot, this.config.projectRoot) : this.config.sourceRoot);
66
+ const result = await executePackage("oxlint", args, isOxlintListed ? joinPaths(this.workspaceConfig.workspaceRoot, this.config.projectRoot) : this.workspaceConfig.workspaceRoot);
67
+ if (result.failed) throw new Error(`Oxlint process exited with code ${result.exitCode}.`);
68
+ } else {
69
+ args.unshift(this.config.lint.oxlint.oxlintPath, this.config.sourceRoot);
70
+ const result = await execute(args.join(" "), this.workspaceConfig.workspaceRoot);
71
+ if (result.failed) throw new Error(`Oxlint process exited with code ${result.exitCode}.`);
72
+ }
73
+ }
74
+ };
75
+ }
76
+ var src_default = plugin;
77
+
78
+ //#endregion
79
+ export { src_default as default, plugin };
@@ -78,10 +78,18 @@ interface ParseOptions extends ParserOptions {
78
78
  */
79
79
  allowReturnOutsideFunction?: boolean;
80
80
  }
81
+ interface EmitOptions extends WriteOptions {
82
+ /**
83
+ * If true, will emit the file using {@link UnpluginBuildContext.emitFile | the bundler's emit function}.
84
+ */
85
+ emitWithBundler?: boolean;
86
+ needsCodeReference?: Parameters<UnpluginBuildContext["emitFile"]>[0]["needsCodeReference"];
87
+ originalFileName?: Parameters<UnpluginBuildContext["emitFile"]>[0]["originalFileName"];
88
+ }
81
89
  /**
82
90
  * Options for emitting entry virtual files
83
91
  */
84
- type EmitEntryOptions = WriteOptions & Omit<ResolvedEntryTypeDefinition, "file">;
92
+ type EmitEntryOptions = EmitOptions & Omit<ResolvedEntryTypeDefinition, "file">;
85
93
  /**
86
94
  * The unresolved Powerlines context.
87
95
  *
@@ -292,6 +300,22 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
292
300
  * The Powerlines builtin virtual files
293
301
  */
294
302
  getBuiltins: () => Promise<VirtualFile[]>;
303
+ /**
304
+ * Resolves a file and writes it to the VFS if it does not already exist
305
+ *
306
+ * @param code - The source code of the file
307
+ * @param path - The path to write the file to
308
+ * @param options - Additional options for writing the file
309
+ */
310
+ emit: (code: string, path: string, options?: EmitOptions) => Promise<void>;
311
+ /**
312
+ * Synchronously resolves a file and writes it to the VFS if it does not already exist
313
+ *
314
+ * @param code - The source code of the file
315
+ * @param path - The path to write the file to
316
+ * @param options - Additional options for writing the file
317
+ */
318
+ emitSync: (code: string, path: string, options?: EmitOptions) => void;
295
319
  /**
296
320
  * Resolves a builtin virtual file and writes it to the VFS if it does not already exist
297
321
  *
@@ -300,7 +324,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
300
324
  * @param path - An optional path to write the builtin file to
301
325
  * @param options - Additional options for writing the builtin file
302
326
  */
303
- emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
327
+ emitBuiltin: (code: string, id: string, path?: string, options?: EmitOptions) => Promise<void>;
304
328
  /**
305
329
  * Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
306
330
  *
@@ -309,7 +333,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
309
333
  * @param path - An optional path to write the builtin file to
310
334
  * @param options - Additional options for writing the builtin file
311
335
  */
312
- emitBuiltinSync: (code: string, id: string, path?: string, options?: WriteOptions) => void;
336
+ emitBuiltinSync: (code: string, id: string, path?: string, options?: EmitOptions) => void;
313
337
  /**
314
338
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
315
339
  *
@@ -80,10 +80,18 @@ interface ParseOptions extends ParserOptions {
80
80
  */
81
81
  allowReturnOutsideFunction?: boolean;
82
82
  }
83
+ interface EmitOptions extends WriteOptions {
84
+ /**
85
+ * If true, will emit the file using {@link UnpluginBuildContext.emitFile | the bundler's emit function}.
86
+ */
87
+ emitWithBundler?: boolean;
88
+ needsCodeReference?: Parameters<UnpluginBuildContext["emitFile"]>[0]["needsCodeReference"];
89
+ originalFileName?: Parameters<UnpluginBuildContext["emitFile"]>[0]["originalFileName"];
90
+ }
83
91
  /**
84
92
  * Options for emitting entry virtual files
85
93
  */
86
- type EmitEntryOptions = WriteOptions & Omit<ResolvedEntryTypeDefinition, "file">;
94
+ type EmitEntryOptions = EmitOptions & Omit<ResolvedEntryTypeDefinition, "file">;
87
95
  /**
88
96
  * The unresolved Powerlines context.
89
97
  *
@@ -294,6 +302,22 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
294
302
  * The Powerlines builtin virtual files
295
303
  */
296
304
  getBuiltins: () => Promise<VirtualFile[]>;
305
+ /**
306
+ * Resolves a file and writes it to the VFS if it does not already exist
307
+ *
308
+ * @param code - The source code of the file
309
+ * @param path - The path to write the file to
310
+ * @param options - Additional options for writing the file
311
+ */
312
+ emit: (code: string, path: string, options?: EmitOptions) => Promise<void>;
313
+ /**
314
+ * Synchronously resolves a file and writes it to the VFS if it does not already exist
315
+ *
316
+ * @param code - The source code of the file
317
+ * @param path - The path to write the file to
318
+ * @param options - Additional options for writing the file
319
+ */
320
+ emitSync: (code: string, path: string, options?: EmitOptions) => void;
297
321
  /**
298
322
  * Resolves a builtin virtual file and writes it to the VFS if it does not already exist
299
323
  *
@@ -302,7 +326,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
302
326
  * @param path - An optional path to write the builtin file to
303
327
  * @param options - Additional options for writing the builtin file
304
328
  */
305
- emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
329
+ emitBuiltin: (code: string, id: string, path?: string, options?: EmitOptions) => Promise<void>;
306
330
  /**
307
331
  * Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
308
332
  *
@@ -311,7 +335,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
311
335
  * @param path - An optional path to write the builtin file to
312
336
  * @param options - Additional options for writing the builtin file
313
337
  */
314
- emitBuiltinSync: (code: string, id: string, path?: string, options?: WriteOptions) => void;
338
+ emitBuiltinSync: (code: string, id: string, path?: string, options?: EmitOptions) => void;
315
339
  /**
316
340
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
317
341
  *
@@ -1 +1 @@
1
- export{};
1
+ export { };
@@ -1 +1 @@
1
- export{};
1
+ export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-oxlint",
3
- "version": "0.7.121",
3
+ "version": "0.7.122",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin for running Oxlint on the codebase.",
6
6
  "repository": {
@@ -101,20 +101,20 @@
101
101
  "keywords": ["oxlint", "powerlines", "storm-software", "powerlines-plugin"],
102
102
  "dependencies": {
103
103
  "@storm-software/config-tools": "^1.188.74",
104
- "@stryke/cli": "^0.12.36",
105
- "@stryke/convert": "^0.6.29",
106
- "@stryke/fs": "^0.33.26",
107
- "@stryke/path": "^0.24.0",
104
+ "@stryke/cli": "^0.12.37",
105
+ "@stryke/convert": "^0.6.30",
106
+ "@stryke/fs": "^0.33.27",
107
+ "@stryke/path": "^0.24.1",
108
108
  "defu": "^6.1.4",
109
109
  "oxlint": "^1.36.0",
110
110
  "oxlint-tsgolint": "^0.2.1",
111
- "powerlines": "^0.36.22"
111
+ "powerlines": "^0.36.23"
112
112
  },
113
113
  "devDependencies": {
114
- "@powerlines/nx": "^0.11.48",
114
+ "@powerlines/nx": "^0.11.49",
115
115
  "@storm-software/tsup": "^0.2.72",
116
116
  "@types/node": "^24.10.4"
117
117
  },
118
118
  "publishConfig": { "access": "public" },
119
- "gitHead": "f88fe8eb30f96536b83fc9af884972d48e31e63a"
119
+ "gitHead": "be47e546b48b9a82e460b5c5d4f02fb66e821f18"
120
120
  }