lint: fix all remaining warnings!

master
Tom Hacohen 5 years ago
parent f984f3f9e1
commit 566261b91a

@ -101,7 +101,8 @@ class ImportDialog extends React.Component<PropsType> {
);
}
private onFileDropCommon(itemsCreator: (fileText: string) => PimType[], acceptedFiles: File[], rejectedFiles: File[]) {
private onFileDropCommon(itemsCreator: (fileText: string) => PimType[], acceptedFiles: File[], _rejectedFiles: File[]) {
// XXX: implement handling of rejectedFiles
const reader = new FileReader();
reader.onabort = () => alert('file reading was aborted');

@ -103,7 +103,7 @@ class JournalMemberAddDialog extends React.PureComponent<PropsType> {
}
}
private onAddRequest(user: string) {
private onAddRequest(_user: string) {
this.setState({
userChosen: true,
});

@ -135,7 +135,7 @@ const CollectionRoutes = withStyles(styles)(withRouter(
<Route
path={routeResolver.getRoute(props.routePrefix + '.new')}
exact
render={({ match }) => (
render={() => (
<Container style={{ maxWidth: '30rem' }}>
<ComponentEdit
collections={props.collections}

@ -66,7 +66,7 @@ class Settings extends React.PureComponent<PropsTypeInner> {
}
}
const mapStateToProps = (state: StoreState, props: PropsType) => {
const mapStateToProps = (state: StoreState, _props: PropsType) => {
return {
settings: state.settings,
};

@ -103,7 +103,7 @@ class SideMenu extends React.PureComponent<PropsTypeInner> {
}
}
const mapStateToProps = (state: StoreState, props: PropsType) => {
const mapStateToProps = (state: StoreState, _props: PropsType) => {
return {
journals: state.cache.journals,
userInfo: state.cache.userInfo.value,

@ -83,7 +83,7 @@ class AddressBook extends React.PureComponent<PropsType> {
sortedEntries.filter(this.props.filter)
: sortedEntries;
const itemList = entries.map((entry, idx, array) => {
const itemList = entries.map((entry) => {
const uid = entry.uid;
return (

@ -216,7 +216,7 @@ class ContactEdit extends React.PureComponent<PropsType> {
public addValueType(name: string, _type?: string) {
const type = _type ? _type : 'home';
this.setState((prevState, props) => {
this.setState((prevState) => {
const newArray = prevState[name].slice(0);
newArray.push(new ValueType(type));
return {
@ -227,7 +227,7 @@ class ContactEdit extends React.PureComponent<PropsType> {
}
public removeValueType(name: string, idx: number) {
this.setState((prevState, props) => {
this.setState((prevState) => {
const newArray = prevState[name].slice(0);
newArray.splice(idx, 1);
return {
@ -238,7 +238,7 @@ class ContactEdit extends React.PureComponent<PropsType> {
}
public handleValueTypeChange(name: string, idx: number, value: ValueType) {
this.setState((prevState, props) => {
this.setState((prevState) => {
const newArray = prevState[name].slice(0);
newArray[idx] = value;
return {

@ -49,7 +49,7 @@ class TaskList extends React.PureComponent {
const entries = this.props.entries.filter((x) => !x.finished);
const sortedEntries = sortSelector(entries);
const itemList = sortedEntries.map((entry, idx, array) => {
const itemList = sortedEntries.map((entry) => {
const uid = entry.uid;
return (

@ -122,7 +122,7 @@ export const { fetchEntries, addEntries } = createActions({
const apiBase = etesync.serviceApiUrl;
const entryManager = new EteSync.EntryManager(creds, apiBase, journalUid);
return entryManager.create(newEntries, prevUid).then((response) => newEntries);
return entryManager.create(newEntries, prevUid).then(() => newEntries);
},
(etesync: CredentialsData, journalUid: string, newEntries: EteSync.Entry[], prevUid: string | null) => {
return { journal: journalUid, entries: newEntries, prevUid };

@ -45,7 +45,7 @@ const journalsSerialize = (state: JournalsData) => {
return null;
}
return state.map((x, uid) => x.serialize()).toJS();
return state.map((x, _uid) => x.serialize()).toJS();
};
const journalsDeserialize = (state: {}) => {

@ -81,13 +81,13 @@ function fetchTypeIdentityReducer(
export const encryptionKeyReducer = handleActions(
{
[actions.deriveKey.toString()]: (state: {key: string | null}, action: any) => (
[actions.deriveKey.toString()]: (_state: {key: string | null}, action: any) => (
{ key: action.payload }
),
[actions.resetKey.toString()]: (state: {key: string | null}, action: any) => (
[actions.resetKey.toString()]: (_state: {key: string | null}, _action: any) => (
{ key: null }
),
[actions.logout.toString()]: (state: {key: string | null}, action: any) => {
[actions.logout.toString()]: (_state: {key: string | null}, _action: any) => {
return { out: true, key: null };
},
},
@ -97,7 +97,7 @@ export const encryptionKeyReducer = handleActions(
export const credentials = handleActions(
{
[actions.fetchCredentials.toString()]: (
state: CredentialsTypeRemote, action: any, extend = false) => {
_state: CredentialsTypeRemote, action: any) => {
if (action.error) {
return {
value: null,
@ -118,7 +118,7 @@ export const credentials = handleActions(
};
}
},
[actions.logout.toString()]: (state: CredentialsTypeRemote, action: any) => {
[actions.logout.toString()]: (_state: CredentialsTypeRemote, _action: any) => {
return { out: true, value: null };
},
},
@ -229,7 +229,7 @@ export const userInfo = handleAction(
actions.fetchUserInfo,
actions.createUserInfo
),
(state: Record<FetchType<any>> = fetchTypeRecord<any>()(), action: any, extend = false) => {
(state: Record<FetchType<any>> = fetchTypeRecord<any>()(), action: any) => {
if (action.error) {
return state.set('error', action.payload);
} else {
@ -284,7 +284,7 @@ export interface SettingsType {
export const settingsReducer = handleActions(
{
[actions.setSettings.toString()]: (state: {key: string | null}, action: any) => (
[actions.setSettings.toString()]: (_state: {key: string | null}, action: any) => (
{ ...action.payload }
),
},

Loading…
Cancel
Save