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(); const reader = new FileReader();
reader.onabort = () => alert('file reading was aborted'); 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({ this.setState({
userChosen: true, userChosen: true,
}); });

@ -135,7 +135,7 @@ const CollectionRoutes = withStyles(styles)(withRouter(
<Route <Route
path={routeResolver.getRoute(props.routePrefix + '.new')} path={routeResolver.getRoute(props.routePrefix + '.new')}
exact exact
render={({ match }) => ( render={() => (
<Container style={{ maxWidth: '30rem' }}> <Container style={{ maxWidth: '30rem' }}>
<ComponentEdit <ComponentEdit
collections={props.collections} 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 { return {
settings: state.settings, 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 { return {
journals: state.cache.journals, journals: state.cache.journals,
userInfo: state.cache.userInfo.value, userInfo: state.cache.userInfo.value,

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

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

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

@ -122,7 +122,7 @@ export const { fetchEntries, addEntries } = createActions({
const apiBase = etesync.serviceApiUrl; const apiBase = etesync.serviceApiUrl;
const 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(() => newEntries);
}, },
(etesync: CredentialsData, journalUid: string, newEntries: EteSync.Entry[], prevUid: string | null) => { (etesync: CredentialsData, journalUid: string, newEntries: EteSync.Entry[], prevUid: string | null) => {
return { journal: journalUid, entries: newEntries, prevUid }; return { journal: journalUid, entries: newEntries, prevUid };

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

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

Loading…
Cancel
Save