mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Tools: Apply "curly" eslint rule
This commit is contained in:
parent
e2e55b6e08
commit
e399474b4e
@ -68,6 +68,7 @@ module.exports = {
|
||||
// -------------------------------
|
||||
"space-in-parens": ["error", "never"],
|
||||
"space-infix-ops": ["error"],
|
||||
"curly": ["error", "multi-line", "consistent"],
|
||||
"semi": ["error", "always"],
|
||||
"eol-last": ["error", "always"],
|
||||
"quotes": ["error", "single"],
|
||||
|
@ -132,11 +132,13 @@ function checkForUpdates(inBackground, window, logFilePath, options) {
|
||||
autoUpdateLogger_.info('Is Pre-release:', release.prerelease);
|
||||
|
||||
if (compareVersions(release.version, packageInfo.version) <= 0) {
|
||||
if (!checkInBackground_) await dialog.showMessageBox({
|
||||
if (!checkInBackground_) {
|
||||
await dialog.showMessageBox({
|
||||
type: 'info',
|
||||
message: _('Current version is up-to-date.'),
|
||||
buttons: [_('OK')],
|
||||
});
|
||||
}
|
||||
} else {
|
||||
const fullReleaseNotes = release.notes.trim() ? `\n\n${release.notes.trim()}` : '';
|
||||
const MAX_RELEASE_NOTES_LENGTH = 1000;
|
||||
|
@ -36,11 +36,13 @@ class NoteTextViewerComponent extends React.Component {
|
||||
const callName = event.data.name;
|
||||
const args = event.data.args;
|
||||
|
||||
if (this.props.onIpcMessage) this.props.onIpcMessage({
|
||||
if (this.props.onIpcMessage) {
|
||||
this.props.onIpcMessage({
|
||||
channel: callName,
|
||||
args: args,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
domReady() {
|
||||
return this.domReady_;
|
||||
|
@ -230,24 +230,27 @@ class PromptDialog extends React.Component {
|
||||
}
|
||||
|
||||
const buttonComps = [];
|
||||
if (buttonTypes.indexOf('ok') >= 0)
|
||||
if (buttonTypes.indexOf('ok') >= 0) {
|
||||
buttonComps.push(
|
||||
<button key="ok" style={styles.button} onClick={() => onClose(true, 'ok')}>
|
||||
{_('OK')}
|
||||
</button>
|
||||
);
|
||||
if (buttonTypes.indexOf('cancel') >= 0)
|
||||
}
|
||||
if (buttonTypes.indexOf('cancel') >= 0) {
|
||||
buttonComps.push(
|
||||
<button key="cancel" style={styles.button} onClick={() => onClose(false, 'cancel')}>
|
||||
{_('Cancel')}
|
||||
</button>
|
||||
);
|
||||
if (buttonTypes.indexOf('clear') >= 0)
|
||||
}
|
||||
if (buttonTypes.indexOf('clear') >= 0) {
|
||||
buttonComps.push(
|
||||
<button key="clear" style={styles.button} onClick={() => onClose(false, 'clear')}>
|
||||
{_('Clear')}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={styles.modalLayer}>
|
||||
|
@ -123,8 +123,9 @@ function themeStyle(theme) {
|
||||
if (themeCache_[theme]) return themeCache_[theme];
|
||||
|
||||
const output = Object.assign({}, globalStyle);
|
||||
if (theme == Setting.THEME_LIGHT) return addExtraStyles(output);
|
||||
else if (theme == Setting.THEME_OLED_DARK) {
|
||||
if (theme == Setting.THEME_LIGHT) {
|
||||
return addExtraStyles(output);
|
||||
} else if (theme == Setting.THEME_OLED_DARK) {
|
||||
output.backgroundColor = '#000000';
|
||||
output.color = '#dddddd';
|
||||
output.colorFaded = '#777777';
|
||||
|
@ -640,13 +640,14 @@ class NoteScreenComponent extends BaseScreenComponent {
|
||||
this.showOnMap_onPress();
|
||||
},
|
||||
});
|
||||
if (note.source_url)
|
||||
if (note.source_url) {
|
||||
output.push({
|
||||
title: _('Go to source URL'),
|
||||
onPress: () => {
|
||||
this.showSource_onPress();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
@ -695,26 +696,28 @@ class NoteScreenComponent extends BaseScreenComponent {
|
||||
this.share_onPress();
|
||||
},
|
||||
});
|
||||
if (isSaved)
|
||||
if (isSaved) {
|
||||
output.push({
|
||||
title: _('Tags'),
|
||||
onPress: () => {
|
||||
this.tags_onPress();
|
||||
},
|
||||
});
|
||||
}
|
||||
output.push({
|
||||
title: isTodo ? _('Convert to note') : _('Convert to todo'),
|
||||
onPress: () => {
|
||||
this.toggleIsTodo_onPress();
|
||||
},
|
||||
});
|
||||
if (isSaved)
|
||||
if (isSaved) {
|
||||
output.push({
|
||||
title: _('Copy Markdown link'),
|
||||
onPress: () => {
|
||||
this.copyMarkdownLink_onPress();
|
||||
},
|
||||
});
|
||||
}
|
||||
output.push({
|
||||
title: _('Properties'),
|
||||
onPress: () => {
|
||||
|
@ -336,12 +336,13 @@ class SideMenuContentComponent extends Component {
|
||||
|
||||
items.push(this.renderSideBarButton('synchronize_button', !this.props.syncStarted ? _('Synchronise') : _('Cancel'), 'md-sync', this.synchronize_press));
|
||||
|
||||
if (fullReport.length)
|
||||
if (fullReport.length) {
|
||||
items.push(
|
||||
<Text key="sync_report" style={this.styles().syncStatus}>
|
||||
{fullReport.join('\n')}
|
||||
</Text>
|
||||
);
|
||||
}
|
||||
|
||||
return <View style={{ flex: 0, flexDirection: 'column', paddingBottom: theme.marginBottom }}>{items}</View>;
|
||||
}
|
||||
|
@ -73,10 +73,12 @@ class HtmlToHtml {
|
||||
|
||||
this.cache_.put(cacheKey, html, 1000 * 60 * 10);
|
||||
|
||||
if (options.bodyOnly) return {
|
||||
if (options.bodyOnly) {
|
||||
return {
|
||||
html: html,
|
||||
pluginAssets: [],
|
||||
};
|
||||
}
|
||||
|
||||
let cssStrings = noteStyle(theme, options);
|
||||
|
||||
|
@ -209,8 +209,7 @@ function handleItemDelete(state, action) {
|
||||
|
||||
function updateOneItem(state, action, keyName = '') {
|
||||
let itemsKey = null;
|
||||
if (keyName) itemsKey = keyName;
|
||||
else {
|
||||
if (keyName) { itemsKey = keyName; } else {
|
||||
if (action.type === 'TAG_UPDATE_ONE') itemsKey = 'tags';
|
||||
if (action.type === 'FOLDER_UPDATE_ONE') itemsKey = 'folders';
|
||||
if (action.type === 'MASTERKEY_UPDATE_ONE') itemsKey = 'masterKeys';
|
||||
@ -397,10 +396,11 @@ const reducer = (state = defaultState, action) => {
|
||||
case 'NOTE_SELECT_ALL_TOGGLE': {
|
||||
newState = Object.assign({}, state);
|
||||
const allSelected = state.notes.every(n => state.selectedNoteIds.includes(n.id));
|
||||
if (allSelected)
|
||||
if (allSelected) {
|
||||
newState.selectedNoteIds = [];
|
||||
else
|
||||
} else {
|
||||
newState.selectedNoteIds = newState.notes.map(n => n.id);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -119,11 +119,13 @@ async function main() {
|
||||
for (let j = 0; j < note.tags.length; j++) {
|
||||
const tagTitle = note.tags[j];
|
||||
const tagId = itemIdFromPath(tagTitle);
|
||||
if (!tagIdsToTag[tagId]) tagIdsToTag[tagId] = {
|
||||
if (!tagIdsToTag[tagId]) {
|
||||
tagIdsToTag[tagId] = {
|
||||
id: tagId,
|
||||
title: tagTitle,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
notes.push(note);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user