mirror of
https://github.com/GeorgeSG/lovelace-time-picker-card.git
synced 2025-12-28 21:00:29 +00:00
Fix lint issues
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
"parser": "@typescript-eslint/parser", // Specifies the ESLint parser
|
||||
"extends": [
|
||||
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
|
||||
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
|
||||
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
|
||||
],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018, // Allows for the parsing of modern ECMAScript features
|
||||
@@ -14,7 +12,7 @@
|
||||
"@typescript-eslint/camelcase": 0,
|
||||
"@typescript-eslint/no-non-null-assertion": 0,
|
||||
"@typescript-eslint/explicit-function-return-type": [1, { "allowExpressions": true }],
|
||||
"@typescript-eslint/no-namespace": 0
|
||||
"@typescript-eslint/no-namespace": 0,
|
||||
},
|
||||
"ignorePatterns": ["dist/", "node_modules/", "*.js"]
|
||||
}
|
||||
|
||||
@@ -193,12 +193,13 @@ export const actionHandlerBind = (
|
||||
|
||||
export const actionHandler = directive(
|
||||
class extends Directive {
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
||||
update(part: AttributePart, [options]: DirectiveParameters<this>) {
|
||||
actionHandlerBind(part.element as ActionHandlerElement, options);
|
||||
return noChange;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-function-return-type
|
||||
render(_options?: ActionHandlerOptions) {}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -121,7 +121,7 @@ export class TimePickerCardEditor extends LitElement implements LovelaceCardEdit
|
||||
@property({ type: Object }) hass!: HomeAssistant;
|
||||
@property() private config!: TimePickerCardConfig;
|
||||
|
||||
private computeLabel({ name }) {
|
||||
private computeLabel({ name }): string {
|
||||
return NAME_TO_LABEL_MAP[name] || name;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ export class TimePickerCard extends LitElement implements LovelaceCard {
|
||||
};
|
||||
}
|
||||
|
||||
private handleAction(ev: ActionHandlerEvent) {
|
||||
private handleAction(ev: ActionHandlerEvent): void {
|
||||
handleAction(this, this.hass, this.config, ev.detail.action!);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user