You've already forked joplin
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:
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user