@podman-desktop/eslint-plugin 0.3.0 → 0.4.0-next.202610231252-6411799

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 (2) hide show
  1. package/dist/index.js +88 -92
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,57 +1,56 @@
1
1
  import { execFileSync as e } from "node:child_process";
2
2
  import { lstatSync as t, readFileSync as n } from "node:fs";
3
3
  import { resolve as r } from "node:path";
4
- //#region package.json
5
- var i = "@podman-desktop/eslint-plugin", a = "0.3.0", o = "ESLint plugin with rules for Podman Desktop", s = "Apache-2.0", c = {
6
- type: "git",
7
- url: "https://github.com/podman-desktop/eslint-plugin"
8
- }, l = "module", u = "./dist/index.js", d = "./dist/index.d.ts", f = { ".": {
4
+ var i = {
5
+ name: "@podman-desktop/eslint-plugin",
6
+ version: "0.4.0-next.202610231252-6411799",
7
+ description: "ESLint plugin with rules for Podman Desktop",
8
+ license: "Apache-2.0",
9
+ repository: {
10
+ type: "git",
11
+ url: "https://github.com/podman-desktop/eslint-plugin"
12
+ },
13
+ type: "module",
14
+ main: "./dist/index.js",
9
15
  types: "./dist/index.d.ts",
10
- import: "./dist/index.js"
11
- } }, p = ["dist"], m = {
12
- build: "vite build",
13
- test: "vitest run",
14
- "lint:check": "eslint .",
15
- "lint:fix": "pnpm run build && eslint --fix .",
16
- "format:check": "biome format",
17
- "format:fix": "biome format --write",
18
- typecheck: "tsc --noEmit -p tsconfig.json",
19
- prepare: "husky"
20
- }, h = { node: ">=24 <25" }, g = {
21
- "@biomejs/biome": "^2.3.15",
22
- "@types/eslint": "^9.6.0",
23
- "@types/node": "^24",
24
- eslint: "^10.0.0",
25
- "eslint-plugin-yml": "^3.1.2",
26
- husky: "^9.1.7",
27
- "lint-staged": "^16.2.7",
28
- typescript: "^5.4.0",
29
- "typescript-eslint": "^8.55.0",
30
- vite: "^8.0.0",
31
- "vite-plugin-dts": "^4.5.4",
32
- vitest: "^4.0.18"
33
- }, _ = { eslint: ">=9.0.0" }, v = "pnpm@10.29.3+sha512.498e1fb4cca5aa06c1dcf2611e6fafc50972ffe7189998c409e90de74566444298ffe43e6cd2acdc775ba1aa7cc5e092a8b7054c811ba8c5770f84693d33d2dc", y = {
34
- name: i,
35
- version: a,
36
- description: o,
37
- license: s,
38
- repository: c,
39
- type: l,
40
- main: u,
41
- types: d,
42
- exports: f,
43
- files: p,
44
- scripts: m,
45
- engines: h,
46
- devDependencies: g,
47
- peerDependencies: _,
16
+ exports: { ".": {
17
+ types: "./dist/index.d.ts",
18
+ import: "./dist/index.js"
19
+ } },
20
+ files: ["dist"],
21
+ scripts: {
22
+ build: "vite build",
23
+ test: "vitest run",
24
+ "lint:check": "eslint .",
25
+ "lint:fix": "pnpm run build && eslint --fix .",
26
+ "format:check": "biome format",
27
+ "format:fix": "biome format --write",
28
+ typecheck: "tsc --noEmit -p tsconfig.json",
29
+ prepare: "husky"
30
+ },
31
+ engines: { node: ">=24 <25" },
32
+ devDependencies: {
33
+ "@biomejs/biome": "^2.3.15",
34
+ "@types/eslint": "^9.6.0",
35
+ "@types/node": "^24",
36
+ eslint: "^10.0.0",
37
+ "eslint-plugin-yml": "^3.1.2",
38
+ husky: "^9.1.7",
39
+ "lint-staged": "^17.0.8",
40
+ typescript: "^5.4.0",
41
+ "typescript-eslint": "^8.55.0",
42
+ vite: "^8.0.0",
43
+ "vite-plugin-dts": "^5.0.3",
44
+ vitest: "^5.0.2"
45
+ },
46
+ peerDependencies: { eslint: ">=9.0.0" },
48
47
  "lint-staged": { "*.{js,ts,mjs,cjs,tsx,jsx,yml,yaml}": ["eslint --fix", "biome format --write"] },
49
- packageManager: v
50
- }, b, x, S, C, w = !1, T;
51
- function E() {
48
+ packageManager: "pnpm@10.29.3+sha512.498e1fb4cca5aa06c1dcf2611e6fafc50972ffe7189998c409e90de74566444298ffe43e6cd2acdc775ba1aa7cc5e092a8b7054c811ba8c5770f84693d33d2dc"
49
+ }, a, o, s, c, l = !1, u;
50
+ function d() {
52
51
  return process.env.GITHUB_ACTIONS === "true" && process.env.GITHUB_EVENT_NAME === "pull_request";
53
52
  }
54
- function D() {
53
+ function f() {
55
54
  let e = process.env.GITHUB_REF;
56
55
  if (e) {
57
56
  let t = /^refs\/pull\/(\d+)\/merge$/.exec(e);
@@ -63,9 +62,9 @@ function D() {
63
62
  if (e?.pull_request?.number) return String(e.pull_request.number);
64
63
  } catch {}
65
64
  }
66
- function O(t) {
67
- if (!E()) return !1;
68
- let n = D();
65
+ function p(t) {
66
+ if (!d()) return !1;
67
+ let n = f();
69
68
  if (!n) return !1;
70
69
  let i = process.env.GITHUB_REPOSITORY;
71
70
  if (!i) return !1;
@@ -81,26 +80,26 @@ function O(t) {
81
80
  encoding: "utf-8"
82
81
  }), o = /* @__PURE__ */ new Set();
83
82
  for (let e of a.split("\n")) e && o.add(r(t, e));
84
- return T = o, w = !0, !0;
83
+ return u = o, l = !0, !0;
85
84
  } catch {
86
85
  return !1;
87
86
  }
88
87
  }
89
- function k() {
90
- if (C !== void 0) return;
88
+ function m() {
89
+ if (c !== void 0) return;
91
90
  try {
92
- S = e("git", ["rev-parse", "--show-toplevel"], {
91
+ s = e("git", ["rev-parse", "--show-toplevel"], {
93
92
  stdio: "pipe",
94
93
  encoding: "utf-8"
95
- }).trim(), C = !0;
94
+ }).trim(), c = !0;
96
95
  } catch {
97
- C = !1;
96
+ c = !1;
98
97
  return;
99
98
  }
100
- if (O(S)) return;
99
+ if (p(s)) return;
101
100
  let t = /* @__PURE__ */ new Map();
102
- b = t;
103
- let n = S;
101
+ a = t;
102
+ let n = s;
104
103
  try {
105
104
  let i = e("git", [
106
105
  "log",
@@ -111,23 +110,20 @@ function k() {
111
110
  ], {
112
111
  stdio: "pipe",
113
112
  encoding: "utf-8",
114
- maxBuffer: 50 * 1024 * 1024
113
+ maxBuffer: 52428800
115
114
  }), a;
116
115
  for (let e of i.split("\n")) if (e) {
117
- if (e.startsWith("COMMIT:")) {
118
- a = Number(e.slice(7));
119
- continue;
120
- }
121
- if (a !== void 0) {
116
+ if (e.startsWith("COMMIT:")) a = Number(e.slice(7));
117
+ else if (a !== void 0) {
122
118
  let i = r(n, e);
123
119
  t.has(i) || t.set(i, a);
124
120
  }
125
121
  }
126
122
  } catch {
127
- C = !1;
123
+ c = !1;
128
124
  }
129
125
  let i = /* @__PURE__ */ new Set();
130
- x = i;
126
+ o = i;
131
127
  try {
132
128
  let t = e("git", ["status", "--porcelain"], {
133
129
  stdio: "pipe",
@@ -140,7 +136,7 @@ function k() {
140
136
  }
141
137
  } catch {}
142
138
  }
143
- var A = [
139
+ var h = [
144
140
  "Copyright (C) {year} Red Hat, Inc.",
145
141
  "",
146
142
  "Licensed under the Apache License, Version 2.0 (the \"License\");",
@@ -156,26 +152,26 @@ var A = [
156
152
  "limitations under the License.",
157
153
  "",
158
154
  "SPDX-License-Identifier: Apache-2.0"
159
- ], j = /Copyright \(C\) (\d{4})(?:[-,\s]+(\d{4}))* (.+)/;
160
- function M(e) {
161
- if (k(), w) return (/* @__PURE__ */ new Date()).getFullYear();
155
+ ], g = /Copyright \(C\) (\d{4})(?:[-,\s]+(\d{4}))* (.+)/;
156
+ function _(e) {
157
+ if (m(), l) return (/* @__PURE__ */ new Date()).getFullYear();
162
158
  let n = r(e);
163
- if (x?.has(n)) return (/* @__PURE__ */ new Date()).getFullYear();
164
- let i = b?.get(n);
159
+ if (o?.has(n)) return (/* @__PURE__ */ new Date()).getFullYear();
160
+ let i = a?.get(n);
165
161
  if (i !== void 0) return i;
166
- let a = t(e, { throwIfNoEntry: !1 });
167
- return a ? a.mtime.getFullYear() : (/* @__PURE__ */ new Date()).getFullYear();
162
+ let s = t(e, { throwIfNoEntry: !1 });
163
+ return s ? s.mtime.getFullYear() : (/* @__PURE__ */ new Date()).getFullYear();
168
164
  }
169
- function N(e) {
165
+ function v(e) {
170
166
  return /\.ya?ml$/i.test(e);
171
167
  }
172
- var P = /\.(svelte|md)$/i;
173
- function F(e) {
174
- return P.test(e);
168
+ var y = /\.(svelte|md)$/i;
169
+ function b(e) {
170
+ return y.test(e);
175
171
  }
176
- function I(e, t) {
177
- let n = A.map((t) => t.replace("{year}", e));
178
- if (N(t)) {
172
+ function x(e, t) {
173
+ let n = h.map((t) => t.replace("{year}", e));
174
+ if (v(t)) {
179
175
  let e = "#" + "*".repeat(79);
180
176
  return `${e}\n${n.map((e) => e === "" ? "#" : `# ${e}`).join("\n")}\n${e}\n\n`;
181
177
  }
@@ -184,10 +180,10 @@ function I(e, t) {
184
180
  }
185
181
  //#endregion
186
182
  //#region src/index.ts
187
- var L = {
183
+ var S = {
188
184
  meta: {
189
185
  name: "@podman-desktop/eslint-plugin",
190
- version: y.version
186
+ version: i.version
191
187
  },
192
188
  rules: { copyright: {
193
189
  meta: {
@@ -202,19 +198,19 @@ var L = {
202
198
  },
203
199
  create(e) {
204
200
  let t = e.filename;
205
- if (F(t) || (k(), w && !T?.has(r(S ?? "", t)))) return {};
201
+ if (b(t) || (m(), l && !u?.has(r(s ?? "", t)))) return {};
206
202
  let n;
207
203
  function i() {
208
- return n === void 0 && (n = M(t)), n;
204
+ return n === void 0 && (n = _(t)), n;
209
205
  }
210
206
  return { Program(n) {
211
- let r = e.sourceCode.getText(), a = r.split("\n").slice(0, 30).join("\n"), o = j.exec(a);
207
+ let r = e.sourceCode.getText(), a = r.split("\n").slice(0, 30).join("\n"), o = g.exec(a);
212
208
  if (!o) {
213
209
  e.report({
214
210
  node: n,
215
211
  messageId: "missingHeader",
216
212
  fix(e) {
217
- let n = I(String((/* @__PURE__ */ new Date()).getFullYear()), t);
213
+ let n = x(String((/* @__PURE__ */ new Date()).getFullYear()), t);
218
214
  return e.insertTextBeforeRange([0, 0], n);
219
215
  }
220
216
  });
@@ -236,11 +232,11 @@ var L = {
236
232
  }
237
233
  } },
238
234
  configs: {}
239
- }, R = L.configs;
240
- R.recommended = {
235
+ }, C = S.configs;
236
+ C.recommended = {
241
237
  files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
242
- plugins: { "@podman-desktop/eslint-plugin": L },
238
+ plugins: { "@podman-desktop/eslint-plugin": S },
243
239
  rules: { "@podman-desktop/eslint-plugin/copyright": "error" }
244
240
  };
245
241
  //#endregion
246
- export { L as default };
242
+ export { S as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@podman-desktop/eslint-plugin",
3
- "version": "0.3.0",
3
+ "version": "0.4.0-next.202610231252-6411799",
4
4
  "description": "ESLint plugin with rules for Podman Desktop",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -29,12 +29,12 @@
29
29
  "eslint": "^10.0.0",
30
30
  "eslint-plugin-yml": "^3.1.2",
31
31
  "husky": "^9.1.7",
32
- "lint-staged": "^16.2.7",
32
+ "lint-staged": "^17.0.8",
33
33
  "typescript": "^5.4.0",
34
34
  "typescript-eslint": "^8.55.0",
35
35
  "vite": "^8.0.0",
36
- "vite-plugin-dts": "^4.5.4",
37
- "vitest": "^4.0.18"
36
+ "vite-plugin-dts": "^5.0.3",
37
+ "vitest": "^5.0.2"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "eslint": ">=9.0.0"