1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Tools: Enforce and apply eslint rules prefer-const and no-var

This commit is contained in:
Laurent Cozic
2020-03-13 23:46:14 +00:00
parent 92bee549a1
commit d0d2bad7f4
189 changed files with 1387 additions and 1377 deletions

View File

@@ -26,7 +26,7 @@ class NotesScreenComponent extends BaseScreenComponent {
this.onAppStateChange_ = async () => {
// Force an update to the notes list when app state changes
let newProps = Object.assign({}, this.props);
const newProps = Object.assign({}, this.props);
newProps.notesSource = '';
await this.refreshNotes(newProps);
};
@@ -40,7 +40,7 @@ class NotesScreenComponent extends BaseScreenComponent {
return (selected ? `${s} ` : '') + label;
};
for (let field in sortNoteOptions) {
for (const field in sortNoteOptions) {
if (!sortNoteOptions.hasOwnProperty(field)) continue;
buttons.push({
text: makeCheckboxText(Setting.value('notes.sortOrder.field') === field, 'bullet', sortNoteOptions[field]),
@@ -78,7 +78,7 @@ class NotesScreenComponent extends BaseScreenComponent {
if (this.styles_[cacheKey]) return this.styles_[cacheKey];
this.styles_ = {};
let styles = {
const styles = {
noteList: {
flex: 1,
},
@@ -106,7 +106,7 @@ class NotesScreenComponent extends BaseScreenComponent {
async refreshNotes(props = null) {
if (props === null) props = this.props;
let options = {
const options = {
order: props.notesOrder,
uncompletedTodosOnTop: props.uncompletedTodosOnTop,
showCompletedTodos: props.showCompletedTodos,
@@ -198,7 +198,7 @@ class NotesScreenComponent extends BaseScreenComponent {
const parent = this.parentItem();
const theme = themeStyle(this.props.theme);
let rootStyle = {
const rootStyle = {
flex: 1,
backgroundColor: theme.backgroundColor,
};
@@ -207,7 +207,7 @@ class NotesScreenComponent extends BaseScreenComponent {
rootStyle.flex = 0.001; // This is a bit of a hack but it seems to work fine - it makes the component invisible but without unmounting it
}
let title = parent ? parent.title : null;
const title = parent ? parent.title : null;
if (!parent) {
return (
<View style={rootStyle}>