Skip to content

Commit 028bb95

Browse files
committed
Auto-format JS and config files with oxc and updated linters
1 parent c248bcb commit 028bb95

File tree

45 files changed

+145
-330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+145
-330
lines changed

plain-admin/plain/admin/assets/admin/admin.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ jQuery(($) => {
1010
}
1111
// Use form action if set, otherwise current path
1212
const basePath = form.getAttribute("action") || window.location.pathname;
13-
const url = params.toString()
14-
? `${basePath}?${params.toString()}`
15-
: basePath;
13+
const url = params.toString() ? `${basePath}?${params.toString()}` : basePath;
1614
window.location.href = url;
1715
}
1816

@@ -100,7 +98,7 @@ jQuery(($) => {
10098
message = response.error || response.message;
10199
}
102100
}
103-
} catch (_e) {
101+
} catch {
104102
// Ignore JSON parsing errors, use default message
105103
}
106104

@@ -119,11 +117,7 @@ jQuery(($) => {
119117
$(document).on("keydown", (e) => {
120118
const activeTag = document.activeElement.tagName;
121119
const isEditable = document.activeElement.isContentEditable;
122-
if (
123-
e.key === "/" &&
124-
!["INPUT", "TEXTAREA", "SELECT"].includes(activeTag) &&
125-
!isEditable
126-
) {
120+
if (e.key === "/" && !["INPUT", "TEXTAREA", "SELECT"].includes(activeTag) && !isEditable) {
127121
e.preventDefault();
128122
$("#topbar-search").trigger("focus");
129123
}

plain-admin/plain/admin/assets/admin/charts.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,7 @@ window.AdminCharts = {
3838

3939
// Create gradient for bars
4040
const context = ctx.getContext("2d");
41-
const gradient = context.createLinearGradient(
42-
0,
43-
0,
44-
0,
45-
ctx.parentElement.offsetHeight || 140,
46-
);
41+
const gradient = context.createLinearGradient(0, 0, 0, ctx.parentElement.offsetHeight || 140);
4742
gradient.addColorStop(0, "rgba(120, 113, 108, 0.85)"); // stone-500
4843
gradient.addColorStop(0.5, "rgba(168, 162, 158, 0.7)"); // stone-400
4944
gradient.addColorStop(1, "rgba(214, 211, 209, 0.5)"); // stone-300
@@ -60,9 +55,7 @@ window.AdminCharts = {
6055
* @param {Element} container - DOM element to search for charts
6156
*/
6257
renderAll: function (container) {
63-
const charts = container.querySelectorAll
64-
? container.querySelectorAll("[data-chart-id]")
65-
: [];
58+
const charts = container.querySelectorAll ? container.querySelectorAll("[data-chart-id]") : [];
6659
charts.forEach((el) => {
6760
const slug = el.getAttribute("data-chart-id");
6861
if (slug) this.render(slug);

plain-admin/plain/admin/assets/admin/datetime-tooltips.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,12 @@ jQuery(($) => {
6262
tooltip.className =
6363
"hidden flex-col fixed z-50 bg-white text-black/90 border border-stone-200 shadow-lg rounded-md p-1 text-sm min-w-56 whitespace-nowrap";
6464

65-
tooltip.appendChild(
66-
createTooltipRow(localTz, formatDatetime(date, localTz)),
67-
);
68-
tooltip.appendChild(
69-
createTooltipRow("UTC", formatDatetime(date, "UTC")),
70-
);
65+
tooltip.appendChild(createTooltipRow(localTz, formatDatetime(date, localTz)));
66+
tooltip.appendChild(createTooltipRow("UTC", formatDatetime(date, "UTC")));
7167
const relativeRow = createTooltipRow("Relative", relativeTime(date));
7268
tooltip.appendChild(relativeRow);
7369
tooltip.appendChild(createTooltipRow("Unix", String(unix)));
74-
tooltip.appendChild(
75-
createTooltipRow("ISO", this.getAttribute("datetime")),
76-
);
70+
tooltip.appendChild(createTooltipRow("ISO", this.getAttribute("datetime")));
7771

7872
document.body.appendChild(tooltip);
7973
this._datetimeTooltip = tooltip;
@@ -90,10 +84,7 @@ jQuery(($) => {
9084
tooltip.classList.replace("hidden", "flex");
9185
};
9286
const hide = () => {
93-
hideTimeout = setTimeout(
94-
() => tooltip.classList.replace("flex", "hidden"),
95-
100,
96-
);
87+
hideTimeout = setTimeout(() => tooltip.classList.replace("flex", "hidden"), 100);
9788
};
9889

9990
this.addEventListener("mouseenter", show);

plain-admin/plain/admin/assets/admin/list.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ jQuery(($) => {
1111
$actionCheckbox.on("change", () => {
1212
if ($actionCheckboxHeader.is(":checked")) {
1313
// If header is checked and a row changes, uncheck header
14-
if (
15-
$actionCheckbox.filter(":checked").length !== $actionCheckbox.length
16-
) {
14+
if ($actionCheckbox.filter(":checked").length !== $actionCheckbox.length) {
1715
$actionCheckboxHeader.prop("checked", false);
1816
}
1917
}
@@ -84,8 +82,7 @@ jQuery(($) => {
8482
// Merge query params with the current url and the link url
8583
$("[data-merge-params]").each(function () {
8684
const currentUrl = new URL(window.location.href);
87-
const params = new URL($(this).attr("href"), window.location.href)
88-
.searchParams;
85+
const params = new URL($(this).attr("href"), window.location.href).searchParams;
8986
params.forEach((value, key) => {
9087
currentUrl.searchParams.set(key, value);
9188
});

plain-admin/plain/admin/assets/admin/menu.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,18 @@ document.addEventListener("DOMContentLoaded", () => {
7070
subsections.forEach((subsection) => {
7171
const nextGroup = subsection.nextElementSibling;
7272
if (nextGroup?.classList.contains("menu-items-group")) {
73-
const hasVisibleItems = Array.from(
74-
nextGroup.querySelectorAll(".menu-item"),
75-
).some((item) => item.style.display !== "none");
73+
const hasVisibleItems = Array.from(nextGroup.querySelectorAll(".menu-item")).some(
74+
(item) => item.style.display !== "none",
75+
);
7676
subsection.style.display = hasVisibleItems ? "" : "none";
7777
}
7878
});
7979

8080
// Hide empty top-level sections (App/Packages)
8181
sections.forEach((section) => {
82-
const visibleItems = Array.from(
83-
section.querySelectorAll(".menu-item"),
84-
).filter((item) => item.style.display !== "none");
82+
const visibleItems = Array.from(section.querySelectorAll(".menu-item")).filter(
83+
(item) => item.style.display !== "none",
84+
);
8585
section.style.display = visibleItems.length > 0 ? "" : "none";
8686
});
8787
}
@@ -135,9 +135,9 @@ document.addEventListener("DOMContentLoaded", () => {
135135

136136
// Get new order of pinned items and POST to server
137137
const container = document.getElementById("nav-tabs-container");
138-
const newOrder = Array.from(
139-
container.querySelectorAll(".nav-tab[data-slug]"),
140-
).map((t) => t.dataset.slug);
138+
const newOrder = Array.from(container.querySelectorAll(".nav-tab[data-slug]")).map(
139+
(t) => t.dataset.slug,
140+
);
141141

142142
// Get the reorder URL from the container's data attribute
143143
const reorderUrl = container.dataset.reorderUrl;

plain-admin/pyproject.toml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,14 @@
22
name = "plain.admin"
33
version = "0.68.0"
44
description = "Manage your app with a backend interface."
5-
authors = [{name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev"}]
5+
authors = [{ name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev" }]
66
license = "BSD-3-Clause"
77
readme = "README.md"
88
requires-python = ">=3.13"
9-
dependencies = [
10-
"plain<1.0.0",
11-
"plain.auth<1.0.0",
12-
"plain.htmx<1.0.0",
13-
"plain.tailwind<1.0.0",
14-
]
9+
dependencies = ["plain<1.0.0", "plain.auth<1.0.0", "plain.htmx<1.0.0", "plain.tailwind<1.0.0"]
1510

1611
[dependency-groups]
17-
dev = [
18-
"plain.pytest<1.0.0",
19-
]
12+
dev = ["plain.pytest<1.0.0"]
2013

2114
[tool.hatch.build.targets.wheel]
2215
packages = ["plain"]

plain-api/pyproject.toml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@
22
name = "plain.api"
33
version = "0.26.2"
44
description = "Build APIs using class-based views."
5-
authors = [{name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev"}]
5+
authors = [{ name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev" }]
66
readme = "README.md"
77
license = "BSD-3-Clause"
88
requires-python = ">=3.13"
9-
dependencies = [
10-
"plain<1.0.0",
11-
]
9+
dependencies = ["plain<1.0.0"]
1210

1311
[dependency-groups]
14-
dev = [
15-
"plain.pytest<1.0.0",
16-
]
12+
dev = ["plain.pytest<1.0.0"]
1713

1814
[tool.hatch.build.targets.wheel]
1915
packages = ["plain"]

plain-auth/pyproject.toml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22
name = "plain.auth"
33
version = "0.25.3"
44
description = "Add users to your app and decide what they can access."
5-
authors = [{name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev"}]
5+
authors = [{ name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev" }]
66
readme = "README.md"
77
license = "BSD-3-Clause"
88
requires-python = ">=3.13"
99
dependencies = [
10-
"plain<1.0.0",
11-
"plain.models<1.0.0",
12-
# Technically you can swap out sessions entirely with your own,
13-
# so long as the request.session exists and has a similar API.
14-
"plain.sessions<1.0.0",
10+
"plain<1.0.0",
11+
"plain.models<1.0.0",
12+
# Technically you can swap out sessions entirely with your own,
13+
# so long as the request.session exists and has a similar API.
14+
"plain.sessions<1.0.0",
1515
]
1616

1717
[dependency-groups]
18-
dev = [
19-
"plain.pytest<1.0.0",
20-
]
18+
dev = ["plain.pytest<1.0.0"]
2119

2220
[tool.hatch.build.targets.wheel]
2321
packages = ["plain"]

plain-cache/pyproject.toml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
[project]
22
name = "plain.cache"
3-
packages = [
4-
{ include = "plain" },
5-
]
3+
packages = [{ include = "plain" }]
64
version = "0.25.2"
75
description = "A simple database-backed cache for storing JSON-serializable values with optional expiration."
8-
authors = [{name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev"}]
6+
authors = [{ name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev" }]
97
readme = "README.md"
108
license = "BSD-3-Clause"
119
requires-python = ">=3.13"
12-
dependencies = [
13-
"plain<1.0.0",
14-
]
10+
dependencies = ["plain<1.0.0"]
1511

1612
[tool.hatch.build.targets.wheel]
1713
packages = ["plain"]

plain-code/plain/code/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from typing import Any
99

1010
import click
11+
1112
from plain.cli import register_cli
1213
from plain.cli.print import print_event
1314
from plain.cli.runtime import common_command, without_runtime_setup

0 commit comments

Comments
 (0)