@powerlines/plugin-oxlint 0.7.257 → 0.7.258

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.
Files changed (44) hide show
  1. package/dist/helpers/generate-config.cjs +57 -2
  2. package/dist/helpers/generate-config.d.cts +14 -3
  3. package/dist/helpers/generate-config.d.cts.map +1 -0
  4. package/dist/helpers/generate-config.d.mts +14 -3
  5. package/dist/helpers/generate-config.d.mts.map +1 -0
  6. package/dist/helpers/generate-config.mjs +58 -2
  7. package/dist/helpers/generate-config.mjs.map +1 -0
  8. package/dist/helpers/index.cjs +2 -2
  9. package/dist/helpers/index.d.cts +1 -2
  10. package/dist/helpers/index.d.mts +1 -2
  11. package/dist/helpers/index.mjs +1 -1
  12. package/dist/index.cjs +0 -2
  13. package/dist/index.d.cts +2 -2
  14. package/dist/index.d.mts +2 -2
  15. package/dist/index.mjs +0 -2
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/types/index.cjs +0 -2
  18. package/dist/types/index.d.cts +1 -2
  19. package/dist/types/index.d.mts +1 -2
  20. package/dist/types/index.mjs +0 -3
  21. package/dist/types/plugin.cjs +0 -1
  22. package/dist/types/plugin.d.cts +84 -2
  23. package/dist/types/plugin.d.cts.map +1 -0
  24. package/dist/types/plugin.d.mts +84 -2
  25. package/dist/types/plugin.d.mts.map +1 -0
  26. package/dist/types/plugin.mjs +0 -2
  27. package/package.json +4 -4
  28. package/dist/generate-config-BJgmb4Je.mjs +0 -59
  29. package/dist/generate-config-BJgmb4Je.mjs.map +0 -1
  30. package/dist/generate-config-BKQYOLby.d.cts +0 -14
  31. package/dist/generate-config-BKQYOLby.d.cts.map +0 -1
  32. package/dist/generate-config-BZjB8irN.cjs +0 -63
  33. package/dist/generate-config-CtqHlwuj.d.mts +0 -14
  34. package/dist/generate-config-CtqHlwuj.d.mts.map +0 -1
  35. package/dist/index-D-CYNcT9.d.mts +0 -1
  36. package/dist/index-D6CnpA_r.d.cts +0 -1
  37. package/dist/plugin-BsPGUUSA.d.mts +0 -84
  38. package/dist/plugin-BsPGUUSA.d.mts.map +0 -1
  39. package/dist/plugin-DHXHjv16.cjs +0 -0
  40. package/dist/plugin-DNsqegEV.mjs +0 -1
  41. package/dist/plugin-n-BO5XLy.d.cts +0 -84
  42. package/dist/plugin-n-BO5XLy.d.cts.map +0 -1
  43. package/dist/types-CpP_DWx6.mjs +0 -1
  44. package/dist/types-DHkg7xmX.cjs +0 -0
@@ -1,3 +1,58 @@
1
- const require_generate_config = require('../generate-config-BZjB8irN.cjs');
1
+ let __stryke_convert_neutral = require("@stryke/convert/neutral");
2
2
 
3
- exports.generateConfig = require_generate_config.generateConfig;
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 `{
12
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
13
+ "plugins": [
14
+ "import",
15
+ "jsdoc",
16
+ "unicorn",
17
+ "typescript",
18
+ "oxc"
19
+ ],
20
+ "ignorePatterns": [
21
+ "crates/**",
22
+ "dist/**",
23
+ "build/**",
24
+ "coverage/**",
25
+ "node_modules/**",
26
+ "temp/**",
27
+ "tests/fixtures/**"${options.ignorePatterns ? `,
28
+ ${(0, __stryke_convert_neutral.toArray)(options.ignorePatterns).map((pattern) => `"${pattern}"`).join(",\n ")}` : ""}
29
+ ],
30
+ "rules": {
31
+ "import/named": "error",
32
+ "import/namespace": [
33
+ "error",
34
+ {
35
+ "allowComputed": true
36
+ }
37
+ ],
38
+ "no-unused-expressions": [
39
+ "warn",
40
+ {
41
+ "allowShortCircuit": true,
42
+ "allowTaggedTemplates": true
43
+ }
44
+ ],
45
+ "no-unused-vars": [
46
+ "warn",
47
+ {
48
+ "varsIgnorePattern": "^_",
49
+ "argsIgnorePattern": "^_"
50
+ }
51
+ ],
52
+ "unicorn/prefer-node-protocol": "error"
53
+ }
54
+ }`;
55
+ }
56
+
57
+ //#endregion
58
+ exports.generateConfig = generateConfig;
@@ -1,3 +1,14 @@
1
- import "../plugin-n-BO5XLy.cjs";
2
- import { t as generateConfig } from "../generate-config-BKQYOLby.cjs";
3
- export { generateConfig };
1
+ import { OxlintPluginOptions } from "../types/plugin.cjs";
2
+
3
+ //#region src/helpers/generate-config.d.ts
4
+
5
+ /**
6
+ * Generates an Oxlint configuration file content based on the provided options.
7
+ *
8
+ * @param options - The options for the Oxlint plugin.
9
+ * @returns The generated configuration as a string.
10
+ */
11
+ declare function generateConfig(options?: OxlintPluginOptions): string;
12
+ //#endregion
13
+ export { generateConfig };
14
+ //# sourceMappingURL=generate-config.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-config.d.cts","names":[],"sources":["../../src/helpers/generate-config.ts"],"sourcesContent":[],"mappings":";;;;;;AA2BA;;;;iBAAgB,cAAA,WAAwB"}
@@ -1,3 +1,14 @@
1
- import "../plugin-BsPGUUSA.mjs";
2
- import { t as generateConfig } from "../generate-config-CtqHlwuj.mjs";
3
- export { generateConfig };
1
+ import { OxlintPluginOptions } from "../types/plugin.mjs";
2
+
3
+ //#region src/helpers/generate-config.d.ts
4
+
5
+ /**
6
+ * Generates an Oxlint configuration file content based on the provided options.
7
+ *
8
+ * @param options - The options for the Oxlint plugin.
9
+ * @returns The generated configuration as a string.
10
+ */
11
+ declare function generateConfig(options?: OxlintPluginOptions): string;
12
+ //#endregion
13
+ export { generateConfig };
14
+ //# sourceMappingURL=generate-config.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-config.d.mts","names":[],"sources":["../../src/helpers/generate-config.ts"],"sourcesContent":[],"mappings":";;;;;;AA2BA;;;;iBAAgB,cAAA,WAAwB"}
@@ -1,3 +1,59 @@
1
- import { t as generateConfig } from "../generate-config-BJgmb4Je.mjs";
1
+ import { toArray } from "@stryke/convert/neutral";
2
2
 
3
- export { generateConfig };
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 `{
12
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
13
+ "plugins": [
14
+ "import",
15
+ "jsdoc",
16
+ "unicorn",
17
+ "typescript",
18
+ "oxc"
19
+ ],
20
+ "ignorePatterns": [
21
+ "crates/**",
22
+ "dist/**",
23
+ "build/**",
24
+ "coverage/**",
25
+ "node_modules/**",
26
+ "temp/**",
27
+ "tests/fixtures/**"${options.ignorePatterns ? `,
28
+ ${toArray(options.ignorePatterns).map((pattern) => `"${pattern}"`).join(",\n ")}` : ""}
29
+ ],
30
+ "rules": {
31
+ "import/named": "error",
32
+ "import/namespace": [
33
+ "error",
34
+ {
35
+ "allowComputed": true
36
+ }
37
+ ],
38
+ "no-unused-expressions": [
39
+ "warn",
40
+ {
41
+ "allowShortCircuit": true,
42
+ "allowTaggedTemplates": true
43
+ }
44
+ ],
45
+ "no-unused-vars": [
46
+ "warn",
47
+ {
48
+ "varsIgnorePattern": "^_",
49
+ "argsIgnorePattern": "^_"
50
+ }
51
+ ],
52
+ "unicorn/prefer-node-protocol": "error"
53
+ }
54
+ }`;
55
+ }
56
+
57
+ //#endregion
58
+ export { generateConfig };
59
+ //# sourceMappingURL=generate-config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-config.mjs","names":[],"sources":["../../src/helpers/generate-config.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 { toArray } from \"@stryke/convert/neutral\";\nimport { OxlintPluginOptions } from \"../types/plugin\";\n\n/**\n * Generates an Oxlint configuration file content based on the provided options.\n *\n * @param options - The options for the Oxlint plugin.\n * @returns The generated configuration as a string.\n */\nexport function generateConfig(options: OxlintPluginOptions = {}): string {\n return `{\n \"$schema\": \"./node_modules/oxlint/configuration_schema.json\",\n \"plugins\": [\n \"import\",\n \"jsdoc\",\n \"unicorn\",\n \"typescript\",\n \"oxc\"\n ],\n \"ignorePatterns\": [\n \"crates/**\",\n \"dist/**\",\n \"build/**\",\n \"coverage/**\",\n \"node_modules/**\",\n \"temp/**\",\n \"tests/fixtures/**\"${\n options.ignorePatterns\n ? `,\n ${toArray(options.ignorePatterns)\n .map(pattern => `\"${pattern}\"`)\n .join(\",\\n \")}`\n : \"\"\n }\n ],\n \"rules\": {\n \"import/named\": \"error\",\n \"import/namespace\": [\n \"error\",\n {\n \"allowComputed\": true\n }\n ],\n \"no-unused-expressions\": [\n \"warn\",\n {\n \"allowShortCircuit\": true,\n \"allowTaggedTemplates\": true\n }\n ],\n \"no-unused-vars\": [\n \"warn\",\n {\n \"varsIgnorePattern\": \"^_\",\n \"argsIgnorePattern\": \"^_\"\n }\n ],\n \"unicorn/prefer-node-protocol\": \"error\"\n }\n}`;\n}\n"],"mappings":";;;;;;;;;AA2BA,SAAgB,eAAe,UAA+B,EAAE,EAAU;AACxE,QAAO;;;;;;;;;;;;;;;;yBAiBH,QAAQ,iBACJ;MACJ,QAAQ,QAAQ,eAAe,CAC9B,KAAI,YAAW,IAAI,QAAQ,GAAG,CAC9B,KAAK,UAAU,KACZ,GACL"}
@@ -1,3 +1,3 @@
1
- const require_generate_config = require('../generate-config-BZjB8irN.cjs');
1
+ const require_helpers_generate_config = require('./generate-config.cjs');
2
2
 
3
- exports.generateConfig = require_generate_config.generateConfig;
3
+ exports.generateConfig = require_helpers_generate_config.generateConfig;
@@ -1,3 +1,2 @@
1
- import "../plugin-n-BO5XLy.cjs";
2
- import { t as generateConfig } from "../generate-config-BKQYOLby.cjs";
1
+ import { generateConfig } from "./generate-config.cjs";
3
2
  export { generateConfig };
@@ -1,3 +1,2 @@
1
- import "../plugin-BsPGUUSA.mjs";
2
- import { t as generateConfig } from "../generate-config-CtqHlwuj.mjs";
1
+ import { generateConfig } from "./generate-config.mjs";
3
2
  export { generateConfig };
@@ -1,3 +1,3 @@
1
- import { t as generateConfig } from "../generate-config-BJgmb4Je.mjs";
1
+ import { generateConfig } from "./generate-config.mjs";
2
2
 
3
3
  export { generateConfig };
package/dist/index.cjs CHANGED
@@ -1,6 +1,4 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- require('./plugin-DHXHjv16.cjs');
3
- require('./types-DHkg7xmX.cjs');
4
2
  let __stryke_cli_execute = require("@stryke/cli/execute");
5
3
  let __stryke_convert_to_array = require("@stryke/convert/to-array");
6
4
  let __stryke_fs_exists = require("@stryke/fs/exists");
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as __ΩOxlintPluginContext, c as __ΩOxlintPluginUserConfig, i as OxlintPluginUserConfig, n as OxlintPluginOptions, o as __ΩOxlintPluginOptions, r as OxlintPluginResolvedConfig, s as __ΩOxlintPluginResolvedConfig, t as OxlintPluginContext } from "./plugin-n-BO5XLy.cjs";
2
- import "./index-D6CnpA_r.cjs";
1
+ import { OxlintPluginContext, OxlintPluginOptions, OxlintPluginResolvedConfig, OxlintPluginUserConfig, __ΩOxlintPluginContext, __ΩOxlintPluginOptions, __ΩOxlintPluginResolvedConfig, __ΩOxlintPluginUserConfig } from "./types/plugin.cjs";
2
+ import "./types/index.cjs";
3
3
  import { Plugin } from "powerlines/types/plugin";
4
4
 
5
5
  //#region src/index.d.ts
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as __ΩOxlintPluginContext, c as __ΩOxlintPluginUserConfig, i as OxlintPluginUserConfig, n as OxlintPluginOptions, o as __ΩOxlintPluginOptions, r as OxlintPluginResolvedConfig, s as __ΩOxlintPluginResolvedConfig, t as OxlintPluginContext } from "./plugin-BsPGUUSA.mjs";
2
- import "./index-D-CYNcT9.mjs";
1
+ import { OxlintPluginContext, OxlintPluginOptions, OxlintPluginResolvedConfig, OxlintPluginUserConfig, __ΩOxlintPluginContext, __ΩOxlintPluginOptions, __ΩOxlintPluginResolvedConfig, __ΩOxlintPluginUserConfig } from "./types/plugin.mjs";
2
+ import "./types/index.mjs";
3
3
  import { Plugin } from "powerlines/types/plugin";
4
4
 
5
5
  //#region src/index.d.ts
package/dist/index.mjs CHANGED
@@ -1,5 +1,3 @@
1
- import "./plugin-DNsqegEV.mjs";
2
- import "./types-CpP_DWx6.mjs";
3
1
  import { execute, executePackage } from "@stryke/cli/execute";
4
2
  import { toArray } from "@stryke/convert/to-array";
5
3
  import { existsSync } from "@stryke/fs/exists";
@@ -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 { toArray } from \"@stryke/convert/to-array\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { getParentPath } from \"@stryke/fs/get-parent-path\";\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 { OxlintPluginContext, OxlintPluginOptions } 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: OxlintPluginOptions = {}\n): Plugin<OxlintPluginContext> {\n return {\n name: \"oxlint\",\n async config() {\n this.debug(\n \"Providing default configuration for the Powerlines `oxlint` linting plugin.\"\n );\n\n return {\n lint: {\n oxlint: {\n configFile: \".oxlintrc.json\",\n deny: [],\n allow: [],\n warn: [],\n typeAware: true,\n fix: true,\n format: \"stylish\",\n ...options\n }\n }\n };\n },\n configResolved() {\n this.devDependencies.oxlint = \"^1.24.0\";\n if (this.config.lint.oxlint.typeAware) {\n this.devDependencies[\"oxlint-tsgolint\"] = \"^0.2.1\";\n }\n },\n async lint() {\n this.debug(\"Linting project files with Oxlint.\");\n\n const args: string[] = [];\n\n if (this.config.lint.oxlint.params) {\n args.push(...this.config.lint.oxlint.params.split(\" \").filter(Boolean));\n }\n\n if (\n !args.includes(\"--ignore-pattern\") &&\n this.config.lint.oxlint.ignorePatterns\n ) {\n args.push(\n `--ignore-pattern=${toArray(this.config.lint.oxlint.ignorePatterns).join(\",\")}`\n );\n }\n\n this.config.lint.oxlint.deny.forEach(d => args.push(\"-D\", d));\n this.config.lint.oxlint.allow.forEach(a => args.push(\"-A\", a));\n this.config.lint.oxlint.warn.forEach(w => args.push(\"-W\", w));\n\n if (!args.includes(\"-c\") && !args.includes(\"--config\")) {\n let configFile = getParentPath(\n this.config.lint.oxlint.configFile,\n this.config.projectRoot,\n {\n ignoreCase: true,\n skipCwd: false,\n includeNameInResults: true\n }\n );\n if (\n configFile &&\n !existsSync(configFile) &&\n this.config.lint.oxlint.configFile !== \".oxlintrc.json\"\n ) {\n configFile = getParentPath(\n \".oxlintrc.json\",\n this.config.projectRoot,\n {\n ignoreCase: true,\n skipCwd: false,\n includeNameInResults: true\n }\n );\n }\n\n if (configFile && existsSync(configFile)) {\n args.push(\"-c\", configFile);\n }\n }\n\n if (!args.includes(\"--type-aware\") && this.config.lint.oxlint.typeAware) {\n args.push(\"--type-aware\");\n }\n\n if (!args.includes(\"--tsconfig\")) {\n args.push(\"--tsconfig\", this.tsconfig.tsconfigFilePath);\n }\n\n if (!args.includes(\"-f\") && !args.includes(\"--format\")) {\n args.push(\"-f\", this.config.lint.oxlint.format || \"stylish\");\n }\n\n if (\n this.config.lint.oxlint.fix !== false &&\n !args.includes(\"--fix\") &&\n !args.includes(\"--fix-suggestions\") &&\n !args.includes(\"--fix-dangerously\")\n ) {\n if (this.config.lint.oxlint.fix === true) {\n args.push(\"--fix\");\n } else if (this.config.lint.oxlint.fix === \"suggestions\") {\n args.push(\"--fix-suggestions\");\n } else if (this.config.lint.oxlint.fix === \"dangerously\") {\n args.push(\"--fix-dangerously\");\n }\n }\n\n if (!this.config.lint.oxlint.oxlintPath) {\n const isOxlintListed = await isPackageListed(\n \"oxlint\",\n this.config.projectRoot\n );\n\n args.unshift(\n isOxlintListed\n ? replacePath(this.config.sourceRoot, this.config.projectRoot)\n : this.config.sourceRoot\n );\n\n const result = await executePackage(\n \"oxlint\",\n args,\n isOxlintListed\n ? joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.projectRoot\n )\n : this.workspaceConfig.workspaceRoot\n );\n if (result.failed) {\n throw new Error(\n `Oxlint process exited with code ${result.exitCode}.`\n );\n }\n } else {\n args.unshift(\n this.config.lint.oxlint.oxlintPath,\n this.config.sourceRoot\n );\n\n const result = await execute(\n args.join(\" \"),\n this.workspaceConfig.workspaceRoot\n );\n if (result.failed) {\n throw new Error(\n `Oxlint process exited with code ${result.exitCode}.`\n );\n }\n }\n }\n };\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;AAiCA,SAAgB,OACd,UAA+B,EAAE,EACJ;AAC7B,QAAO;EACL,MAAM;EACN,MAAM,SAAS;AACb,QAAK,MACH,8EACD;AAED,UAAO,EACL,MAAM,EACJ,QAAQ;IACN,YAAY;IACZ,MAAM,EAAE;IACR,OAAO,EA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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 { toArray } from \"@stryke/convert/to-array\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { getParentPath } from \"@stryke/fs/get-parent-path\";\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 { OxlintPluginContext, OxlintPluginOptions } 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: OxlintPluginOptions = {}\n): Plugin<OxlintPluginContext> {\n return {\n name: \"oxlint\",\n async config() {\n this.debug(\n \"Providing default configuration for the Powerlines `oxlint` linting plugin.\"\n );\n\n return {\n lint: {\n oxlint: {\n configFile: \".oxlintrc.json\",\n deny: [],\n allow: [],\n warn: [],\n typeAware: true,\n fix: true,\n format: \"stylish\",\n ...options\n }\n }\n };\n },\n configResolved() {\n this.devDependencies.oxlint = \"^1.24.0\";\n if (this.config.lint.oxlint.typeAware) {\n this.devDependencies[\"oxlint-tsgolint\"] = \"^0.2.1\";\n }\n },\n async lint() {\n this.debug(\"Linting project files with Oxlint.\");\n\n const args: string[] = [];\n\n if (this.config.lint.oxlint.params) {\n args.push(...this.config.lint.oxlint.params.split(\" \").filter(Boolean));\n }\n\n if (\n !args.includes(\"--ignore-pattern\") &&\n this.config.lint.oxlint.ignorePatterns\n ) {\n args.push(\n `--ignore-pattern=${toArray(this.config.lint.oxlint.ignorePatterns).join(\",\")}`\n );\n }\n\n this.config.lint.oxlint.deny.forEach(d => args.push(\"-D\", d));\n this.config.lint.oxlint.allow.forEach(a => args.push(\"-A\", a));\n this.config.lint.oxlint.warn.forEach(w => args.push(\"-W\", w));\n\n if (!args.includes(\"-c\") && !args.includes(\"--config\")) {\n let configFile = getParentPath(\n this.config.lint.oxlint.configFile,\n this.config.projectRoot,\n {\n ignoreCase: true,\n skipCwd: false,\n includeNameInResults: true\n }\n );\n if (\n configFile &&\n !existsSync(configFile) &&\n this.config.lint.oxlint.configFile !== \".oxlintrc.json\"\n ) {\n configFile = getParentPath(\n \".oxlintrc.json\",\n this.config.projectRoot,\n {\n ignoreCase: true,\n skipCwd: false,\n includeNameInResults: true\n }\n );\n }\n\n if (configFile && existsSync(configFile)) {\n args.push(\"-c\", configFile);\n }\n }\n\n if (!args.includes(\"--type-aware\") && this.config.lint.oxlint.typeAware) {\n args.push(\"--type-aware\");\n }\n\n if (!args.includes(\"--tsconfig\")) {\n args.push(\"--tsconfig\", this.tsconfig.tsconfigFilePath);\n }\n\n if (!args.includes(\"-f\") && !args.includes(\"--format\")) {\n args.push(\"-f\", this.config.lint.oxlint.format || \"stylish\");\n }\n\n if (\n this.config.lint.oxlint.fix !== false &&\n !args.includes(\"--fix\") &&\n !args.includes(\"--fix-suggestions\") &&\n !args.includes(\"--fix-dangerously\")\n ) {\n if (this.config.lint.oxlint.fix === true) {\n args.push(\"--fix\");\n } else if (this.config.lint.oxlint.fix === \"suggestions\") {\n args.push(\"--fix-suggestions\");\n } else if (this.config.lint.oxlint.fix === \"dangerously\") {\n args.push(\"--fix-dangerously\");\n }\n }\n\n if (!this.config.lint.oxlint.oxlintPath) {\n const isOxlintListed = await isPackageListed(\n \"oxlint\",\n this.config.projectRoot\n );\n\n args.unshift(\n isOxlintListed\n ? replacePath(this.config.sourceRoot, this.config.projectRoot)\n : this.config.sourceRoot\n );\n\n const result = await executePackage(\n \"oxlint\",\n args,\n isOxlintListed\n ? joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.projectRoot\n )\n : this.workspaceConfig.workspaceRoot\n );\n if (result.failed) {\n throw new Error(\n `Oxlint process exited with code ${result.exitCode}.`\n );\n }\n } else {\n args.unshift(\n this.config.lint.oxlint.oxlintPath,\n this.config.sourceRoot\n );\n\n const result = await execute(\n args.join(\" \"),\n this.workspaceConfig.workspaceRoot\n );\n if (result.failed) {\n throw new Error(\n `Oxlint process exited with code ${result.exitCode}.`\n );\n }\n }\n }\n };\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;AAiCA,SAAgB,OACd,UAA+B,EAAE,EACJ;AAC7B,QAAO;EACL,MAAM;EACN,MAAM,SAAS;AACb,QAAK,MACH,8EACD;AAED,UAAO,EACL,MAAM,EACJ,QAAQ;IACN,YAAY;IACZ,MAAM,EAAE;IACR,OAAO,EAAE;IACT,MAAM,EAAE;IACR,WAAW;IACX,KAAK;IACL,QAAQ;IACR,GAAG;IACJ,EACF,EACF;;EAEH,iBAAiB;AACf,QAAK,gBAAgB,SAAS;AAC9B,OAAI,KAAK,OAAO,KAAK,OAAO,UAC1B,MAAK,gBAAgB,qBAAqB;;EAG9C,MAAM,OAAO;AACX,QAAK,MAAM,qCAAqC;GAEhD,MAAMA,OAAiB,EAAE;AAEzB,OAAI,KAAK,OAAO,KAAK,OAAO,OAC1B,MAAK,KAAK,GAAG,KAAK,OAAO,KAAK,OAAO,OAAO,MAAM,IAAI,CAAC,OAAO,QAAQ,CAAC;AAGzE,OACE,CAAC,KAAK,SAAS,mBAAmB,IAClC,KAAK,OAAO,KAAK,OAAO,eAExB,MAAK,KACH,oBAAoB,QAAQ,KAAK,OAAO,KAAK,OAAO,eAAe,CAAC,KAAK,IAAI,GAC9E;AAGH,QAAK,OAAO,KAAK,OAAO,KAAK,SAAQ,MAAK,KAAK,KAAK,MAAM,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OAAI,CAAC,KAAK,OAAO,KAAK,OAAO,YAAY;IACvC,MAAM,iBAAiB,MAAM,gBAC3B,UACA,KAAK,OAAO,YACb;AAED,SAAK,QACH,iBACI,YAAY,KAAK,OAAO,YAAY,KAAK,OAAO,YAAY,GAC5D,KAAK,OAAO,WACjB;IAED,MAAM,SAAS,MAAM,eACnB,UACA,MACA,iBACI,UACE,KAAK,gBAAgB,eACrB,KAAK,OAAO,YACb,GACD,KAAK,gBAAgB,cAC1B;AACD,QAAI,OAAO,OACT,OAAM,IAAI,MACR,mCAAmC,OAAO,SAAS,GACpD;UAEE;AACL,SAAK,QACH,KAAK,OAAO,KAAK,OAAO,YACxB,KAAK,OAAO,WACb;IAED,MAAM,SAAS,MAAM,QACnB,KAAK,KAAK,IAAI,EACd,KAAK,gBAAgB,cACtB;AACD,QAAI,OAAO,OACT,OAAM,IAAI,MACR,mCAAmC,OAAO,SAAS,GACpD;;;EAIR;;AAGH,kBAAe"}
@@ -1,2 +0,0 @@
1
- require('../plugin-DHXHjv16.cjs');
2
- require('../types-DHkg7xmX.cjs');
@@ -1,3 +1,2 @@
1
- import { a as __ΩOxlintPluginContext, c as __ΩOxlintPluginUserConfig, i as OxlintPluginUserConfig, n as OxlintPluginOptions, o as __ΩOxlintPluginOptions, r as OxlintPluginResolvedConfig, s as __ΩOxlintPluginResolvedConfig, t as OxlintPluginContext } from "../plugin-n-BO5XLy.cjs";
2
- import "../index-D6CnpA_r.cjs";
1
+ import { OxlintPluginContext, OxlintPluginOptions, OxlintPluginResolvedConfig, OxlintPluginUserConfig, __ΩOxlintPluginContext, __ΩOxlintPluginOptions, __ΩOxlintPluginResolvedConfig, __ΩOxlintPluginUserConfig } from "./plugin.cjs";
3
2
  export { OxlintPluginContext, OxlintPluginOptions, OxlintPluginResolvedConfig, OxlintPluginUserConfig, __ΩOxlintPluginContext, __ΩOxlintPluginOptions, __ΩOxlintPluginResolvedConfig, __ΩOxlintPluginUserConfig };
@@ -1,3 +1,2 @@
1
- import { a as __ΩOxlintPluginContext, c as __ΩOxlintPluginUserConfig, i as OxlintPluginUserConfig, n as OxlintPluginOptions, o as __ΩOxlintPluginOptions, r as OxlintPluginResolvedConfig, s as __ΩOxlintPluginResolvedConfig, t as OxlintPluginContext } from "../plugin-BsPGUUSA.mjs";
2
- import "../index-D-CYNcT9.mjs";
1
+ import { OxlintPluginContext, OxlintPluginOptions, OxlintPluginResolvedConfig, OxlintPluginUserConfig, __ΩOxlintPluginContext, __ΩOxlintPluginOptions, __ΩOxlintPluginResolvedConfig, __ΩOxlintPluginUserConfig } from "./plugin.mjs";
3
2
  export { OxlintPluginContext, OxlintPluginOptions, OxlintPluginResolvedConfig, OxlintPluginUserConfig, __ΩOxlintPluginContext, __ΩOxlintPluginOptions, __ΩOxlintPluginResolvedConfig, __ΩOxlintPluginUserConfig };
@@ -1,4 +1 @@
1
- import "../plugin-DNsqegEV.mjs";
2
- import "../types-CpP_DWx6.mjs";
3
-
4
1
  export { };
@@ -1 +0,0 @@
1
- require('../plugin-DHXHjv16.cjs');
@@ -1,2 +1,84 @@
1
- import { a as __ΩOxlintPluginContext, c as __ΩOxlintPluginUserConfig, i as OxlintPluginUserConfig, n as OxlintPluginOptions, o as __ΩOxlintPluginOptions, r as OxlintPluginResolvedConfig, s as __ΩOxlintPluginResolvedConfig, t as OxlintPluginContext } from "../plugin-n-BO5XLy.cjs";
2
- export { OxlintPluginContext, OxlintPluginOptions, OxlintPluginResolvedConfig, OxlintPluginUserConfig, __ΩOxlintPluginContext, __ΩOxlintPluginOptions, __ΩOxlintPluginResolvedConfig, __ΩOxlintPluginUserConfig };
1
+ import { UserConfig } from "powerlines/types/config";
2
+ import { PluginContext } from "powerlines/types/context";
3
+ import { ResolvedConfig } from "powerlines/types/resolved";
4
+
5
+ //#region src/types/plugin.d.ts
6
+ interface OxlintPluginOptions {
7
+ /**
8
+ * A glob pattern or path to ignore files and directories.
9
+ */
10
+ ignorePatterns?: string | string[];
11
+ /**
12
+ * The path to the Oxlint configuration file.
13
+ *
14
+ * @defaultValue ".oxlintrc.json"
15
+ */
16
+ configFile?: string;
17
+ /**
18
+ * An array of rules to deny
19
+ */
20
+ deny?: string[];
21
+ /**
22
+ * An array of rules to allow
23
+ */
24
+ allow?: string[];
25
+ /**
26
+ * An array of rules to warn about
27
+ */
28
+ warn?: string[];
29
+ /**
30
+ * Additional parameters to pass to the Oxlint CLI
31
+ */
32
+ params?: string;
33
+ /**
34
+ * The path to the Oxlint binary
35
+ */
36
+ oxlintPath?: string;
37
+ /**
38
+ * Whether to enable [type-aware linting](https://oxc.rs/docs/guide/usage/linter/type-aware.html)
39
+ *
40
+ * @defaultValue true
41
+ */
42
+ typeAware?: boolean;
43
+ /**
44
+ * Whether to automatically fix fixable issues.
45
+ *
46
+ * - `true` - Automatically fix fixable issues.
47
+ * - `false` - Do not fix any issues.
48
+ * - `"suggestions"` - Only apply fixes that are considered suggestions.
49
+ * - `"dangerously"` - Apply all fixes, including those that may change code behavior.
50
+ *
51
+ * @defaultValue true
52
+ */
53
+ fix?: boolean | "suggestions" | "dangerously";
54
+ /**
55
+ * The output format for linting results.
56
+ *
57
+ * @defaultValue "stylish"
58
+ */
59
+ format?: "stylish" | "checkstyle" | "github" | "gitlab" | "json" | "junit" | "unix";
60
+ }
61
+ interface OxlintPluginUserConfig extends UserConfig {
62
+ /**
63
+ * Options for the Oxlint plugin.
64
+ */
65
+ lint?: {
66
+ oxlint?: OxlintPluginOptions;
67
+ };
68
+ }
69
+ interface OxlintPluginResolvedConfig extends ResolvedConfig {
70
+ /**
71
+ * Options for the Oxlint plugin.
72
+ */
73
+ lint: {
74
+ oxlint: Omit<OxlintPluginOptions, "configFile" | "deny" | "allow" | "warn" | "typeAware" | "fix" | "format"> & Required<Pick<OxlintPluginOptions, "configFile" | "deny" | "allow" | "warn" | "typeAware" | "fix" | "format">>;
75
+ };
76
+ }
77
+ type OxlintPluginContext<TResolvedConfig extends OxlintPluginResolvedConfig = OxlintPluginResolvedConfig> = PluginContext<TResolvedConfig>;
78
+ declare type __ΩOxlintPluginOptions = any[];
79
+ declare type __ΩOxlintPluginUserConfig = any[];
80
+ declare type __ΩOxlintPluginResolvedConfig = any[];
81
+ declare type __ΩOxlintPluginContext = any[];
82
+ //#endregion
83
+ export { OxlintPluginContext, OxlintPluginOptions, OxlintPluginResolvedConfig, OxlintPluginUserConfig, __ΩOxlintPluginContext, __ΩOxlintPluginOptions, __ΩOxlintPluginResolvedConfig, __ΩOxlintPluginUserConfig };
84
+ //# sourceMappingURL=plugin.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;UAsBiB,mBAAA;;AAAjB;AAwEA;EASiB,cAAA,CAAA,EAAA,MAAA,GAAA,MAA2B,EAAA;EAMtC;;;;;EAN8C,UAAA,CAAA,EAAA,MAAA;EAAc;AAwBlE;;EAEI,IAAA,CAAA,EAAA,MAAA,EAAA;EACc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UApCD,sBAAA,SAA+B;;;;;aAKnC;;;UAII,0BAAA,SAAmC;;;;;YAKxC,KACN,kGAGA,SACE,KACE;;;KAaE,4CACc,6BACtB,8BACA,cAAc"}
@@ -1,2 +1,84 @@
1
- import { a as __ΩOxlintPluginContext, c as __ΩOxlintPluginUserConfig, i as OxlintPluginUserConfig, n as OxlintPluginOptions, o as __ΩOxlintPluginOptions, r as OxlintPluginResolvedConfig, s as __ΩOxlintPluginResolvedConfig, t as OxlintPluginContext } from "../plugin-BsPGUUSA.mjs";
2
- export { OxlintPluginContext, OxlintPluginOptions, OxlintPluginResolvedConfig, OxlintPluginUserConfig, __ΩOxlintPluginContext, __ΩOxlintPluginOptions, __ΩOxlintPluginResolvedConfig, __ΩOxlintPluginUserConfig };
1
+ import { UserConfig } from "powerlines/types/config";
2
+ import { PluginContext } from "powerlines/types/context";
3
+ import { ResolvedConfig } from "powerlines/types/resolved";
4
+
5
+ //#region src/types/plugin.d.ts
6
+ interface OxlintPluginOptions {
7
+ /**
8
+ * A glob pattern or path to ignore files and directories.
9
+ */
10
+ ignorePatterns?: string | string[];
11
+ /**
12
+ * The path to the Oxlint configuration file.
13
+ *
14
+ * @defaultValue ".oxlintrc.json"
15
+ */
16
+ configFile?: string;
17
+ /**
18
+ * An array of rules to deny
19
+ */
20
+ deny?: string[];
21
+ /**
22
+ * An array of rules to allow
23
+ */
24
+ allow?: string[];
25
+ /**
26
+ * An array of rules to warn about
27
+ */
28
+ warn?: string[];
29
+ /**
30
+ * Additional parameters to pass to the Oxlint CLI
31
+ */
32
+ params?: string;
33
+ /**
34
+ * The path to the Oxlint binary
35
+ */
36
+ oxlintPath?: string;
37
+ /**
38
+ * Whether to enable [type-aware linting](https://oxc.rs/docs/guide/usage/linter/type-aware.html)
39
+ *
40
+ * @defaultValue true
41
+ */
42
+ typeAware?: boolean;
43
+ /**
44
+ * Whether to automatically fix fixable issues.
45
+ *
46
+ * - `true` - Automatically fix fixable issues.
47
+ * - `false` - Do not fix any issues.
48
+ * - `"suggestions"` - Only apply fixes that are considered suggestions.
49
+ * - `"dangerously"` - Apply all fixes, including those that may change code behavior.
50
+ *
51
+ * @defaultValue true
52
+ */
53
+ fix?: boolean | "suggestions" | "dangerously";
54
+ /**
55
+ * The output format for linting results.
56
+ *
57
+ * @defaultValue "stylish"
58
+ */
59
+ format?: "stylish" | "checkstyle" | "github" | "gitlab" | "json" | "junit" | "unix";
60
+ }
61
+ interface OxlintPluginUserConfig extends UserConfig {
62
+ /**
63
+ * Options for the Oxlint plugin.
64
+ */
65
+ lint?: {
66
+ oxlint?: OxlintPluginOptions;
67
+ };
68
+ }
69
+ interface OxlintPluginResolvedConfig extends ResolvedConfig {
70
+ /**
71
+ * Options for the Oxlint plugin.
72
+ */
73
+ lint: {
74
+ oxlint: Omit<OxlintPluginOptions, "configFile" | "deny" | "allow" | "warn" | "typeAware" | "fix" | "format"> & Required<Pick<OxlintPluginOptions, "configFile" | "deny" | "allow" | "warn" | "typeAware" | "fix" | "format">>;
75
+ };
76
+ }
77
+ type OxlintPluginContext<TResolvedConfig extends OxlintPluginResolvedConfig = OxlintPluginResolvedConfig> = PluginContext<TResolvedConfig>;
78
+ declare type __ΩOxlintPluginOptions = any[];
79
+ declare type __ΩOxlintPluginUserConfig = any[];
80
+ declare type __ΩOxlintPluginResolvedConfig = any[];
81
+ declare type __ΩOxlintPluginContext = any[];
82
+ //#endregion
83
+ export { OxlintPluginContext, OxlintPluginOptions, OxlintPluginResolvedConfig, OxlintPluginUserConfig, __ΩOxlintPluginContext, __ΩOxlintPluginOptions, __ΩOxlintPluginResolvedConfig, __ΩOxlintPluginUserConfig };
84
+ //# sourceMappingURL=plugin.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;UAsBiB,mBAAA;;AAAjB;AAwEA;EASiB,cAAA,CAAA,EAAA,MAAA,GAAA,MAA2B,EAAA;EAMtC;;;;;EAN8C,UAAA,CAAA,EAAA,MAAA;EAAc;AAwBlE;;EAEI,IAAA,CAAA,EAAA,MAAA,EAAA;EACc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UApCD,sBAAA,SAA+B;;;;;aAKnC;;;UAII,0BAAA,SAAmC;;;;;YAKxC,KACN,kGAGA,SACE,KACE;;;KAaE,4CACc,6BACtB,8BACA,cAAc"}
@@ -1,3 +1 @@
1
- import "../plugin-DNsqegEV.mjs";
2
-
3
1
  export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-oxlint",
3
- "version": "0.7.257",
3
+ "version": "0.7.258",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin for running Oxlint on the codebase.",
6
6
  "repository": {
@@ -122,15 +122,15 @@
122
122
  "defu": "^6.1.4",
123
123
  "oxlint": "^1.42.0",
124
124
  "oxlint-tsgolint": "^0.2.1",
125
- "powerlines": "^0.38.20"
125
+ "powerlines": "^0.38.21"
126
126
  },
127
127
  "devDependencies": {
128
- "@powerlines/plugin-plugin": "^0.12.204",
128
+ "@powerlines/plugin-plugin": "^0.12.205",
129
129
  "@types/node": "^24.10.9"
130
130
  },
131
131
  "publishConfig": { "access": "public" },
132
132
  "main": "./dist/index.cjs",
133
133
  "module": "./dist/index.mjs",
134
134
  "types": "./dist/index.d.cts",
135
- "gitHead": "54a89805dd69f77013ebbd3282232563d7af4e7b"
135
+ "gitHead": "6000a15bf3fbc1b7eaaf967088c68eef9949786a"
136
136
  }
@@ -1,59 +0,0 @@
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 `{
12
- "$schema": "./node_modules/oxlint/configuration_schema.json",
13
- "plugins": [
14
- "import",
15
- "jsdoc",
16
- "unicorn",
17
- "typescript",
18
- "oxc"
19
- ],
20
- "ignorePatterns": [
21
- "crates/**",
22
- "dist/**",
23
- "build/**",
24
- "coverage/**",
25
- "node_modules/**",
26
- "temp/**",
27
- "tests/fixtures/**"${options.ignorePatterns ? `,
28
- ${toArray(options.ignorePatterns).map((pattern) => `"${pattern}"`).join(",\n ")}` : ""}
29
- ],
30
- "rules": {
31
- "import/named": "error",
32
- "import/namespace": [
33
- "error",
34
- {
35
- "allowComputed": true
36
- }
37
- ],
38
- "no-unused-expressions": [
39
- "warn",
40
- {
41
- "allowShortCircuit": true,
42
- "allowTaggedTemplates": true
43
- }
44
- ],
45
- "no-unused-vars": [
46
- "warn",
47
- {
48
- "varsIgnorePattern": "^_",
49
- "argsIgnorePattern": "^_"
50
- }
51
- ],
52
- "unicorn/prefer-node-protocol": "error"
53
- }
54
- }`;
55
- }
56
-
57
- //#endregion
58
- export { generateConfig as t };
59
- //# sourceMappingURL=generate-config-BJgmb4Je.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate-config-BJgmb4Je.mjs","names":[],"sources":["../src/helpers/generate-config.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 { toArray } from \"@stryke/convert/neutral\";\nimport { OxlintPluginOptions } from \"../types/plugin\";\n\n/**\n * Generates an Oxlint configuration file content based on the provided options.\n *\n * @param options - The options for the Oxlint plugin.\n * @returns The generated configuration as a string.\n */\nexport function generateConfig(options: OxlintPluginOptions = {}): string {\n return `{\n \"$schema\": \"./node_modules/oxlint/configuration_schema.json\",\n \"plugins\": [\n \"import\",\n \"jsdoc\",\n \"unicorn\",\n \"typescript\",\n \"oxc\"\n ],\n \"ignorePatterns\": [\n \"crates/**\",\n \"dist/**\",\n \"build/**\",\n \"coverage/**\",\n \"node_modules/**\",\n \"temp/**\",\n \"tests/fixtures/**\"${\n options.ignorePatterns\n ? `,\n ${toArray(options.ignorePatterns)\n .map(pattern => `\"${pattern}\"`)\n .join(\",\\n \")}`\n : \"\"\n }\n ],\n \"rules\": {\n \"import/named\": \"error\",\n \"import/namespace\": [\n \"error\",\n {\n \"allowComputed\": true\n }\n ],\n \"no-unused-expressions\": [\n \"warn\",\n {\n \"allowShortCircuit\": true,\n \"allowTaggedTemplates\": true\n }\n ],\n \"no-unused-vars\": [\n \"warn\",\n {\n \"varsIgnorePattern\": \"^_\",\n \"argsIgnorePattern\": \"^_\"\n }\n ],\n \"unicorn/prefer-node-protocol\": \"error\"\n }\n}`;\n}\n"],"mappings":";;;;;;;;;AA2BA,SAAgB,eAAe,UAA+B,EAAE,EAAU;AACxE,QAAO;;;;;;;;;;;;;;;;yBAiBH,QAAQ,iBACJ;MACJ,QAAQ,QAAQ,eAAe,CAC9B,KAAI,YAAW,IAAI,QAAQ,GAAG,CAC9B,KAAK,UAAU,KACZ,GACL"}
@@ -1,14 +0,0 @@
1
- import { n as OxlintPluginOptions } from "./plugin-n-BO5XLy.cjs";
2
-
3
- //#region src/helpers/generate-config.d.ts
4
-
5
- /**
6
- * Generates an Oxlint configuration file content based on the provided options.
7
- *
8
- * @param options - The options for the Oxlint plugin.
9
- * @returns The generated configuration as a string.
10
- */
11
- declare function generateConfig(options?: OxlintPluginOptions): string;
12
- //#endregion
13
- export { generateConfig as t };
14
- //# sourceMappingURL=generate-config-BKQYOLby.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate-config-BKQYOLby.d.cts","names":[],"sources":["../src/helpers/generate-config.ts"],"sourcesContent":[],"mappings":";;;;;;AA2BA;;;;iBAAgB,cAAA,WAAwB"}
@@ -1,63 +0,0 @@
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 `{
12
- "$schema": "./node_modules/oxlint/configuration_schema.json",
13
- "plugins": [
14
- "import",
15
- "jsdoc",
16
- "unicorn",
17
- "typescript",
18
- "oxc"
19
- ],
20
- "ignorePatterns": [
21
- "crates/**",
22
- "dist/**",
23
- "build/**",
24
- "coverage/**",
25
- "node_modules/**",
26
- "temp/**",
27
- "tests/fixtures/**"${options.ignorePatterns ? `,
28
- ${(0, __stryke_convert_neutral.toArray)(options.ignorePatterns).map((pattern) => `"${pattern}"`).join(",\n ")}` : ""}
29
- ],
30
- "rules": {
31
- "import/named": "error",
32
- "import/namespace": [
33
- "error",
34
- {
35
- "allowComputed": true
36
- }
37
- ],
38
- "no-unused-expressions": [
39
- "warn",
40
- {
41
- "allowShortCircuit": true,
42
- "allowTaggedTemplates": true
43
- }
44
- ],
45
- "no-unused-vars": [
46
- "warn",
47
- {
48
- "varsIgnorePattern": "^_",
49
- "argsIgnorePattern": "^_"
50
- }
51
- ],
52
- "unicorn/prefer-node-protocol": "error"
53
- }
54
- }`;
55
- }
56
-
57
- //#endregion
58
- Object.defineProperty(exports, 'generateConfig', {
59
- enumerable: true,
60
- get: function () {
61
- return generateConfig;
62
- }
63
- });
@@ -1,14 +0,0 @@
1
- import { n as OxlintPluginOptions } from "./plugin-BsPGUUSA.mjs";
2
-
3
- //#region src/helpers/generate-config.d.ts
4
-
5
- /**
6
- * Generates an Oxlint configuration file content based on the provided options.
7
- *
8
- * @param options - The options for the Oxlint plugin.
9
- * @returns The generated configuration as a string.
10
- */
11
- declare function generateConfig(options?: OxlintPluginOptions): string;
12
- //#endregion
13
- export { generateConfig as t };
14
- //# sourceMappingURL=generate-config-CtqHlwuj.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate-config-CtqHlwuj.d.mts","names":[],"sources":["../src/helpers/generate-config.ts"],"sourcesContent":[],"mappings":";;;;;;AA2BA;;;;iBAAgB,cAAA,WAAwB"}
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1,84 +0,0 @@
1
- import { UserConfig } from "powerlines/types/config";
2
- import { PluginContext } from "powerlines/types/context";
3
- import { ResolvedConfig } from "powerlines/types/resolved";
4
-
5
- //#region src/types/plugin.d.ts
6
- interface OxlintPluginOptions {
7
- /**
8
- * A glob pattern or path to ignore files and directories.
9
- */
10
- ignorePatterns?: string | string[];
11
- /**
12
- * The path to the Oxlint configuration file.
13
- *
14
- * @defaultValue ".oxlintrc.json"
15
- */
16
- configFile?: string;
17
- /**
18
- * An array of rules to deny
19
- */
20
- deny?: string[];
21
- /**
22
- * An array of rules to allow
23
- */
24
- allow?: string[];
25
- /**
26
- * An array of rules to warn about
27
- */
28
- warn?: string[];
29
- /**
30
- * Additional parameters to pass to the Oxlint CLI
31
- */
32
- params?: string;
33
- /**
34
- * The path to the Oxlint binary
35
- */
36
- oxlintPath?: string;
37
- /**
38
- * Whether to enable [type-aware linting](https://oxc.rs/docs/guide/usage/linter/type-aware.html)
39
- *
40
- * @defaultValue true
41
- */
42
- typeAware?: boolean;
43
- /**
44
- * Whether to automatically fix fixable issues.
45
- *
46
- * - `true` - Automatically fix fixable issues.
47
- * - `false` - Do not fix any issues.
48
- * - `"suggestions"` - Only apply fixes that are considered suggestions.
49
- * - `"dangerously"` - Apply all fixes, including those that may change code behavior.
50
- *
51
- * @defaultValue true
52
- */
53
- fix?: boolean | "suggestions" | "dangerously";
54
- /**
55
- * The output format for linting results.
56
- *
57
- * @defaultValue "stylish"
58
- */
59
- format?: "stylish" | "checkstyle" | "github" | "gitlab" | "json" | "junit" | "unix";
60
- }
61
- interface OxlintPluginUserConfig extends UserConfig {
62
- /**
63
- * Options for the Oxlint plugin.
64
- */
65
- lint?: {
66
- oxlint?: OxlintPluginOptions;
67
- };
68
- }
69
- interface OxlintPluginResolvedConfig extends ResolvedConfig {
70
- /**
71
- * Options for the Oxlint plugin.
72
- */
73
- lint: {
74
- oxlint: Omit<OxlintPluginOptions, "configFile" | "deny" | "allow" | "warn" | "typeAware" | "fix" | "format"> & Required<Pick<OxlintPluginOptions, "configFile" | "deny" | "allow" | "warn" | "typeAware" | "fix" | "format">>;
75
- };
76
- }
77
- type OxlintPluginContext<TResolvedConfig extends OxlintPluginResolvedConfig = OxlintPluginResolvedConfig> = PluginContext<TResolvedConfig>;
78
- declare type __ΩOxlintPluginOptions = any[];
79
- declare type __ΩOxlintPluginUserConfig = any[];
80
- declare type __ΩOxlintPluginResolvedConfig = any[];
81
- declare type __ΩOxlintPluginContext = any[];
82
- //#endregion
83
- export { __ΩOxlintPluginContext as a, __ΩOxlintPluginUserConfig as c, OxlintPluginUserConfig as i, OxlintPluginOptions as n, __ΩOxlintPluginOptions as o, OxlintPluginResolvedConfig as r, __ΩOxlintPluginResolvedConfig as s, OxlintPluginContext as t };
84
- //# sourceMappingURL=plugin-BsPGUUSA.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-BsPGUUSA.d.mts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;UAsBiB,mBAAA;;AAAjB;AAwEA;EASiB,cAAA,CAAA,EAAA,MAAA,GAAA,MAA2B,EAAA;EAMtC;;;;;EAN8C,UAAA,CAAA,EAAA,MAAA;EAAc;AAwBlE;;EAEI,IAAA,CAAA,EAAA,MAAA,EAAA;EACc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UApCD,sBAAA,SAA+B;;;;;aAKnC;;;UAII,0BAAA,SAAmC;;;;;YAKxC,KACN,kGAGA,SACE,KACE;;;KAaE,4CACc,6BACtB,8BACA,cAAc"}
File without changes
@@ -1 +0,0 @@
1
- export { };
@@ -1,84 +0,0 @@
1
- import { UserConfig } from "powerlines/types/config";
2
- import { PluginContext } from "powerlines/types/context";
3
- import { ResolvedConfig } from "powerlines/types/resolved";
4
-
5
- //#region src/types/plugin.d.ts
6
- interface OxlintPluginOptions {
7
- /**
8
- * A glob pattern or path to ignore files and directories.
9
- */
10
- ignorePatterns?: string | string[];
11
- /**
12
- * The path to the Oxlint configuration file.
13
- *
14
- * @defaultValue ".oxlintrc.json"
15
- */
16
- configFile?: string;
17
- /**
18
- * An array of rules to deny
19
- */
20
- deny?: string[];
21
- /**
22
- * An array of rules to allow
23
- */
24
- allow?: string[];
25
- /**
26
- * An array of rules to warn about
27
- */
28
- warn?: string[];
29
- /**
30
- * Additional parameters to pass to the Oxlint CLI
31
- */
32
- params?: string;
33
- /**
34
- * The path to the Oxlint binary
35
- */
36
- oxlintPath?: string;
37
- /**
38
- * Whether to enable [type-aware linting](https://oxc.rs/docs/guide/usage/linter/type-aware.html)
39
- *
40
- * @defaultValue true
41
- */
42
- typeAware?: boolean;
43
- /**
44
- * Whether to automatically fix fixable issues.
45
- *
46
- * - `true` - Automatically fix fixable issues.
47
- * - `false` - Do not fix any issues.
48
- * - `"suggestions"` - Only apply fixes that are considered suggestions.
49
- * - `"dangerously"` - Apply all fixes, including those that may change code behavior.
50
- *
51
- * @defaultValue true
52
- */
53
- fix?: boolean | "suggestions" | "dangerously";
54
- /**
55
- * The output format for linting results.
56
- *
57
- * @defaultValue "stylish"
58
- */
59
- format?: "stylish" | "checkstyle" | "github" | "gitlab" | "json" | "junit" | "unix";
60
- }
61
- interface OxlintPluginUserConfig extends UserConfig {
62
- /**
63
- * Options for the Oxlint plugin.
64
- */
65
- lint?: {
66
- oxlint?: OxlintPluginOptions;
67
- };
68
- }
69
- interface OxlintPluginResolvedConfig extends ResolvedConfig {
70
- /**
71
- * Options for the Oxlint plugin.
72
- */
73
- lint: {
74
- oxlint: Omit<OxlintPluginOptions, "configFile" | "deny" | "allow" | "warn" | "typeAware" | "fix" | "format"> & Required<Pick<OxlintPluginOptions, "configFile" | "deny" | "allow" | "warn" | "typeAware" | "fix" | "format">>;
75
- };
76
- }
77
- type OxlintPluginContext<TResolvedConfig extends OxlintPluginResolvedConfig = OxlintPluginResolvedConfig> = PluginContext<TResolvedConfig>;
78
- declare type __ΩOxlintPluginOptions = any[];
79
- declare type __ΩOxlintPluginUserConfig = any[];
80
- declare type __ΩOxlintPluginResolvedConfig = any[];
81
- declare type __ΩOxlintPluginContext = any[];
82
- //#endregion
83
- export { __ΩOxlintPluginContext as a, __ΩOxlintPluginUserConfig as c, OxlintPluginUserConfig as i, OxlintPluginOptions as n, __ΩOxlintPluginOptions as o, OxlintPluginResolvedConfig as r, __ΩOxlintPluginResolvedConfig as s, OxlintPluginContext as t };
84
- //# sourceMappingURL=plugin-n-BO5XLy.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-n-BO5XLy.d.cts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;UAsBiB,mBAAA;;AAAjB;AAwEA;EASiB,cAAA,CAAA,EAAA,MAAA,GAAA,MAA2B,EAAA;EAMtC;;;;;EAN8C,UAAA,CAAA,EAAA,MAAA;EAAc;AAwBlE;;EAEI,IAAA,CAAA,EAAA,MAAA,EAAA;EACc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UApCD,sBAAA,SAA+B;;;;;aAKnC;;;UAII,0BAAA,SAAmC;;;;;YAKxC,KACN,kGAGA,SACE,KACE;;;KAaE,4CACc,6BACtB,8BACA,cAAc"}
@@ -1 +0,0 @@
1
- export { };
File without changes