Skip to content

Commit

Permalink
chore: fix eslint --fix mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
nsbarsukov committed Feb 29, 2024
1 parent bf8e2f2 commit db451ad
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 45 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = {
rules: {
'@taiga-ui/experience/strict-tui-doc-example': 'off',
'@typescript-eslint/consistent-type-assertions': 'off',
'@typescript-eslint/member-ordering': 'off',
},
},
],
Expand Down
4 changes: 2 additions & 2 deletions projects/angular/src/lib/maskito.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ describe('Maskito Angular package', () => {
`,
})
class TestComponent {
protected readonly control = new FormControl();
protected options: MaskitoOptions | null = {
public readonly control = new FormControl();
public options: MaskitoOptions | null = {
mask: /^\d+(,\d{0,2})?$/,
preprocessors: [
({elementState, data}) => {
Expand Down
10 changes: 5 additions & 5 deletions projects/core/src/lib/classes/mask-model/mask-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ export class MaskModel implements ElementState {
public selection: SelectionRange = [0, 0];

constructor(
protected readonly initialElementState: ElementState,
private readonly initialElementState: ElementState,
private readonly maskOptions: Required<MaskitoOptions>,
) {
const {value, selection} = calibrateValueByMask(
initialElementState,
this.getMaskExpression(initialElementState),
this.initialElementState,
this.getMaskExpression(this.initialElementState),
);

this.value = value;
this.selection = selection;
}

protected addCharacters([from, to]: SelectionRange, newCharacters: string): void {
public addCharacters([from, to]: SelectionRange, newCharacters: string): void {
const {value} = this;
const maskExpression = this.getMaskExpression({
value: value.slice(0, from) + newCharacters + value.slice(to),
Expand Down Expand Up @@ -78,7 +78,7 @@ export class MaskModel implements ElementState {
this.selection = maskedElementState.selection;
}

protected deleteCharacters([from, to]: SelectionRange): void {
public deleteCharacters([from, to]: SelectionRange): void {
if (from === to || !to) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion projects/core/src/lib/mask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class Maskito extends MaskHistory {
return maxLength === -1 ? Infinity : maxLength;
}

protected destroy(): void {
public destroy(): void {
this.eventListener.destroy();
this.teardowns.forEach(teardown => teardown?.());
}
Expand Down
4 changes: 2 additions & 2 deletions projects/core/src/lib/utils/dom/event-listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export class EventListener {

constructor(private readonly element: HTMLElement) {}

protected listen<E extends keyof HTMLElementEventMap>(
public listen<E extends keyof HTMLElementEventMap>(
eventType: E,
fn: (
event: E extends 'beforeinput' | 'input'
Expand All @@ -20,7 +20,7 @@ export class EventListener {
this.listeners.push(() => this.element.removeEventListener(eventType, untypedFn));
}

protected destroy(): void {
public destroy(): void {
this.listeners.forEach(stopListen => stopListen());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,16 @@ export class DateRangeMaskDocComponent implements GeneratorOptions {
{year: 1},
];

protected mode: MaskitoDateMode = this.modeOptions[0];
protected minStr = this.minMaxOptions[0];
protected maxStr = this.minMaxOptions[1];
protected min = new Date(this.minStr);
protected max = new Date(this.maxStr);
protected minLength: Partial<MaskitoDateSegments<number>> = {};
protected maxLength: Partial<MaskitoDateSegments<number>> = {};
protected dateSeparator = '.';
protected rangeSeparator = ' – ';

public mode: MaskitoDateMode = this.modeOptions[0];
public min = new Date(this.minStr);
public max = new Date(this.maxStr);
public minLength: Partial<MaskitoDateSegments<number>> = {};
public maxLength: Partial<MaskitoDateSegments<number>> = {};
public dateSeparator = '.';
public rangeSeparator = ' – ';

protected maskitoOptions: MaskitoOptions = maskitoDateRangeOptionsGenerator(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,14 @@ export class DateTimeMaskDocComponent implements GeneratorOptions {
'2025-05-10T18:30',
];

protected dateMode: MaskitoDateMode = this.dateModeOptions[0];
protected timeMode: MaskitoTimeMode = this.timeModeOptions[0];
protected dateSeparator = '.';
protected minStr = this.minMaxOptions[0];
protected maxStr = this.minMaxOptions[1];
protected min = new Date(this.minStr);
protected max = new Date(this.maxStr);

public dateMode: MaskitoDateMode = this.dateModeOptions[0];
public timeMode: MaskitoTimeMode = this.timeModeOptions[0];
public dateSeparator = '.';
public min = new Date(this.minStr);
public max = new Date(this.maxStr);

protected maskitoOptions: MaskitoOptions = maskitoDateTimeOptionsGenerator(this);

Expand Down
8 changes: 4 additions & 4 deletions projects/demo/src/pages/kit/date/date-mask-doc.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ export class DateMaskDocComponent implements GeneratorOptions {
protected minStr = this.minMaxOptions[0];
protected maxStr = this.minMaxOptions[1];

protected mode: MaskitoDateMode = this.modeOptions[0];
protected separator = this.separatorOptions[0];
public mode: MaskitoDateMode = this.modeOptions[0];
public separator = this.separatorOptions[0];

protected min = new Date(this.minStr);
protected max = new Date(this.maxStr);
public min = new Date(this.minStr);
public max = new Date(this.maxStr);

protected maskitoOptions: MaskitoOptions = maskitoDateOptionsGenerator(this);

Expand Down
18 changes: 9 additions & 9 deletions projects/demo/src/pages/kit/number/number-mask-doc.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ export class NumberMaskDocComponent implements GeneratorOptions {

protected readonly precisionOptions: number[] = [0, 1, 2, 5, 10, Infinity];

protected precision = 0;
protected max = Number.MAX_SAFE_INTEGER;
protected min = Number.MIN_SAFE_INTEGER;
protected decimalSeparator = '.';
protected decimalZeroPadding = false;
protected decimalPseudoSeparators = this.decimalPseudoSeparatorsOptions[0];
protected thousandSeparator = ' ';
protected prefix = '';
protected postfix = '';
public precision = 0;
public max = Number.MAX_SAFE_INTEGER;
public min = Number.MIN_SAFE_INTEGER;
public decimalSeparator = '.';
public decimalZeroPadding = false;
public decimalPseudoSeparators = this.decimalPseudoSeparatorsOptions[0];
public thousandSeparator = ' ';
public prefix = '';
public postfix = '';

protected maskitoOptions: MaskitoOptions = this.calculateMask(this);

Expand Down
4 changes: 2 additions & 2 deletions projects/demo/src/pages/kit/time/time-mask-doc.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export class TimeMaskDocComponent implements GeneratorOptions {
Partial<MaskitoTimeSegments<number>>
> = [{hours: 23, minutes: 59, seconds: 59, milliseconds: 999}, {hours: 11}];

protected mode: MaskitoTimeMode = this.modeOptions[0];
protected timeSegmentMaxValues: Partial<MaskitoTimeSegments<number>> =
public mode: MaskitoTimeMode = this.modeOptions[0];
public timeSegmentMaxValues: Partial<MaskitoTimeSegments<number>> =
this.timeSegmentMaxValuesOptions[0];

protected maskitoOptions: MaskitoOptions = maskitoTimeOptionsGenerator(this);
Expand Down
11 changes: 4 additions & 7 deletions projects/demo/src/pages/phone/phone-doc.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,15 @@ export class PhoneDocComponent implements GeneratorOptions {
),
};

protected metadata = metadata;

protected strict = true;
public metadata = metadata;
public strict = true;
public countryIsoCode: CountryCode = 'RU';
public separator = '-';

protected countryCodeVariants = getCountries(this.metadata);

protected countryIsoCode: CountryCode = 'RU';

protected separatorVariants = ['-', ' '];

protected separator = '-';

protected maskitoOptions = maskitoPhoneOptionsGenerator(this);

protected get pattern(): string {
Expand Down
2 changes: 1 addition & 1 deletion projects/demo/src/pages/stackblitz/stackblitz.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class StackblitzService implements TuiCodeEditor {
);
}

protected openStarter(
public openStarter(
{title, description, files}: Pick<Project, 'description' | 'files' | 'title'>,
openOptions?: OpenOptions,
): void {
Expand Down

0 comments on commit db451ad

Please sign in to comment.