Update tslint config and update code to conform.

master
Tom Hacohen 6 years ago
parent 3d67ad13b6
commit 9913adc756

@ -52,6 +52,8 @@
"@types/sjcl": "^1.0.28",
"@types/urijs": "^1.15.38",
"@types/uuid": "^3.4.3",
"tslint": "^5.12.1",
"tslint-react": "^3.6.0",
"typescript": "^3.3.3"
},
"browserslist": [

@ -96,7 +96,7 @@ export const routeResolver = new RouteResolver({
const AppBarWitHistory = withRouter(
class extends React.PureComponent {
props: {
public props: {
title: string,
toggleDrawerIcon: any,
history?: History;
@ -110,19 +110,7 @@ const AppBarWitHistory = withRouter(
this.canGoBack = this.canGoBack.bind(this);
}
canGoBack() {
return (
(this.props.history!.length > 1) &&
(this.props.history!.location.pathname !== routeResolver.getRoute('pim')) &&
(this.props.history!.location.pathname !== routeResolver.getRoute('home'))
);
}
goBack() {
this.props.history!.goBack();
}
render() {
public render() {
const {
staticContext,
toggleDrawerIcon,
@ -136,7 +124,7 @@ const AppBarWitHistory = withRouter(
{...props}
>
<Toolbar>
<div style={{ marginLeft: -12, marginRight: 20, }}>
<div style={{ marginLeft: -12, marginRight: 20 }}>
{!this.canGoBack() ?
toggleDrawerIcon :
<IconButton onClick={this.goBack}><NavigationBack /></IconButton>
@ -152,17 +140,29 @@ const AppBarWitHistory = withRouter(
</AppBar>
);
}
private canGoBack() {
return (
(this.props.history!.length > 1) &&
(this.props.history!.location.pathname !== routeResolver.getRoute('pim')) &&
(this.props.history!.location.pathname !== routeResolver.getRoute('home'))
);
}
private goBack() {
this.props.history!.goBack();
}
},
);
const IconRefreshWithSpin = withSpin(NavigationRefresh);
class App extends React.PureComponent {
state: {
public state: {
drawerOpen: boolean,
};
props: {
public props: {
credentials: store.CredentialsType;
entries: store.EntriesType;
fetchCount: number;
@ -177,19 +177,7 @@ class App extends React.PureComponent {
this.refresh = this.refresh.bind(this);
}
toggleDrawer() {
this.setState({drawerOpen: !this.state.drawerOpen});
}
closeDrawer() {
this.setState({drawerOpen: false});
}
refresh() {
store.store.dispatch<any>(actions.fetchAll(this.props.credentials.value!, this.props.entries));
}
render() {
public render() {
const credentials = (this.props.credentials) ? this.props.credentials.value : null;
const fetching = this.props.fetchCount > 0;
@ -198,7 +186,7 @@ class App extends React.PureComponent {
main: {
backgroundColor: muiTheme.palette.background.default,
color: muiTheme.palette.text.primary,
flexGrow: 1
flexGrow: 1,
},
};
@ -229,6 +217,18 @@ class App extends React.PureComponent {
</ThemeProvider>
);
}
private toggleDrawer() {
this.setState({drawerOpen: !this.state.drawerOpen});
}
private closeDrawer() {
this.setState({drawerOpen: false});
}
private refresh() {
store.store.dispatch<any>(actions.fetchAll(this.props.credentials.value!, this.props.entries));
}
}
const credentialsSelector = createSelector(
@ -242,14 +242,14 @@ const credentialsSelector = createSelector(
}
return {
error: error,
fetching: fetching,
error,
fetching,
value: {
...value,
encryptionKey: encryptionKey,
}
encryptionKey,
},
};
}
},
);
const mapStateToProps = (state: store.StoreState) => {
@ -261,5 +261,5 @@ const mapStateToProps = (state: store.StoreState) => {
};
export default connect(
mapStateToProps
mapStateToProps,
)(App);

@ -59,7 +59,7 @@ const AddressBookItem = pure((_props: any) => {
});
const sortSelector = createSelector(
(entries: Array<ContactType>) => entries,
(entries: ContactType[]) => entries,
(entries) => {
return entries.sort((_a, _b) => {
const a = _a.fn;
@ -73,24 +73,24 @@ const sortSelector = createSelector(
return 0;
}
});
},
}
);
class AddressBook extends React.PureComponent {
props: {
entries: Array<ContactType>,
onItemClick: (contact: ContactType) => void,
filter?: (a: ContactType) => boolean,
};
interface PropsType {
entries: ContactType[];
onItemClick: (contact: ContactType) => void;
filter?: (a: ContactType) => boolean;
}
render() {
class AddressBook extends React.PureComponent<PropsType> {
public render() {
const sortedEntries = sortSelector(this.props.entries);
const entries = (this.props.filter) ?
sortedEntries.filter(this.props.filter)
: sortedEntries;
let itemList = entries.map((entry, idx, array) => {
const itemList = entries.map((entry, idx, array) => {
const uid = entry.uid;
return (

@ -17,7 +17,7 @@ function eventPropGetter(event: EventType) {
return {
style: {
backgroundColor: event.color,
}
},
};
}
@ -26,18 +26,18 @@ function agendaHeaderFormat(date: {start: Date, end: Date}, culture: string, loc
return localizer.format(date.start, format) + ' - ' + localizer.format(date.end, format);
}
class Calendar extends React.PureComponent {
state: {
interface PropsType {
entries: EventType[];
onItemClick: (contact: EventType) => void;
onSlotClick?: (start: Date, end: Date) => void;
}
class Calendar extends React.PureComponent<PropsType> {
public state: {
currentDate?: Date;
view?: View;
};
props: {
entries: Array<EventType>,
onItemClick: (contact: EventType) => void,
onSlotClick?: (start: Date, end: Date) => void,
};
constructor(props: any) {
super(props);
this.state = {};
@ -47,22 +47,8 @@ class Calendar extends React.PureComponent {
this.slotClicked = this.slotClicked.bind(this);
}
onNavigate(currentDate: Date) {
this.setState({currentDate});
}
onView(view: string) {
this.setState({view});
}
slotClicked(slotInfo: {start: Date, end: Date}) {
if (this.props.onSlotClick) {
this.props.onSlotClick(slotInfo.start, slotInfo.end);
}
}
render() {
const entries = [] as Array<EventType>;
public render() {
const entries = [] as EventType[];
this.props.entries.forEach((event) => {
entries.push(event);
@ -103,6 +89,20 @@ class Calendar extends React.PureComponent {
</div>
);
}
private onNavigate(currentDate: Date) {
this.setState({currentDate});
}
private onView(view: string) {
this.setState({view});
}
private slotClicked(slotInfo: {start: Date, end: Date}) {
if (this.props.onSlotClick) {
this.props.onSlotClick(slotInfo.start, slotInfo.end);
}
}
}
export default Calendar;

@ -11,7 +11,7 @@ export function createJournalEntry(
action: EteSync.SyncEntryAction,
content: string) {
let syncEntry = new EteSync.SyncEntry();
const syncEntry = new EteSync.SyncEntry();
syncEntry.action = action;
syncEntry.content = content;
@ -27,7 +27,7 @@ export function createJournalEntry(
} else {
cryptoManager = new EteSync.CryptoManager(derived, journal.uid, journal.version);
}
let entry = new EteSync.Entry();
const entry = new EteSync.Entry();
entry.setSyncEntry(cryptoManager, syncEntry, prevUid);
return createEntries(etesync, journal.uid, [entry], prevUid);

@ -8,10 +8,10 @@ import * as EteSync from './api/EteSync';
export function syncEntriesToItemMap(
collection: EteSync.CollectionInfo, entries: List<EteSync.SyncEntry>, base: {[key: string]: ContactType} = {}) {
let items = base;
const items = base;
entries.forEach((syncEntry) => {
let comp = new ContactType(new ICAL.Component(ICAL.parse(syncEntry.content)));
const comp = new ContactType(new ICAL.Component(ICAL.parse(syncEntry.content)));
const uid = comp.uid;
@ -42,7 +42,7 @@ function colorIntToHtml(color: number) {
// tslint:enable
function toHex(num: number) {
let ret = num.toString(16);
const ret = num.toString(16);
return (ret.length === 1) ? '0' + ret : ret;
}
@ -53,12 +53,12 @@ function colorIntToHtml(color: number) {
function syncEntriesToCalendarItemMap<T extends EventType>(
ItemType: any,
collection: EteSync.CollectionInfo, entries: List<EteSync.SyncEntry>, base: {[key: string]: T} = {}) {
let items = base;
const items = base;
const color = colorIntToHtml(collection.color);
entries.forEach((syncEntry) => {
let comp = ItemType.fromVCalendar(new ICAL.Component(ICAL.parse(syncEntry.content)));
const comp = ItemType.fromVCalendar(new ICAL.Component(ICAL.parse(syncEntry.content)));
if (comp === null) {
return;

@ -7,16 +7,16 @@ export interface PimType {
}
export class EventType extends ICAL.Event implements PimType {
color: string;
static isEvent(comp: ICAL.Component) {
public static isEvent(comp: ICAL.Component) {
return !!comp.getFirstSubcomponent('vevent');
}
static fromVCalendar(comp: ICAL.Component) {
public static fromVCalendar(comp: ICAL.Component) {
return new EventType(comp.getFirstSubcomponent('vevent'));
}
public color: string;
get timezone() {
if (this.startDate) {
return this.startDate.timezone;
@ -47,8 +47,8 @@ export class EventType extends ICAL.Event implements PimType {
return this.description;
}
toIcal() {
let comp = new ICAL.Component(['vcalendar', [], []]);
public toIcal() {
const comp = new ICAL.Component(['vcalendar', [], []]);
comp.updatePropertyWithValue('prodid', '-//iCal.js EteSync Web');
comp.updatePropertyWithValue('version', '4.0');
@ -56,7 +56,7 @@ export class EventType extends ICAL.Event implements PimType {
return comp.toString();
}
clone() {
public clone() {
const ret = new EventType(new ICAL.Component(this.component.toJSON()));
ret.color = this.color;
return ret;
@ -71,12 +71,12 @@ export enum TaskStatusType {
}
export class TaskType extends EventType {
color: string;
static fromVCalendar(comp: ICAL.Component) {
public static fromVCalendar(comp: ICAL.Component) {
return new TaskType(comp.getFirstSubcomponent('vtodo'));
}
public color: string;
constructor(comp: ICAL.Component | null) {
super(comp ? comp : new ICAL.Component('vtodo'));
}
@ -106,7 +106,7 @@ export class TaskType extends EventType {
return this.component.getFirstPropertyValue('due');
}
clone() {
public clone() {
const ret = new TaskType(new ICAL.Component(this.component.toJSON()));
ret.color = this.color;
return ret;
@ -114,17 +114,17 @@ export class TaskType extends EventType {
}
export class ContactType implements PimType {
comp: ICAL.Component;
public comp: ICAL.Component;
constructor(comp: ICAL.Component) {
this.comp = comp;
}
toIcal() {
public toIcal() {
return this.comp.toString();
}
clone() {
public clone() {
return new ContactType(new ICAL.Component(this.comp.toJSON()));
}

@ -1,13 +1,15 @@
export type RouteKeysType = { [Identifier: string]: any };
export interface RouteKeysType {
[Identifier: string]: any;
}
export class RouteResolver {
routes: {};
public routes: {};
constructor(routes: {}) {
this.routes = routes;
}
getRoute(name: string, _keys?: RouteKeysType): string {
public getRoute(name: string, _keys?: RouteKeysType): string {
let dict = this.routes;
let path: string[] = [];
@ -19,7 +21,7 @@ export class RouteResolver {
});
if (_keys) {
let keys = Object.assign({}, _keys);
const keys = Object.assign({}, _keys);
path = path.map((pathComponent) => {
return pathComponent.split('/').map((val) => {

@ -48,7 +48,7 @@ export const { fetchListJournal } = createActions({
FETCH_LIST_JOURNAL: (etesync: CredentialsData) => {
const creds = etesync.credentials;
const apiBase = etesync.serviceApiUrl;
let journalManager = new EteSync.JournalManager(creds, apiBase);
const journalManager = new EteSync.JournalManager(creds, apiBase);
return journalManager.list();
},
@ -59,13 +59,13 @@ export const addJournal = createAction(
(etesync: CredentialsData, journal: EteSync.Journal) => {
const creds = etesync.credentials;
const apiBase = etesync.serviceApiUrl;
let journalManager = new EteSync.JournalManager(creds, apiBase);
const journalManager = new EteSync.JournalManager(creds, apiBase);
return journalManager.create(journal);
},
(etesync: CredentialsData, journal: EteSync.Journal) => {
return { item: journal };
},
}
);
export const updateJournal = createAction(
@ -73,13 +73,13 @@ export const updateJournal = createAction(
(etesync: CredentialsData, journal: EteSync.Journal) => {
const creds = etesync.credentials;
const apiBase = etesync.serviceApiUrl;
let journalManager = new EteSync.JournalManager(creds, apiBase);
const journalManager = new EteSync.JournalManager(creds, apiBase);
return journalManager.update(journal);
},
(etesync: CredentialsData, journal: EteSync.Journal) => {
return { item: journal };
},
}
);
export const deleteJournal = createAction(
@ -87,13 +87,13 @@ export const deleteJournal = createAction(
(etesync: CredentialsData, journal: EteSync.Journal) => {
const creds = etesync.credentials;
const apiBase = etesync.serviceApiUrl;
let journalManager = new EteSync.JournalManager(creds, apiBase);
const journalManager = new EteSync.JournalManager(creds, apiBase);
return journalManager.delete(journal);
},
(etesync: CredentialsData, journal: EteSync.Journal) => {
return { item: journal };
},
}
);
export const { fetchEntries, createEntries } = createActions({
@ -101,33 +101,33 @@ export const { fetchEntries, createEntries } = createActions({
(etesync: CredentialsData, journalUid: string, prevUid: string | null) => {
const creds = etesync.credentials;
const apiBase = etesync.serviceApiUrl;
let entryManager = new EteSync.EntryManager(creds, apiBase, journalUid);
const entryManager = new EteSync.EntryManager(creds, apiBase, journalUid);
return entryManager.list(prevUid);
},
(etesync: CredentialsData, journalUid: string, prevUid: string | null) => {
return { journal: journalUid, prevUid };
}
},
],
CREATE_ENTRIES: [
(etesync: CredentialsData, journalUid: string, newEntries: Array<EteSync.Entry>, prevUid: string | null) => {
(etesync: CredentialsData, journalUid: string, newEntries: EteSync.Entry[], prevUid: string | null) => {
const creds = etesync.credentials;
const apiBase = etesync.serviceApiUrl;
let entryManager = new EteSync.EntryManager(creds, apiBase, journalUid);
const entryManager = new EteSync.EntryManager(creds, apiBase, journalUid);
return entryManager.create(newEntries, prevUid).then(response => newEntries);
return entryManager.create(newEntries, prevUid).then((response) => newEntries);
},
(etesync: CredentialsData, journalUid: string, newEntries: Array<EteSync.Entry>, prevUid: string | null) => {
(etesync: CredentialsData, journalUid: string, newEntries: EteSync.Entry[], prevUid: string | null) => {
return { journal: journalUid, entries: newEntries, prevUid };
}
]
},
],
});
export const { fetchUserInfo } = createActions({
FETCH_USER_INFO: (etesync: CredentialsData, owner: string) => {
const creds = etesync.credentials;
const apiBase = etesync.serviceApiUrl;
let userInfoManager = new EteSync.UserInfoManager(creds, apiBase);
const userInfoManager = new EteSync.UserInfoManager(creds, apiBase);
return userInfoManager.fetch(owner);
},
@ -138,13 +138,13 @@ export const createUserInfo = createAction(
(etesync: CredentialsData, userInfo: UserInfo) => {
const creds = etesync.credentials;
const apiBase = etesync.serviceApiUrl;
let userInfoManager = new EteSync.UserInfoManager(creds, apiBase);
const userInfoManager = new EteSync.UserInfoManager(creds, apiBase);
return userInfoManager.create(userInfo);
},
(etesync: CredentialsData, userInfo: UserInfo) => {
return { userInfo };
},
}
);
export function fetchAll(etesync: CredentialsData, currentEntries: EntriesType) {
@ -176,5 +176,5 @@ export const setSettings = createAction(
'SET_SETTINGS',
(settings: SettingsType) => {
return {...settings};
},
}
);

@ -77,7 +77,7 @@ const entriesDeserialize = (state: EteSync.EntryJson[]): FetchType<EntriesData>
}
return new EntriesFetchRecord({value: List(state.map((x: any) => {
let ret = new EteSync.Entry();
const ret = new EteSync.Entry();
ret.deserialize(x);
return ret;
}))});
@ -96,14 +96,14 @@ const userInfoDeserialize = (state: EteSync.UserInfoJson) => {
return null;
}
let ret = new EteSync.UserInfo(state.owner!, state.version);
const ret = new EteSync.UserInfo(state.owner!, state.version);
ret.deserialize(state);
return ret;
};
const cacheSerialize = (state: any, key: string) => {
if (key === 'entries') {
let ret = {};
const ret = {};
state.forEach((value: FetchType<EntriesData>, mapKey: string) => {
ret[mapKey] = entriesSerialize(value);
});
@ -119,7 +119,7 @@ const cacheSerialize = (state: any, key: string) => {
const cacheDeserialize = (state: any, key: string) => {
if (key === 'entries') {
let ret = {};
const ret = {};
Object.keys(state).forEach((mapKey) => {
ret[mapKey] = entriesDeserialize(state[mapKey]);
});
@ -137,7 +137,7 @@ const cacheMigrations = {
0: (state: any) => {
return {
...state,
journals: undefined
journals: undefined,
};
},
};

@ -9,13 +9,13 @@ it('Entries reducer', () => {
const jId = '24324324324';
let state = Map({}) as EntriesTypeImmutable;
let entry = new EteSync.Entry();
const entry = new EteSync.Entry();
entry.deserialize({
content: 'someContent',
uid: '6355209e2a2c26a6c1e6e967c2032737d538f602cf912474da83a2902f8a0a83'
uid: '6355209e2a2c26a6c1e6e967c2032737d538f602cf912474da83a2902f8a0a83',
});
let action = {
const action = {
type: fetchEntries.toString(),
meta: {journal: jId, prevUid: null as string | null},
payload: [entry],

@ -11,7 +11,7 @@ import reducers from './construct';
export * from './reducers';
export * from './construct';
let middleware = [
const middleware = [
thunkMiddleware,
promiseMiddleware,
];

@ -208,7 +208,7 @@ export const journals = handleActions(
{
...mapReducerActionsMapCreator<JournalsTypeImmutable, EteSync.Journal>('Journal'),
},
new JournalsFetchRecord(),
new JournalsFetchRecord()
);
export const userInfo = handleAction(
@ -233,7 +233,7 @@ export const userInfo = handleAction(
return state.set('value', payload);
}
},
new UserInfoFetchRecord(),
new UserInfoFetchRecord()
);
const fetchActions = [
@ -252,7 +252,7 @@ for (const func in actions) {
// Indicates network activity, not just fetch
export const fetchCount = handleAction(
combineActions(
...fetchActions,
...fetchActions
),
(state: number, action: any) => {
if (action.payload === undefined) {
@ -261,13 +261,13 @@ export const fetchCount = handleAction(
return state - 1;
}
},
0,
0
);
// FIXME Move all the below (potentially the fetchCount ones too) to their own file
export interface SettingsType {
locale: string;
};
}
export const settingsReducer = handleActions(
{

@ -1,114 +1,112 @@
declare module 'ical.js' {
function parse(input: string): Array<any>;
function parse(input: string): any[];
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;
getAllProperties(name?: string): Array<Property>;
public getFirstProperty(name?: string): Property;
public getAllProperties(name?: string): Property[];
addProperty(property: Property): Property;
addPropertyWithValue(name: string, value: string | number | object): Property;
public addProperty(property: Property): 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 {
uid: string;
summary: string;
startDate: Time;
endDate: Time;
description: string;
location: string;
attendees: Array<Property>;
public uid: string;
public summary: string;
public startDate: Time;
public endDate: Time;
public description: string;
public location: string;
public attendees: Property[];
component: Component;
public component: Component;
isRecurring(): boolean;
iterator(startTime?: Time): RecurExpansion;
public constructor(component?: Component | null, options?: {strictExceptions: boolean, exepctions: Array<Component | Event>});
constructor(component?: Component | null,
options?: {strictExceptions: boolean, exepctions: Array<Component|Event>});
public isRecurring(): boolean;
public iterator(startTime?: Time): RecurExpansion;
}
class Property {
name: string;
type: string;
public name: string;
public type: string;
constructor(jCal: Array<any> | string, parent?: Component);
constructor(jCal: any[] | string, parent?: Component);
getFirstValue(): any;
getValues(): Array<any>;
public getFirstValue(): any;
public getValues(): any[];
setParameter(name: string, value: string | Array<string>): void;
setValue(value: string | object): void;
toJSON(): any;
public setParameter(name: string, value: string | string[]): void;
public setValue(value: string | object): void;
public toJSON(): any;
}
type TimeJsonData = {
year?: number,
month?: number,
day?: number,
hour?: number,
minute?: number,
second?: number,
isDate?: boolean
};
interface TimeJsonData {
year?: number;
month?: number;
day?: number;
hour?: number;
minute?: number;
second?: number;
isDate?: boolean;
}
class Time {
isDate: boolean;
timezone: string;
zone: Timezone;
static public fromString(str: string): Time;
static public fromJSDate(aDate: Date | null, useUTC: boolean): Time;
static public fromData(aData: TimeJsonData): Time;
static fromString(str: string): Time;
static fromJSDate(aDate: Date | null, useUTC: boolean): Time;
static fromData(aData: TimeJsonData): Time;
static public now(): Time;
static now(): Time;
public isDate: boolean;
public timezone: string;
public zone: Timezone;
constructor(data?: TimeJsonData);
public compare(aOther: Time): number;
compare(aOther: Time): number;
clone(): Time;
public clone(): Time;
adjust(
public adjust(
aExtraDays: number, aExtraHours: number, aExtraMinutes: number, aExtraSeconds: number, aTimeopt?: Time): void;
addDuration(aDuration: Duration): void;
subtractDateTz(aDate: Time): Duration;
public addDuration(aDuration: Duration): void;
public subtractDateTz(aDate: Time): Duration;
toJSDate(): Date;
toJSON(): TimeJsonData;
public toJSDate(): Date;
public toJSON(): TimeJsonData;
}
class Duration {
days: number;
public days: number;
}
class RecurExpansion {
complete: boolean;
public complete: boolean;
next(): Time;
public next(): Time;
}
class Timezone {
static localTimezone: Timezone;
static convert_time(tt: Time, from_zone: Timezone, to_zone: Timezone): Time;
static public localTimezone: Timezone;
static public convert_time(tt: Time, fromZone: Timezone, toZone: Timezone): Time;
tzid: string;
public tzid: string;
}
}

@ -5,28 +5,20 @@ import Datetime from 'react-datetime';
import 'react-datetime/css/react-datetime.css';
class DateTimePicker extends React.PureComponent {
props: {
placeholder: string,
value?: Date,
dateOnly?: boolean,
interface PropsType {
placeholder: string;
value?: Date;
dateOnly?: boolean;
onChange: (date?: Date) => void;
};
}
class DateTimePicker extends React.PureComponent<PropsType> {
constructor(props: any) {
super(props);
this.handleInputChange = this.handleInputChange.bind(this);
}
handleInputChange(newDate: string | moment.Moment) {
if (moment.isMoment(newDate)) {
this.props.onChange(newDate.toDate());
} else {
this.props.onChange(undefined);
}
}
render() {
public render() {
const inputProps = {
placeholder: this.props.placeholder,
readOnly: true,
@ -40,6 +32,14 @@ class DateTimePicker extends React.PureComponent {
/>
);
}
private handleInputChange(newDate: string | moment.Moment) {
if (moment.isMoment(newDate)) {
this.props.onChange(newDate.toDate());
} else {
this.props.onChange(undefined);
}
}
}
export default DateTimePicker;

@ -1,99 +1,38 @@
{
"extends": ["tslint-react"],
"extends": ["tslint:recommended", "tslint-react"],
"rules": {
"align": [
true,
"parameters",
"arguments",
"statements"
],
"ban": false,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"eofline": false,
"forin": true,
"indent": [ true, "spaces" ],
"interface-name": [true, "never-prefix"],
"jsdoc-format": true,
"jsx-no-lambda": false,
"ordered-imports": false,
"jsx-curly-spacing": [true, "never"],
"jsx-no-bind": [true, "allowArrowFunctions"],
"jsx-no-lambda": [false],
"jsx-no-multiline-js": false,
"label-position": true,
"max-line-length": [ true, 120 ],
"member-ordering": [
true,
"public-before-private",
"static-before-instance",
"variables-before-functions"
],
"no-any": false,
"no-arg": true,
"no-bitwise": true,
"no-console": [
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": [
"max-classes-per-file": [false, 0],
"max-line-length": false,
"no-consecutive-blank-lines": false,
"no-conditional-assignment": false,
"object-literal-sort-keys": false,
"quotemark": [true, "single", "jsx-double", "avoid-escape", "avoid-template"],
"semicolon": [true, "always", "ignore-bound-class-methods"],
"variable-name": [true, "ban-keywords", "check-format", "allow-pascal-case", "allow-leading-underscore"],
"trailing-comma": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
"multiline": {
"objects": "always",
"arrays": "always",
"functions": "never",
"typeLiterals": "ignore"
},
"esSpecCompliant": true
}
],
"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"
"whitespace": [true,"check-branch", "check-decl", "check-operator", "check-module", "check-separator", "check-rest-spread", "check-type", "check-typecast", "check-type-operator", "check-preblock"]
},
"linterOptions": {
"exclude": [
"config/**/*.js",
"node_modules/**/*.ts"
]
}
}

@ -2151,6 +2151,11 @@ buffer@^4.3.0:
ieee754 "^1.1.4"
isarray "^1.0.0"
builtin-modules@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=
builtin-status-codes@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8"
@ -2280,7 +2285,7 @@ ccount@^1.0.3:
resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.3.tgz#f1cec43f332e2ea5a569fd46f9f5bde4e6102aff"
integrity sha512-Jt9tIBkRc9POUof7QA/VwWd+58fKkEEfI+/t1/eOlxKM7ZhrczNzMFefge7Ai+39y1pR/pP6cI19guHy3FSLmw==
chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2:
chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
@ -2527,7 +2532,7 @@ commander@2.17.x, commander@~2.17.1:
resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf"
integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==
commander@^2.11.0:
commander@^2.11.0, commander@^2.12.1:
version "2.19.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==
@ -9936,11 +9941,43 @@ ts-pnp@^1.0.0:
resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.0.0.tgz#44a3a9e8c13fcb711bcda75d7b576c21af120c9d"
integrity sha512-qgwM7eBrxFvZSXLtSvjf3c2mXwJOOGD49VlE+KocUGX95DuMdLc/psZHBnPpZL5b2NU7VtQGHRCWF3cNfe5kxQ==
tslib@^1.9.0:
tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0:
version "1.9.3"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==
tslint-react@^3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/tslint-react/-/tslint-react-3.6.0.tgz#7f462c95c4a0afaae82507f06517ff02942196a1"
integrity sha512-AIv1QcsSnj7e9pFir6cJ6vIncTqxfqeFF3Lzh8SuuBljueYzEAtByuB6zMaD27BL0xhMEqsZ9s5eHuCONydjBw==
dependencies:
tsutils "^2.13.1"
tslint@^5.12.1:
version "5.12.1"
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.12.1.tgz#8cec9d454cf8a1de9b0a26d7bdbad6de362e52c1"
integrity sha512-sfodBHOucFg6egff8d1BvuofoOQ/nOeYNfbp7LDlKBcLNrL3lmS5zoiDGyOMdT7YsEXAwWpTdAHwOGOc8eRZAw==
dependencies:
babel-code-frame "^6.22.0"
builtin-modules "^1.1.1"
chalk "^2.3.0"
commander "^2.12.1"
diff "^3.2.0"
glob "^7.1.1"
js-yaml "^3.7.0"
minimatch "^3.0.4"
resolve "^1.3.2"
semver "^5.3.0"
tslib "^1.8.0"
tsutils "^2.27.2"
tsutils@^2.13.1, tsutils@^2.27.2:
version "2.29.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99"
integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==
dependencies:
tslib "^1.8.1"
tty-browserify@0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"

Loading…
Cancel
Save