Fix lint issues

This commit is contained in:
Georgi Gardev
2022-12-01 15:58:00 +02:00
parent 2194e049e3
commit 05a1048bde
4 changed files with 5 additions and 6 deletions

View File

@@ -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"]
}

View File

@@ -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) {}
}
);

View File

@@ -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;
}

View File

@@ -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!);
}