Enable eslint for type definitions and fix issues.

master
Tom Hacohen 4 years ago
parent 616052ecc5
commit 728ac6124f

@ -37,7 +37,7 @@
"start": "react-scripts start", "start": "react-scripts start",
"build": "react-scripts build", "build": "react-scripts build",
"test": "react-scripts test --env=jsdom", "test": "react-scripts test --env=jsdom",
"lint": "eslint --ext .js,.jsx,.ts,.tsx --ignore-pattern '*.d.ts' src", "lint": "eslint --ext .js,.jsx,.ts,.tsx src",
"eject": "react-scripts eject" "eject": "react-scripts eject"
}, },
"devDependencies": { "devDependencies": {

@ -1,10 +1,13 @@
// SPDX-FileCopyrightText: © 2017 EteSync Authors // SPDX-FileCopyrightText: © 2017 EteSync Authors
// SPDX-License-Identifier: AGPL-3.0-only // SPDX-License-Identifier: AGPL-3.0-only
// Disable some style eslint rules for things we can't control
/* eslint-disable @typescript-eslint/camelcase, @typescript-eslint/class-name-casing */
declare module 'ical.js' { declare module 'ical.js' {
function parse(input: string): any[]; function parse(input: string): any[];
class helpers { // tslint:disable-line:class-name export class helpers {
static public updateTimezones(vcal: Component): Component; static public updateTimezones(vcal: Component): Component;
} }
@ -35,7 +38,7 @@ declare module 'ical.js' {
public addSubcomponent(component: Component): Component; public addSubcomponent(component: Component): Component;
} }
class Event { export class Event {
public uid: string; public uid: string;
public summary: string; public summary: string;
public startDate: Time; public startDate: Time;
@ -52,7 +55,7 @@ declare module 'ical.js' {
public iterator(startTime?: Time): RecurExpansion; public iterator(startTime?: Time): RecurExpansion;
} }
class Property { export class Property {
public name: string; public name: string;
public type: string; public type: string;
@ -77,7 +80,7 @@ declare module 'ical.js' {
isDate?: boolean; isDate?: boolean;
} }
class Time { export class Time {
static public fromString(str: string): Time; static public fromString(str: string): Time;
static public fromJSDate(aDate: Date | null, useUTC: boolean): Time; static public fromJSDate(aDate: Date | null, useUTC: boolean): Time;
static public fromData(aData: TimeJsonData): Time; static public fromData(aData: TimeJsonData): Time;
@ -112,35 +115,36 @@ declare module 'ical.js' {
public toJSON(): TimeJsonData; public toJSON(): TimeJsonData;
} }
class Duration { export class Duration {
public days: number; public days: number;
} }
class RecurExpansion { export class RecurExpansion {
public complete: boolean; public complete: boolean;
public next(): Time; public next(): Time;
} }
class Timezone { export class Timezone {
static public utcTimezone: Timezone; static public utcTimezone: Timezone;
static public localTimezone: Timezone; static public localTimezone: Timezone;
static public convert_time(tt: Time, fromZone: Timezone, toZone: Timezone): Time; static public convert_time(tt: Time, fromZone: Timezone, toZone: Timezone): Time;
public tzid: string; public tzid: string;
public component: Component; public component: Component;
constructor(data: Component | { constructor(data: Component | {
component: string | Component, component: string | Component;
tzid?: string, tzid?: string;
location?: string, location?: string;
tznames?: string, tznames?: string;
latitude?: number, latitude?: number;
longitude?: number, longitude?: number;
}); });
} }
class TimezoneService { export class TimezoneService {
static public get(tzid: string): Timezone | null; static public get(tzid: string): Timezone | null;
static public has(tzid: string): boolean; static public has(tzid: string): boolean;
static public register(tzid: string, zone: Timezone | Component); static public register(tzid: string, zone: Timezone | Component);

Loading…
Cancel
Save