Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Upgrade to Prettier 3.4 #58

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/01-pure-js/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
2 changes: 1 addition & 1 deletion examples/02-react/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
2 changes: 1 addition & 1 deletion examples/03-svelte/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
2 changes: 1 addition & 1 deletion examples/04-vue/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
2 changes: 1 addition & 1 deletion examples/05-spatial-index/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
14 changes: 8 additions & 6 deletions examples/components/widgets/category-widget.ts
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ export class CategoryWidget extends BaseWidget {

protected _chart: echarts.ECharts | null = null;
protected _chartRef: Ref<HTMLElement> = createRef();
protected declare _filterValues: string[];
declare protected _filterValues: string[];

constructor() {
super();
@@ -73,11 +73,13 @@ export class CategoryWidget extends BaseWidget {
override render() {
return this._task.render({
pending: () =>
cache(html`<h3>${this.header}</h3>
<figure>
<div class="chart chart-skeleton"></div>
<figcaption>${this.caption}</figcaption>
</figure>`),
cache(
html`<h3>${this.header}</h3>
<figure>
<div class="chart chart-skeleton"></div>
<figcaption>${this.caption}</figcaption>
</figure>`
),
complete: () =>
cache(html`
<h3>${this.header}</h3>
12 changes: 7 additions & 5 deletions examples/components/widgets/histogram-widget.ts
Original file line number Diff line number Diff line change
@@ -75,11 +75,13 @@ export class HistogramWidget extends BaseWidget {
override render() {
return this._task.render({
pending: () =>
cache(html`<h3>${this.header}</h3>
<figure>
<div class="chart chart-skeleton"></div>
<figcaption>${this.caption}</figcaption>
</figure>`),
cache(
html`<h3>${this.header}</h3>
<figure>
<div class="chart chart-skeleton"></div>
<figcaption>${this.caption}</figcaption>
</figure>`
),
complete: () =>
cache(html`
<h3>${this.header}</h3>
12 changes: 7 additions & 5 deletions examples/components/widgets/scatter-widget.ts
Original file line number Diff line number Diff line change
@@ -83,11 +83,13 @@ export class ScatterWidget extends BaseWidget {
override render() {
return this._task.render({
pending: () =>
cache(html`<h3>${this.header}</h3>
<figure>
<div class="chart chart-skeleton"></div>
<figcaption>${this.caption}</figcaption>
</figure>`),
cache(
html`<h3>${this.header}</h3>
<figure>
<div class="chart chart-skeleton"></div>
<figcaption>${this.caption}</figcaption>
</figure>`
),
complete: () =>
cache(html`
<h3>${this.header}</h3>
2 changes: 1 addition & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en-GB">
<head>
<meta charset="utf-8" />
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@
"lit-analyzer": "^1.2.1",
"maplibre-gl": "^5.0.0",
"microbundle": "^0.15.1",
"prettier": "^2.6.2",
"prettier": "^3.4.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-map-gl": "^7.1.7",
13 changes: 8 additions & 5 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -49,11 +49,14 @@ export function normalizeObjectKeys<T, R extends Row<T>>(el: R): R {
return el;
}

return Object.entries(el as Record<string, T>).reduce((acc, [key, value]) => {
acc[key.toLowerCase()] =
typeof value === 'object' && value ? normalizeObjectKeys(value) : value;
return acc;
}, {} as Record<string, T>) as R;
return Object.entries(el as Record<string, T>).reduce(
(acc, [key, value]) => {
acc[key.toLowerCase()] =
typeof value === 'object' && value ? normalizeObjectKeys(value) : value;
return acc;
},
{} as Record<string, T>
) as R;
}

/** @internalRemarks Source: @carto/react-core */
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -1481,7 +1481,7 @@ __metadata:
lit-analyzer: "npm:^1.2.1"
maplibre-gl: "npm:^5.0.0"
microbundle: "npm:^0.15.1"
prettier: "npm:^2.6.2"
prettier: "npm:^3.4.2"
react: "npm:^18.3.1"
react-dom: "npm:^18.3.1"
react-map-gl: "npm:^7.1.7"
@@ -8146,12 +8146,12 @@ __metadata:
languageName: node
linkType: hard

"prettier@npm:^2.6.2":
version: 2.8.8
resolution: "prettier@npm:2.8.8"
"prettier@npm:^3.4.2":
version: 3.4.2
resolution: "prettier@npm:3.4.2"
bin:
prettier: bin-prettier.js
checksum: 10c0/463ea8f9a0946cd5b828d8cf27bd8b567345cf02f56562d5ecde198b91f47a76b7ac9eae0facd247ace70e927143af6135e8cf411986b8cb8478784a4d6d724a
prettier: bin/prettier.cjs
checksum: 10c0/99e076a26ed0aba4ebc043880d0f08bbb8c59a4c6641cdee6cdadf2205bdd87aa1d7823f50c3aea41e015e99878d37c58d7b5f0e663bba0ef047f94e36b96446
languageName: node
linkType: hard