@code-pushup/eslint-plugin 0.49.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin.js CHANGED
@@ -670,6 +670,8 @@ var auditResultSchema = scorableWithPluginMetaSchema.merge(
670
670
  );
671
671
  var reportsDiffSchema = z15.object({
672
672
  commits: makeComparisonSchema(commitSchema).nullable().describe("Commits identifying compared reports"),
673
+ portalUrl: urlSchema.optional().describe("Link to comparison page in Code PushUp portal"),
674
+ label: z15.string().optional().describe("Label (e.g. project name)"),
673
675
  categories: makeArraysComparisonSchema(
674
676
  categoryDiffSchema,
675
677
  categoryResultSchema,
@@ -698,7 +700,9 @@ var reportsDiffSchema = z15.object({
698
700
  );
699
701
 
700
702
  // packages/utils/src/lib/execute-process.ts
701
- import { spawn } from "node:child_process";
703
+ import {
704
+ spawn
705
+ } from "node:child_process";
702
706
 
703
707
  // packages/utils/src/lib/reports/utils.ts
704
708
  import ansis from "ansis";
@@ -733,25 +737,29 @@ var ProcessError = class extends Error {
733
737
  }
734
738
  };
735
739
  function executeProcess(cfg) {
736
- const { observer, cwd, command, args, ignoreExitCode = false } = cfg;
737
- const { onStdout, onError, onComplete } = observer ?? {};
740
+ const { command, args, observer, ignoreExitCode = false, ...options } = cfg;
741
+ const { onStdout, onStderr, onError, onComplete } = observer ?? {};
738
742
  const date = (/* @__PURE__ */ new Date()).toISOString();
739
743
  const start = performance.now();
740
744
  return new Promise((resolve, reject) => {
741
- const process2 = spawn(command, args, { cwd, shell: true });
745
+ const spawnedProcess = spawn(command, args ?? [], {
746
+ shell: true,
747
+ ...options
748
+ });
742
749
  let stdout = "";
743
750
  let stderr = "";
744
- process2.stdout.on("data", (data) => {
751
+ spawnedProcess.stdout.on("data", (data) => {
745
752
  stdout += String(data);
746
- onStdout?.(String(data));
753
+ onStdout?.(String(data), spawnedProcess);
747
754
  });
748
- process2.stderr.on("data", (data) => {
755
+ spawnedProcess.stderr.on("data", (data) => {
749
756
  stderr += String(data);
757
+ onStderr?.(String(data), spawnedProcess);
750
758
  });
751
- process2.on("error", (err) => {
759
+ spawnedProcess.on("error", (err) => {
752
760
  stderr += err.toString();
753
761
  });
754
- process2.on("close", (code2) => {
762
+ spawnedProcess.on("close", (code2) => {
755
763
  const timings = { date, duration: calcDuration(start) };
756
764
  if (code2 === 0 || ignoreExitCode) {
757
765
  onComplete?.();
@@ -902,17 +910,23 @@ import { MultiProgressBars } from "multi-progress-bars";
902
910
  import { MarkdownDocument as MarkdownDocument3, md as md4 } from "build-md";
903
911
 
904
912
  // packages/utils/src/lib/reports/formatting.ts
905
- import { MarkdownDocument, md as md2 } from "build-md";
913
+ import {
914
+ MarkdownDocument,
915
+ md as md2
916
+ } from "build-md";
906
917
 
907
918
  // packages/utils/src/lib/reports/generate-md-report-categoy-section.ts
908
919
  import { MarkdownDocument as MarkdownDocument2, md as md3 } from "build-md";
909
920
 
910
921
  // packages/utils/src/lib/reports/generate-md-reports-diff.ts
911
922
  import {
912
- MarkdownDocument as MarkdownDocument4,
913
- md as md5
923
+ MarkdownDocument as MarkdownDocument5,
924
+ md as md6
914
925
  } from "build-md";
915
926
 
927
+ // packages/utils/src/lib/reports/generate-md-reports-diff-utils.ts
928
+ import { MarkdownDocument as MarkdownDocument4, md as md5 } from "build-md";
929
+
916
930
  // packages/utils/src/lib/reports/log-stdout-summary.ts
917
931
  import { bold as bold4, cyan, cyanBright, green as green2, red } from "ansis";
918
932
 
package/index.js CHANGED
@@ -4,7 +4,7 @@ import { fileURLToPath } from "node:url";
4
4
 
5
5
  // packages/plugin-eslint/package.json
6
6
  var name = "@code-pushup/eslint-plugin";
7
- var version = "0.49.0";
7
+ var version = "0.50.0";
8
8
 
9
9
  // packages/plugin-eslint/src/lib/config.ts
10
10
  import { z as z16 } from "zod";
@@ -677,6 +677,8 @@ var auditResultSchema = scorableWithPluginMetaSchema.merge(
677
677
  );
678
678
  var reportsDiffSchema = z15.object({
679
679
  commits: makeComparisonSchema(commitSchema).nullable().describe("Commits identifying compared reports"),
680
+ portalUrl: urlSchema.optional().describe("Link to comparison page in Code PushUp portal"),
681
+ label: z15.string().optional().describe("Label (e.g. project name)"),
680
682
  categories: makeArraysComparisonSchema(
681
683
  categoryDiffSchema,
682
684
  categoryResultSchema,
@@ -830,17 +832,23 @@ import { MultiProgressBars } from "multi-progress-bars";
830
832
  import { MarkdownDocument as MarkdownDocument3, md as md4 } from "build-md";
831
833
 
832
834
  // packages/utils/src/lib/reports/formatting.ts
833
- import { MarkdownDocument, md as md2 } from "build-md";
835
+ import {
836
+ MarkdownDocument,
837
+ md as md2
838
+ } from "build-md";
834
839
 
835
840
  // packages/utils/src/lib/reports/generate-md-report-categoy-section.ts
836
841
  import { MarkdownDocument as MarkdownDocument2, md as md3 } from "build-md";
837
842
 
838
843
  // packages/utils/src/lib/reports/generate-md-reports-diff.ts
839
844
  import {
840
- MarkdownDocument as MarkdownDocument4,
841
- md as md5
845
+ MarkdownDocument as MarkdownDocument5,
846
+ md as md6
842
847
  } from "build-md";
843
848
 
849
+ // packages/utils/src/lib/reports/generate-md-reports-diff-utils.ts
850
+ import { MarkdownDocument as MarkdownDocument4, md as md5 } from "build-md";
851
+
844
852
  // packages/utils/src/lib/reports/log-stdout-summary.ts
845
853
  import { bold as bold4, cyan, cyanBright, green as green2, red } from "ansis";
846
854
 
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@code-pushup/eslint-plugin",
3
- "version": "0.49.0",
3
+ "version": "0.50.0",
4
4
  "license": "MIT",
5
+ "description": "Code PushUp plugin for detecting problems in source code using ESLint.📋",
5
6
  "dependencies": {
6
- "@code-pushup/utils": "0.49.0",
7
- "@code-pushup/models": "0.49.0",
7
+ "@code-pushup/utils": "0.50.0",
8
+ "@code-pushup/models": "0.50.0",
8
9
  "eslint": "^8.46.0",
9
10
  "zod": "^3.22.4"
10
11
  },
@@ -16,7 +17,7 @@
16
17
  "optional": true
17
18
  }
18
19
  },
19
- "homepage": "https://github.com/code-pushup/cli#readme",
20
+ "homepage": "https://github.com/code-pushup/cli/tree/main/packages/plugin-eslint#readme",
20
21
  "bugs": {
21
22
  "url": "https://github.com/code-pushup/cli/issues"
22
23
  },
@@ -25,33 +26,6 @@
25
26
  "url": "git+https://github.com/code-pushup/cli.git",
26
27
  "directory": "packages/plugin-eslint"
27
28
  },
28
- "contributors": [
29
- {
30
- "name": "Igor Katsuba",
31
- "email": "igor@katsuba.dev",
32
- "url": "https://katsuba.dev"
33
- },
34
- {
35
- "name": "Kateřina Pilátová",
36
- "email": "katerina.pilatova@flowup.cz",
37
- "url": "https://github.com/Tlacenka"
38
- },
39
- {
40
- "name": "Matěj Chalk",
41
- "email": "matej.chalk@flowup.cz",
42
- "url": "https://github.com/matejchalk"
43
- },
44
- {
45
- "name": "Michael Hladky",
46
- "email": "michael.hladky@push-based.io",
47
- "url": "https://push-based.io"
48
- },
49
- {
50
- "name": "Michael Seredenko",
51
- "email": "misha.seredenko@push-based.io",
52
- "url": "https://github.com/MishaSeredenkoPushBased"
53
- }
54
- ],
55
29
  "type": "module",
56
30
  "main": "./index.js",
57
31
  "types": "./src/index.d.ts"
@@ -1,5 +1,5 @@
1
- import { PluginConfig } from '@code-pushup/models';
2
- import { ESLintPluginConfig } from './config';
1
+ import type { PluginConfig } from '@code-pushup/models';
2
+ import { type ESLintPluginConfig } from './config';
3
3
  /**
4
4
  * Instantiates Code PushUp ESLint plugin for use in core config.
5
5
  *
@@ -1,3 +1,3 @@
1
1
  import type { Audit } from '@code-pushup/models';
2
- import { RuleData } from './rules';
2
+ import type { RuleData } from './rules';
3
3
  export declare function ruleToAudit({ ruleId, meta, options }: RuleData): Audit;
@@ -1,5 +1,5 @@
1
1
  import type { Audit, RunnerConfig } from '@code-pushup/models';
2
- import { type ESLintTarget } from '../config';
2
+ import type { ESLintTarget } from '../config';
3
3
  export declare const WORKDIR: string;
4
4
  export declare const RUNNER_OUTPUT_PATH: string;
5
5
  export declare const PLUGIN_CONFIG_PATH: string;