Skip to content

Commit

Permalink
chore(deps-dev): bump xo from 0.59.3 to 0.60.0 (#3569)
Browse files Browse the repository at this point in the history
* chore(deps-dev): bump xo from 0.59.3 to 0.60.0

Bumps [xo](https://github.com/xojs/xo) from 0.59.3 to 0.60.0.
- [Release notes](https://github.com/xojs/xo/releases)
- [Commits](xojs/xo@v0.59.3...v0.60.0)

---
updated-dependencies:
- dependency-name: xo
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* refactor: running xo

* chore: reverted that part

* Revert "chore: reverted that part"

This reverts commit 70fdb61.

* Revert "refactor: running xo"

This reverts commit f65cc9a.

* refactor: running xo

* refactor: added disable comment

* fix: issue with next-showcase

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Franzke <[email protected]>
Co-authored-by: Nicolas Merget <[email protected]>
  • Loading branch information
3 people authored Dec 11, 2024
1 parent b0b52dd commit 4c86b12
Show file tree
Hide file tree
Showing 9 changed files with 178 additions and 180 deletions.
329 changes: 163 additions & 166 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"tsx": "^4.19.2",
"typescript": "^5.4.5",
"validate-branch-name": "^1.3.1",
"xo": "^0.59.3"
"xo": "^0.60.0"
},
"overrides": {
"cross-spawn": "~7.0.5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class DefaultComponent implements OnInit {
}

getLink = (variantName: string) => {
let currentUrl = window.location.href;
let currentUrl = globalThis.location.href;
if (!currentUrl.includes('?')) {
currentUrl += '?';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const VersionSwitcher = () => {
const isTag =
(branch.split('.').length === 3 && branch.startsWith('v')) ||
branch === 'latest';
window.location.replace(
globalThis.location.replace(
DOMPurify.sanitize(
`https://${owner}.github.io/${repo}${
isTag ? '/version' : '/review'
Expand Down
2 changes: 1 addition & 1 deletion showcases/patternhub/pages/base64/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Base64 = () => {
setUrl(
new URL(
`iframe?color=${color}&density=${density}&components=${base64}`,
window.location.href
globalThis.location?.href
).toString()
);
}, [density, color, base64]);
Expand Down
1 change: 1 addition & 0 deletions showcases/patternhub/scripts/generate-example-jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const generateExampleJSX = () => {
examples.push(
`"${componentName}${variant.name}${
example.name
// eslint-disable-next-line unicorn/no-length-as-slice-end
}":renderToString(${code.slice(0, code.length)})`
);
}
Expand Down
14 changes: 7 additions & 7 deletions showcases/react-showcase/src/components/default-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ const DefaultComponent = ({
const color = useQuery(redirectURLSearchParams)[2];

const getHref = (variantName: string): string => {
if (typeof window !== 'undefined') {
if (typeof globalThis !== 'undefined') {
const searchParams = new URLSearchParams(
window.location.href.split('?')[1]
globalThis?.location?.href.split('?')[1]
);
searchParams.set('page', variantName.toLowerCase());
return `${window.location.href.split('?')[0]}?${searchParams.toString()}`;
return `${globalThis?.location?.href.split('?')[0]}?${searchParams.toString()}`;
}

return '';
Expand All @@ -98,14 +98,14 @@ const DefaultComponent = ({
variantName: string
) => {
if (
typeof window === 'undefined' ||
!window.location.origin ||
!window.location.href
typeof globalThis === 'undefined' ||
!globalThis.location.origin ||
!globalThis.location.href
) {
return;
}

const currentUrl = window.location.href.split('?');
const currentUrl = globalThis.location.href.split('?');
const rawComponentUrl = currentUrl[0];
const searchParams = new URLSearchParams(currentUrl[1] ?? '');
searchParams.set('page', variantName.toLowerCase());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const useUniversalSearchParameters = (): [
: useSearchParams();

const setSearchParameters = (params: Record<string, string>) => {
if (typeof window !== 'undefined') {
if (typeof globalThis !== 'undefined') {
const currentParams = new URLSearchParams(
window.location.href.split('?')[1]
globalThis.location.href.split('?')[1]
);
currentParams.sort();
const newParams = new URLSearchParams(params);
Expand Down
2 changes: 1 addition & 1 deletion showcases/react-showcase/src/utils/base-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const getBasePath = () => {
return process.env.BASE_PATH;
}

if (typeof window !== 'undefined') {
if (typeof globalThis !== 'undefined') {
// eslint-disable-next-line @typescript-eslint/dot-notation
return window['env']?.BASE_URL;
}
Expand Down

0 comments on commit 4c86b12

Please sign in to comment.