Remove unnecessary return statements re: Emitter::emit
MODIFY
lib/project/results-model.js
lib/project/results-model.js
@@ -104,7 +104,7 @@ module.exports = class ResultsModel {
clear () {
this.clearSearchState()
this.clearReplacementState()
- return this.emitter.emit('did-clear', this.getResultsSummary())
+ this.emitter.emit('did-clear', this.getResultsSummary())
}
clearSearchState () {
@@ -121,7 +121,7 @@ module.exports = class ResultsModel {
this.inProgressSearchPromise = null
}
- return this.emitter.emit('did-clear-search-state', this.getResultsSummary())
+ this.emitter.emit('did-clear-search-state', this.getResultsSummary())
}
clearReplacementState () {
@@ -129,7 +129,7 @@ module.exports = class ResultsModel {
this.replacedPathCount = null
this.replacementCount = null
this.replacementErrors = null
- return this.emitter.emit('did-clear-replacement-state', this.getResultsSummary())
+ this.emitter.emit('did-clear-replacement-state', this.getResultsSummary())
}
shouldRerunSearch (findPattern, pathsPattern, replacePattern, options) {
@@ -162,7 +162,7 @@ module.exports = class ResultsModel {
const searchPaths = this.pathsArrayFromPathsPattern(pathsPattern)
const onPathsSearched = numberOfPathsSearched => {
- return this.emitter.emit('did-search-paths', numberOfPathsSearched)
+ this.emitter.emit('did-search-paths', numberOfPathsSearched)
}
const leadingContextLineCount = atom.config.get('find-and-replace.searchContextLineCountBefore')
@@ -181,17 +181,17 @@ module.exports = class ResultsModel {
} else {
if (this.searchErrors == null) { this.searchErrors = [] }
this.searchErrors.push(error)
- return this.emitter.emit('did-error-for-path', error)
+ this.emitter.emit('did-error-for-path', error)
}
})
this.emitter.emit('did-start-searching', this.inProgressSearchPromise)
return this.inProgressSearchPromise.then(message => {
if (message === 'cancelled') {
- return this.emitter.emit('did-cancel-searching')
+ this.emitter.emit('did-cancel-searching')
} else {
this.inProgressSearchPromise = null
- return this.emitter.emit('did-finish-searching', this.getResultsSummary())
+ this.emitter.emit('did-finish-searching', this.getResultsSummary())
}
})
}
@@ -213,11 +213,11 @@ module.exports = class ResultsModel {
this.replacedPathCount++
this.replacementCount += result.replacements
}
- return this.emitter.emit('did-replace-path', result)
+ this.emitter.emit('did-replace-path', result)
} else {
if (this.replacementErrors == null) { this.replacementErrors = [] }
this.replacementErrors.push(error)
- return this.emitter.emit('did-error-for-path', error)
+ this.emitter.emit('did-error-for-path', error)
}
})
@@ -300,7 +300,7 @@ module.exports = class ResultsModel {
this.matchCount += result.matches.length
this.results[filePath] = result
- return this.emitter.emit('did-add-result', {filePath, result, filePathInsertedIndex, filePathUpdatedIndex})
+ this.emitter.emit('did-add-result', {filePath, result, filePathInsertedIndex, filePathUpdatedIndex})
}
removeResult (filePath) {
@@ -311,7 +311,7 @@ module.exports = class ResultsModel {
const filePathRemovedIndex = this.paths.indexOf(filePath)
this.paths = _.without(this.paths, filePath)
delete this.results[filePath]
- return this.emitter.emit('did-remove-result', {filePath, filePathRemovedIndex})
+ this.emitter.emit('did-remove-result', {filePath, filePathRemovedIndex})
}
}
@@ -328,7 +328,7 @@ module.exports = class ResultsModel {
const result = Result.create({filePath: editor.getPath(), matches})
this.setResult(editor.getPath(), result)
- return this.emitter.emit('did-finish-searching', this.getResultsSummary())
+ this.emitter.emit('did-finish-searching', this.getResultsSummary())
}
pathsArrayFromPathsPattern (pathsPattern) {

Remove unnecessary return statements re: Emitter::emit