Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mkszepp committed Aug 22, 2024
1 parent bc5e9cf commit 951442b
Show file tree
Hide file tree
Showing 5 changed files with 354 additions and 19 deletions.
14 changes: 7 additions & 7 deletions ember-power-datepicker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,21 @@
"dist"
],
"scripts": {
"build": "concurrently 'npm:build:*'",
"build": "concurrently 'pnpm:build:*'",
"build:js": "rollup --config",
"build:types": "glint --declaration",
"lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
"lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
"lint": "concurrently 'pnpm:lint:*(!fix)' --names 'lint:'",
"lint:fix": "concurrently 'pnpm:lint:*:fix' --names 'fix:'",
"lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"lint:types": "glint",
"prepack": "pnpm build",
"start": "concurrently 'npm:start:*'",
"prepack": "concurrently 'pnpm:build:*'",
"start": "concurrently 'pnpm:start:*'",
"start:js": "rollup --config --watch --no-watch.clearScreen",
"start:types": "glint --declaration --watch",
"test": "echo 'A v2 addon does not have tests, run tests in test-app'",
"prepare": "pnpm build"
"test": "echo 'A v2 addon does not have tests, run tests in test-app'"
},
"dependencies": {
"@embroider/addon-shim": "^1.8.7",
Expand Down Expand Up @@ -119,6 +118,7 @@
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^12.0.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.2.5",
Expand Down
36 changes: 25 additions & 11 deletions ember-power-datepicker/src/components/power-datepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@ import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import type { DropdownActions } from 'ember-basic-dropdown/components/basic-dropdown';
import type { CalculatePosition, VerticalPosition, HorizontalPosition } from 'ember-basic-dropdown/utils/calculate-position';
import type {
CalculatePosition,
VerticalPosition,
HorizontalPosition,
} from 'ember-basic-dropdown/utils/calculate-position';
import type { NormalizeCalendarValue } from 'ember-power-calendar/utils';
import type { CalendarDay, SelectedDays, PowerCalendarActions } from 'ember-power-calendar/components/power-calendar';
import type {
CalendarDay,
SelectedDays,
PowerCalendarActions,
} from 'ember-power-calendar/components/power-calendar';
import type { ComponentLike } from '@glint/template';

interface PowerDatepickerSignature {
Element: HTMLElement;
Args: PowerDatepickerArgs;
Blocks: {
default: [
PowerDatepickerDefaultBlock,
];
default: [PowerDatepickerDefaultBlock];
};
}

Expand All @@ -34,17 +40,17 @@ interface PowerDatepickerArgs {
locale?: string;
selected?: SelectedDays;
closeOnSelect?: boolean;
onCenterChange?: (
newCenter: NormalizeCalendarValue
) => void;
onCenterChange?: (newCenter: NormalizeCalendarValue) => void;
onSelect?: (
day: CalendarDay,
calendar: PowerDatepickerCalendar,
event: MouseEvent,
) => void | boolean;
}

interface PowerDatepickerActions extends DropdownActions, PowerCalendarActions {}
interface PowerDatepickerActions
extends DropdownActions,
PowerCalendarActions {}

export interface PowerDatepickerCalendar {
uniqueId: string;
Expand All @@ -59,9 +65,13 @@ export interface PowerDatepickerCalendar {
}

export interface PowerDatepickerDefaultBlock extends PowerDatepickerCalendar {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Trigger: ComponentLike<any>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Content: ComponentLike<any>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Nav: ComponentLike<any>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Days: ComponentLike<any>;
}

Expand All @@ -84,8 +94,12 @@ export default class PowerDatepickerComponent extends Component<PowerDatepickerS
}

@action
handleSelect(day: CalendarDay, datepicker: PowerDatepickerCalendar, e: MouseEvent) {
let value = this.args.onSelect && this.args.onSelect(day, datepicker, e);
handleSelect(
day: CalendarDay,
datepicker: PowerDatepickerCalendar,
e: MouseEvent,
) {
const value = this.args.onSelect && this.args.onSelect(day, datepicker, e);
if (value === false || !this.closeOnSelect) {
return;
}
Expand Down
1 change: 1 addition & 0 deletions ember-power-datepicker/src/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import '@glint/environment-ember-loose';
import type { EmbroiderUtilRegistry } from '@embroider/util';

export interface AssignRegistry {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@
"tokenRef": "GITHUB_AUTH"
},
"npm": false
}
},
"packageManager": "[email protected]+sha512.faf344af2d6ca65c4c5c8c2224ea77a81a5e8859cbc4e06b1511ddce2f0151512431dd19e6aff31f2c6a8f5f2aced9bd2273e1fed7dd4de1868984059d2c4247"
}
Loading

0 comments on commit 951442b

Please sign in to comment.