From c16b4030febfb24fe82358a0ee18c55a52edf94f Mon Sep 17 00:00:00 2001 From: AmauryD Date: Tue, 13 Feb 2024 20:59:08 +0100 Subject: [PATCH] repair linting --- ember-flatpickr/.eslintrc.js | 7 +------ ember-flatpickr/src/components/ember-flatpickr.ts | 15 ++++++++------- .../src/initializers/ember-flatpickr.ts | 6 +++--- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ember-flatpickr/.eslintrc.js b/ember-flatpickr/.eslintrc.js index 7bc4e581..b28c361b 100644 --- a/ember-flatpickr/.eslintrc.js +++ b/ember-flatpickr/.eslintrc.js @@ -49,17 +49,12 @@ module.exports = { // Typescript files { parser: '@typescript-eslint/parser', - files: ['addon/**/*.ts'], + files: ['src/**/*.ts'], plugins: ['@typescript-eslint'], extends: ['plugin:@typescript-eslint/recommended'], rules: { 'prefer-rest-params': 'off', }, }, - { - // test files - files: ['tests/**/*-test.{js,ts}'], - extends: ['plugin:qunit/recommended'], - }, ], }; diff --git a/ember-flatpickr/src/components/ember-flatpickr.ts b/ember-flatpickr/src/components/ember-flatpickr.ts index 48e9abfc..6d47df4c 100644 --- a/ember-flatpickr/src/components/ember-flatpickr.ts +++ b/ember-flatpickr/src/components/ember-flatpickr.ts @@ -10,7 +10,6 @@ import flatpickr from 'flatpickr'; /* Replace getOwner from @ember/application to @ember/owner when we can do a conditional macro for ember < 4.10 or ember 4.x is not supported by ember-flatpickr anymore */ import { getOwner } from '@ember/application'; - interface EmberFlatpickrArgs extends FlatpickrOptions { date: FlatpickrOptions['defaultDate']; disabled: boolean; @@ -18,7 +17,7 @@ interface EmberFlatpickrArgs extends FlatpickrOptions { type FastbootService = { isFastBoot: boolean; -} +}; /** * Ember component that wraps the lightweight [`flatpickr`](https://flatpickr.js.org) datetime @@ -92,19 +91,19 @@ export default class EmberFlatpickr extends Component { // Require that users pass a date assert( ' requires a `date` to be passed as the value for flatpickr.', - date !== undefined + date !== undefined, ); // Require that users pass an onChange assert( ' requires an `onChange` action or null for no action.', - onChange !== undefined + onChange !== undefined, ); // Wrap is not supported assert( ' does not support the wrap option. Please see documentation for an alternative.', - wrap !== true + wrap !== true, ); // Pass all values and setup flatpickr @@ -112,7 +111,9 @@ export default class EmberFlatpickr extends Component { } _setFlatpickrOptions(element: HTMLInputElement): void { - const fastboot = getOwner(this)?.lookup('service:fastboot') as unknown as (FastbootService | undefined); + const fastboot = getOwner(this)?.lookup('service:fastboot') as unknown as + | FastbootService + | undefined; if (fastboot && fastboot['isFastBoot']) { return; @@ -129,7 +130,7 @@ export default class EmberFlatpickr extends Component { } = this.args; const config: Partial = Object.fromEntries( - Object.entries(rest).filter((entry) => entry[1] !== undefined) + Object.entries(rest).filter((entry) => entry[1] !== undefined), ); this.flatpickrRef = flatpickr(element, { diff --git a/ember-flatpickr/src/initializers/ember-flatpickr.ts b/ember-flatpickr/src/initializers/ember-flatpickr.ts index 61217cd8..57e9ab6d 100644 --- a/ember-flatpickr/src/initializers/ember-flatpickr.ts +++ b/ember-flatpickr/src/initializers/ember-flatpickr.ts @@ -1,11 +1,11 @@ -import flatpickr from "flatpickr"; +import flatpickr from 'flatpickr'; export function initialize() { if (window) { window.flatpickr = flatpickr; } -}; +} export default { - initialize + initialize, };