Skip to content

Commit

Permalink
lint: enable erasableSyntaxOnly (#8230)
Browse files Browse the repository at this point in the history
  • Loading branch information
SevereCloud authored Feb 3, 2025
1 parent 5e4a670 commit 82df824
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
4 changes: 0 additions & 4 deletions packages/vkui/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ module.exports = {
selector: 'ImportDefaultSpecifier[local.name="React"][parent.source.value="react"]',
message: 'Не используйте импорт React по умолчанию',
},
{
selector: 'TSEnumDeclaration',
message: 'Не используйте enum',
},
],

'import/no-default-export': 'error',
Expand Down
3 changes: 2 additions & 1 deletion packages/vkui/src/lib/floating/customResizeObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ export class CustomResizeObserver {
iframe: HTMLIFrameElement;
}> = [];
mutationObserverFallback: MutationObserver | null = null;
private readonly updateFunction: () => void;

constructor(private readonly updateFunction: () => void) {
constructor(updateFunction: () => void) {
this.updateFunction = updateFunction;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ export type BottomSheetControllerOptions = {
};

export class BottomSheetController {
private readonly sheetEl: HTMLElement;

constructor(
private readonly sheetEl: HTMLElement,
sheetEl: HTMLElement,
{
sheetScrollEl,
sheetTransitionController,
Expand All @@ -36,6 +38,7 @@ export class BottomSheetController {
onDismiss,
}: BottomSheetControllerOptions,
) {
this.sheetEl = sheetEl;
this.onSnapPointChange = onSnapPointChange;
this.onDismiss = onDismiss;
this.panGestureRecognizer = new UIPanGestureRecognizer();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
export type CSSTransitionControllerUnit = 'px' | '%' | '';

export class CSSTransitionController<V extends number | string = number> {
constructor(
public readonly el: HTMLElement,
public readonly property: string,
) {}
public readonly el: HTMLElement;
public readonly property: string;

constructor(el: HTMLElement, property: string) {
this.el = el;
this.property = property;
}

set(to: V) {
this.el.style.setProperty(this.property, `${to}`);
Expand Down
10 changes: 6 additions & 4 deletions packages/vkui/src/testing/e2e/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ export function getAdaptivePxWidth(viewWidth: ViewWidthType) {
}

class CustomValueWithLabel<T> {
public constructor(
public value: T,
public label: string,
) {}
public value: T;
public label: string;
public constructor(value: T, label: string) {
this.value = value;
this.label = label;
}
}

type DecoratedPropValue<T> = T | CustomValueWithLabel<T>;
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"skipLibCheck": true,
"baseUrl": "./",
"outDir": ".cache/ts",
// "erasableSyntaxOnly": true, включить в v5.8.0
"paths": {
"@vkontakte/vkui": ["./packages/vkui/src"],
// FIXME дублируем, чтобы не падал `yarn run lint:types`.
Expand Down

0 comments on commit 82df824

Please sign in to comment.