Update tslint config and update code to conform.
parent
3d67ad13b6
commit
9913adc756
@ -1,114 +1,112 @@
|
|||||||
declare module 'ical.js' {
|
declare module 'ical.js' {
|
||||||
function parse(input: string): Array<any>;
|
function parse(input: string): any[];
|
||||||
class Component {
|
class Component {
|
||||||
name: string;
|
static public fromString(str: string): Component;
|
||||||
|
|
||||||
static fromString(str: string): Component;
|
public name: string;
|
||||||
|
|
||||||
constructor(jCal: Array<any> | string, parent?: Component);
|
constructor(jCal: any[] | string, parent?: Component);
|
||||||
|
|
||||||
toJSON(): Array<any>;
|
public toJSON(): any[];
|
||||||
|
|
||||||
getFirstSubcomponent(name?: string): Component | null;
|
public getFirstSubcomponent(name?: string): Component | null;
|
||||||
|
|
||||||
getFirstPropertyValue(name?: string): any;
|
public getFirstPropertyValue(name?: string): any;
|
||||||
|
|
||||||
getFirstProperty(name?: string): Property;
|
public getFirstProperty(name?: string): Property;
|
||||||
getAllProperties(name?: string): Array<Property>;
|
public getAllProperties(name?: string): Property[];
|
||||||
|
|
||||||
addProperty(property: Property): Property;
|
public addProperty(property: Property): Property;
|
||||||
addPropertyWithValue(name: string, value: string | number | object): Property;
|
public addPropertyWithValue(name: string, value: string | number | object): Property;
|
||||||
|
|
||||||
updatePropertyWithValue(name: string, value: string | number | object): Property;
|
public updatePropertyWithValue(name: string, value: string | number | object): Property;
|
||||||
|
|
||||||
removeAllProperties(name?: string): boolean;
|
public removeAllProperties(name?: string): boolean;
|
||||||
|
|
||||||
addSubcomponent(component: Component): Component;
|
public addSubcomponent(component: Component): Component;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Event {
|
class Event {
|
||||||
uid: string;
|
public uid: string;
|
||||||
summary: string;
|
public summary: string;
|
||||||
startDate: Time;
|
public startDate: Time;
|
||||||
endDate: Time;
|
public endDate: Time;
|
||||||
description: string;
|
public description: string;
|
||||||
location: string;
|
public location: string;
|
||||||
attendees: Array<Property>;
|
public attendees: Property[];
|
||||||
|
|
||||||
component: Component;
|
public component: Component;
|
||||||
|
|
||||||
isRecurring(): boolean;
|
public constructor(component?: Component | null, options?: {strictExceptions: boolean, exepctions: Array<Component | Event>});
|
||||||
iterator(startTime?: Time): RecurExpansion;
|
|
||||||
|
|
||||||
constructor(component?: Component | null,
|
public isRecurring(): boolean;
|
||||||
options?: {strictExceptions: boolean, exepctions: Array<Component|Event>});
|
public iterator(startTime?: Time): RecurExpansion;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Property {
|
class Property {
|
||||||
name: string;
|
public name: string;
|
||||||
type: string;
|
public type: string;
|
||||||
|
|
||||||
constructor(jCal: Array<any> | string, parent?: Component);
|
constructor(jCal: any[] | string, parent?: Component);
|
||||||
|
|
||||||
getFirstValue(): any;
|
public getFirstValue(): any;
|
||||||
getValues(): Array<any>;
|
public getValues(): any[];
|
||||||
|
|
||||||
setParameter(name: string, value: string | Array<string>): void;
|
public setParameter(name: string, value: string | string[]): void;
|
||||||
setValue(value: string | object): void;
|
public setValue(value: string | object): void;
|
||||||
toJSON(): any;
|
public toJSON(): any;
|
||||||
}
|
}
|
||||||
|
|
||||||
type TimeJsonData = {
|
interface TimeJsonData {
|
||||||
year?: number,
|
year?: number;
|
||||||
month?: number,
|
month?: number;
|
||||||
day?: number,
|
day?: number;
|
||||||
hour?: number,
|
hour?: number;
|
||||||
minute?: number,
|
minute?: number;
|
||||||
second?: number,
|
second?: number;
|
||||||
isDate?: boolean
|
isDate?: boolean;
|
||||||
};
|
}
|
||||||
|
|
||||||
class Time {
|
class Time {
|
||||||
isDate: boolean;
|
static public fromString(str: string): Time;
|
||||||
timezone: string;
|
static public fromJSDate(aDate: Date | null, useUTC: boolean): Time;
|
||||||
zone: Timezone;
|
static public fromData(aData: TimeJsonData): Time;
|
||||||
|
|
||||||
static fromString(str: string): Time;
|
static public now(): Time;
|
||||||
static fromJSDate(aDate: Date | null, useUTC: boolean): Time;
|
|
||||||
static fromData(aData: TimeJsonData): Time;
|
|
||||||
|
|
||||||
static now(): Time;
|
public isDate: boolean;
|
||||||
|
public timezone: string;
|
||||||
|
public zone: Timezone;
|
||||||
|
|
||||||
constructor(data?: TimeJsonData);
|
constructor(data?: TimeJsonData);
|
||||||
|
public compare(aOther: Time): number;
|
||||||
|
|
||||||
compare(aOther: Time): number;
|
public clone(): Time;
|
||||||
|
|
||||||
clone(): Time;
|
|
||||||
|
|
||||||
adjust(
|
public adjust(
|
||||||
aExtraDays: number, aExtraHours: number, aExtraMinutes: number, aExtraSeconds: number, aTimeopt?: Time): void;
|
aExtraDays: number, aExtraHours: number, aExtraMinutes: number, aExtraSeconds: number, aTimeopt?: Time): void;
|
||||||
|
|
||||||
addDuration(aDuration: Duration): void;
|
public addDuration(aDuration: Duration): void;
|
||||||
subtractDateTz(aDate: Time): Duration;
|
public subtractDateTz(aDate: Time): Duration;
|
||||||
|
|
||||||
toJSDate(): Date;
|
public toJSDate(): Date;
|
||||||
toJSON(): TimeJsonData;
|
public toJSON(): TimeJsonData;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Duration {
|
class Duration {
|
||||||
days: number;
|
public days: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
class RecurExpansion {
|
class RecurExpansion {
|
||||||
complete: boolean;
|
public complete: boolean;
|
||||||
|
|
||||||
next(): Time;
|
public next(): Time;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Timezone {
|
class Timezone {
|
||||||
static localTimezone: Timezone;
|
static public localTimezone: Timezone;
|
||||||
static convert_time(tt: Time, from_zone: Timezone, to_zone: Timezone): Time;
|
static public convert_time(tt: Time, fromZone: Timezone, toZone: Timezone): Time;
|
||||||
|
|
||||||
tzid: string;
|
public tzid: string;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,99 +1,38 @@
|
|||||||
{
|
{
|
||||||
"extends": ["tslint-react"],
|
"extends": ["tslint:recommended", "tslint-react"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"align": [
|
"interface-name": [true, "never-prefix"],
|
||||||
true,
|
"ordered-imports": false,
|
||||||
"parameters",
|
"jsx-curly-spacing": [true, "never"],
|
||||||
"arguments",
|
"jsx-no-bind": [true, "allowArrowFunctions"],
|
||||||
"statements"
|
"jsx-no-lambda": [false],
|
||||||
],
|
"jsx-no-multiline-js": false,
|
||||||
"ban": false,
|
"max-classes-per-file": [false, 0],
|
||||||
"class-name": true,
|
"max-line-length": false,
|
||||||
"comment-format": [
|
"no-consecutive-blank-lines": false,
|
||||||
true,
|
"no-conditional-assignment": false,
|
||||||
"check-space"
|
"object-literal-sort-keys": false,
|
||||||
],
|
"quotemark": [true, "single", "jsx-double", "avoid-escape", "avoid-template"],
|
||||||
"curly": true,
|
"semicolon": [true, "always", "ignore-bound-class-methods"],
|
||||||
"eofline": false,
|
"variable-name": [true, "ban-keywords", "check-format", "allow-pascal-case", "allow-leading-underscore"],
|
||||||
"forin": true,
|
"trailing-comma": [
|
||||||
"indent": [ true, "spaces" ],
|
true,
|
||||||
"interface-name": [true, "never-prefix"],
|
{
|
||||||
"jsdoc-format": true,
|
"multiline": {
|
||||||
"jsx-no-lambda": false,
|
"objects": "always",
|
||||||
"jsx-no-multiline-js": false,
|
"arrays": "always",
|
||||||
"label-position": true,
|
"functions": "never",
|
||||||
"max-line-length": [ true, 120 ],
|
"typeLiterals": "ignore"
|
||||||
"member-ordering": [
|
},
|
||||||
true,
|
"esSpecCompliant": true
|
||||||
"public-before-private",
|
}
|
||||||
"static-before-instance",
|
],
|
||||||
"variables-before-functions"
|
"whitespace": [true,"check-branch", "check-decl", "check-operator", "check-module", "check-separator", "check-rest-spread", "check-type", "check-typecast", "check-type-operator", "check-preblock"]
|
||||||
],
|
},
|
||||||
"no-any": false,
|
"linterOptions": {
|
||||||
"no-arg": true,
|
"exclude": [
|
||||||
"no-bitwise": true,
|
"config/**/*.js",
|
||||||
"no-console": [
|
"node_modules/**/*.ts"
|
||||||
true,
|
]
|
||||||
"log",
|
}
|
||||||
"error",
|
|
||||||
"debug",
|
|
||||||
"info",
|
|
||||||
"time",
|
|
||||||
"timeEnd",
|
|
||||||
"trace"
|
|
||||||
],
|
|
||||||
"no-consecutive-blank-lines": true,
|
|
||||||
"no-construct": true,
|
|
||||||
"no-debugger": true,
|
|
||||||
"no-duplicate-variable": true,
|
|
||||||
"no-empty": true,
|
|
||||||
"no-eval": true,
|
|
||||||
"no-shadowed-variable": true,
|
|
||||||
"no-string-literal": true,
|
|
||||||
"no-switch-case-fall-through": true,
|
|
||||||
"no-trailing-whitespace": false,
|
|
||||||
"no-unused-expression": true,
|
|
||||||
"no-use-before-declare": true,
|
|
||||||
"one-line": [
|
|
||||||
true,
|
|
||||||
"check-catch",
|
|
||||||
"check-else",
|
|
||||||
"check-open-brace",
|
|
||||||
"check-whitespace"
|
|
||||||
],
|
|
||||||
"quotemark": [true, "single", "jsx-double"],
|
|
||||||
"radix": true,
|
|
||||||
"semicolon": [true, "always"],
|
|
||||||
"switch-default": true,
|
|
||||||
|
|
||||||
"trailing-comma": false,
|
|
||||||
|
|
||||||
"triple-equals": [ true, "allow-null-check" ],
|
|
||||||
"typedef": [
|
|
||||||
true,
|
|
||||||
"parameter",
|
|
||||||
"property-declaration"
|
|
||||||
],
|
|
||||||
"typedef-whitespace": [
|
|
||||||
true,
|
|
||||||
{
|
|
||||||
"call-signature": "nospace",
|
|
||||||
"index-signature": "nospace",
|
|
||||||
"parameter": "nospace",
|
|
||||||
"property-declaration": "nospace",
|
|
||||||
"variable-declaration": "nospace"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"variable-name": [true, "ban-keywords", "check-format", "allow-leading-underscore", "allow-pascal-case"],
|
|
||||||
"whitespace": [
|
|
||||||
true,
|
|
||||||
"check-branch",
|
|
||||||
"check-decl",
|
|
||||||
"check-module",
|
|
||||||
"check-operator",
|
|
||||||
"check-separator",
|
|
||||||
"check-type",
|
|
||||||
"check-typecast"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue