Skip to content

Commit

Permalink
chore(deps): update dependency typescript-eslint to v8 (#2980)
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] committed Aug 5, 2024
1 parent c7804c1 commit 7d3f45b
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 69 deletions.
6 changes: 6 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ export default [
'lyne/test-describe-title': 'off',
},
},
{
files: ['**/*.spec.ts'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
},
},
{
files: ['**/*.ts'],
rules: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"stylelint-scss": "6.5.0",
"ts-lit-plugin": "2.0.2",
"typescript": "5.5.4",
"typescript-eslint": "7.18.0",
"typescript-eslint": "8.0.0",
"urlpattern-polyfill": "10.0.0",
"vite": "5.3.5",
"vite-plugin-dts": "3.9.1"
Expand Down
9 changes: 6 additions & 3 deletions src/elements-experimental/core/datetime/date-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,42 +73,45 @@ export const durationToTime = (
const days = differenceInDays(future, now);
if (days > 0) {
short.push(`${days} d`);
currentLanguage &&
if (currentLanguage) {
long.push(
`${days} ${
days > 1
? i18nDurationDay.multiple.long[currentLanguage]
: i18nDurationDay.single.long[currentLanguage]
}`,
);
}
future = subDays(future, days);
}

const hours = differenceInHours(future, now);
if (hours > 0) {
short.push(`${hours} h`);
currentLanguage &&
if (currentLanguage) {
long.push(
`${hours} ${
hours > 1
? i18nDurationHour.multiple.long[currentLanguage]
: i18nDurationHour.single.long[currentLanguage]
}`,
);
}
future = subHours(future, hours);
}

const minutes = differenceInMinutes(future, now);
if (minutes > 0) {
short.push(`${minutes} min`);
currentLanguage &&
if (currentLanguage) {
long.push(
`${minutes} ${
minutes > 1
? i18nDurationMinute.multiple.long[currentLanguage]
: i18nDurationMinute.single.long[currentLanguage]
}`,
);
}
}

return {
Expand Down
1 change: 1 addition & 0 deletions src/elements/clock/clock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ export class SbbClockElement extends LitElement {
}
this._clockHandSeconds.style.animation = '';
// Hack to trigger reflow
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
this._clockHandSeconds.offsetHeight;
this._clockHandSeconds.style.removeProperty('animation');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,9 @@ export class SbbDatepickerToggleElement<T = Date> extends SbbNegativeMixin(
<sbb-popover
@willOpen=${() => this._calendarElement.resetPosition()}
@didOpen=${() => {
sbbInputModalityDetector.mostRecentModality === 'keyboard' &&
if (sbbInputModalityDetector.mostRecentModality === 'keyboard') {
this._calendarElement.focus();
}
}}
.trigger=${this._triggerElement}
hide-close-button
Expand Down
7 changes: 5 additions & 2 deletions src/elements/dialog/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ export class SbbDialogElement extends SbbOverlayBaseElement {
this._dialogContentResizeObserver.disconnect();
this.removeInstanceFromGlobalCollection();
// Enable scrolling for content below the dialog if no dialog is open
!overlayRefs.length && this.scrollHandler.enableScroll();
if (!overlayRefs.length) {
this.scrollHandler.enableScroll();
}
this.didClose.emit({
returnValue: this.returnValue,
closeTarget: this.overlayCloseElement,
Expand Down Expand Up @@ -269,8 +271,9 @@ export class SbbDialogElement extends SbbOverlayBaseElement {
? hideOnScroll
: isBreakpoint('zero', hideOnScroll, { includeMaxBreakpoint: true });
this.toggleAttribute('data-hide-header', !hideHeader ? false : value);
this._dialogTitleElement &&
if (this._dialogTitleElement) {
this._dialogTitleElement.toggleAttribute('data-hide-header', !hideHeader ? false : value);
}
}

private _setOverflowsDataAttribute(): void {
Expand Down
2 changes: 1 addition & 1 deletion src/elements/image/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const imageHelperGetBreakpoints = (

try {
jsonObject = JSON.parse(jsonString);
} catch (error) {
} catch {
logWarning?.();
return [];
}
Expand Down
4 changes: 3 additions & 1 deletion src/elements/overlay/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ export class SbbOverlayElement extends SbbOverlayBaseElement {
this.focusHandler.disconnect();
this.removeInstanceFromGlobalCollection();
// Enable scrolling for content below the overlay if no overlay is open
!overlayRefs.length && this.scrollHandler.enableScroll();
if (!overlayRefs.length) {
this.scrollHandler.enableScroll();
}
this.didClose.emit({
returnValue: this.returnValue,
closeTarget: this.overlayCloseElement,
Expand Down
4 changes: 3 additions & 1 deletion src/elements/popover/popover/popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ export class SbbPopoverElement extends SbbHydrationMixin(SbbOpenCloseBaseElement
this._triggerElement.addEventListener(
'click',
() => {
this.state === 'closed' && this.open();
if (this.state === 'closed') {
this.open();
}
},
{
signal: this._popoverController.signal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ export class SbbSelectionExpansionPanelElement extends SbbHydrationMixin(LitElem
return;
}

this.forceOpen || this._checked ? this._open(!this._initialized) : this._close();
if (this.forceOpen || this._checked) {
this._open(!this._initialized);
} else {
this._close();
}
this._updateExpandedLabel(this.forceOpen || this._checked);
}

Expand Down
2 changes: 1 addition & 1 deletion src/react/core/create-component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable
@typescript-eslint/explicit-function-return-type,
@typescript-eslint/ban-types,
@typescript-eslint/naming-convention,
@typescript-eslint/naming-convention,
@typescript-eslint/no-empty-object-type,
import-x/default,
import-x/no-named-as-default-member
*/
Expand Down
2 changes: 1 addition & 1 deletion tools/vite/generate-react-wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function generateReactWrappers(
let manifest: Package;
try {
manifest = JSON.parse(readFileSync(fullManifestPath, 'utf8'));
} catch (e) {
} catch {
console.error(
`Failed to read manifest at ${fullManifestPath}. Please run 'yarn build:elements' or 'yarn docs:manifest' first!`,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function executableIsAvailable(name: string): string | null {
try {
execSync(`${platform().startsWith('win') ? 'where' : 'which'} ${name}`, { encoding: 'utf8' });
return name;
} catch (error) {
} catch {
return null;
}
}
Expand Down
4 changes: 2 additions & 2 deletions tools/web-test-runner/visual-regression-plugin-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ try {
const response = await fetch(`${baselineUrl}${metaFileName}`);
baselineMeta = JSON.parse(await response.text()) satisfies Meta;
meta = { ...meta, baselineGitSha: baselineMeta.gitSha ?? 'N/A' };
} catch (e) {
} catch {
meta = { ...meta, baselineGitSha: 'N/A' };
}

Expand Down Expand Up @@ -74,7 +74,7 @@ export const visualRegressionConfig = {

return buffer;
}
} catch (e) {
} catch {
return undefined;
}
},
Expand Down
70 changes: 17 additions & 53 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2749,21 +2749,6 @@
dependencies:
"@types/node" "*"

"@typescript-eslint/[email protected]":
version "7.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz#b16d3cf3ee76bf572fdf511e79c248bdec619ea3"
integrity sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==
dependencies:
"@eslint-community/regexpp" "^4.10.0"
"@typescript-eslint/scope-manager" "7.18.0"
"@typescript-eslint/type-utils" "7.18.0"
"@typescript-eslint/utils" "7.18.0"
"@typescript-eslint/visitor-keys" "7.18.0"
graphemer "^1.4.0"
ignore "^5.3.1"
natural-compare "^1.4.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/[email protected]":
version "8.0.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.0.0.tgz#0fee96f6b691e4bfb9c260fd77d1c86bfbac4f56"
Expand All @@ -2779,17 +2764,6 @@
natural-compare "^1.4.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/[email protected]":
version "7.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.18.0.tgz#83928d0f1b7f4afa974098c64b5ce6f9051f96a0"
integrity sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==
dependencies:
"@typescript-eslint/scope-manager" "7.18.0"
"@typescript-eslint/types" "7.18.0"
"@typescript-eslint/typescript-estree" "7.18.0"
"@typescript-eslint/visitor-keys" "7.18.0"
debug "^4.3.4"

"@typescript-eslint/[email protected]":
version "8.0.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.0.0.tgz#5a5030cf8123176b5a0abd966f99e5f9f110652d"
Expand Down Expand Up @@ -2825,16 +2799,6 @@
"@typescript-eslint/types" "8.0.0"
"@typescript-eslint/visitor-keys" "8.0.0"

"@typescript-eslint/[email protected]":
version "7.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz#2165ffaee00b1fbbdd2d40aa85232dab6998f53b"
integrity sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==
dependencies:
"@typescript-eslint/typescript-estree" "7.18.0"
"@typescript-eslint/utils" "7.18.0"
debug "^4.3.4"
ts-api-utils "^1.3.0"

"@typescript-eslint/[email protected]":
version "8.0.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.0.0.tgz#facecaf0736bfe8394b9290382f300554cf90884"
Expand Down Expand Up @@ -2901,16 +2865,6 @@
semver "^7.6.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/[email protected]", "@typescript-eslint/utils@^7.4.0":
version "7.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.18.0.tgz#bca01cde77f95fc6a8d5b0dbcbfb3d6ca4be451f"
integrity sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==
dependencies:
"@eslint-community/eslint-utils" "^4.4.0"
"@typescript-eslint/scope-manager" "7.18.0"
"@typescript-eslint/types" "7.18.0"
"@typescript-eslint/typescript-estree" "7.18.0"

"@typescript-eslint/[email protected]":
version "8.0.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.0.0.tgz#1794d6f4b37ec253172a173dc938ae68651b9b99"
Expand All @@ -2935,6 +2889,16 @@
eslint-scope "^5.1.1"
semver "^7.3.7"

"@typescript-eslint/utils@^7.4.0":
version "7.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.18.0.tgz#bca01cde77f95fc6a8d5b0dbcbfb3d6ca4be451f"
integrity sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==
dependencies:
"@eslint-community/eslint-utils" "^4.4.0"
"@typescript-eslint/scope-manager" "7.18.0"
"@typescript-eslint/types" "7.18.0"
"@typescript-eslint/typescript-estree" "7.18.0"

"@typescript-eslint/[email protected]":
version "5.62.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz#2174011917ce582875954ffe2f6912d5931e353e"
Expand Down Expand Up @@ -10130,14 +10094,14 @@ typed-array-length@^1.0.6:
is-typed-array "^1.1.13"
possible-typed-array-names "^1.0.0"

typescript-eslint@7.18.0:
version "7.18.0"
resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-7.18.0.tgz#e90d57649b2ad37a7475875fa3e834a6d9f61eb2"
integrity sha512-PonBkP603E3tt05lDkbOMyaxJjvKqQrXsnow72sVeOFINDE/qNmnnd+f9b4N+U7W6MXnnYyrhtmF2t08QWwUbA==
typescript-eslint@8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-8.0.0.tgz#4d9098755d617d723853563a7ea41d2c6b1c3943"
integrity sha512-yQWBJutWL1PmpmDddIOl9/Mi6vZjqNCjqSGBMQ4vsc2Aiodk0SnbQQWPXbSy0HNuKCuGkw1+u4aQ2mO40TdhDQ==
dependencies:
"@typescript-eslint/eslint-plugin" "7.18.0"
"@typescript-eslint/parser" "7.18.0"
"@typescript-eslint/utils" "7.18.0"
"@typescript-eslint/eslint-plugin" "8.0.0"
"@typescript-eslint/parser" "8.0.0"
"@typescript-eslint/utils" "8.0.0"

[email protected]:
version "5.4.2"
Expand Down

0 comments on commit 7d3f45b

Please sign in to comment.