Merge pull request #3949 from overleaf/msm-reenable-eslint-const-rule

Reenable eslint `prefer-const` rule

GitOrigin-RevId: 4f3825be8b8dff381095209085a36eaab76260d5
This commit is contained in:
Miguel Serrano
2021-05-05 15:05:04 +02:00
committed by Copybot
parent 0874fcb8ca
commit f9871103bf
129 changed files with 353 additions and 358 deletions
@@ -1175,7 +1175,7 @@ const ProjectEntityUpdateHandler = {
),
mkdirp: wrapWithLock(function (projectId, path, callback) {
for (let folder of path.split('/')) {
for (const folder of path.split('/')) {
if (folder.length > 0 && !SafePath.isCleanFilename(folder)) {
return callback(new Errors.InvalidNameError('invalid element name'))
}
@@ -1189,7 +1189,7 @@ const ProjectEntityUpdateHandler = {
}),
mkdirpWithExactCase: wrapWithLock(function (projectId, path, callback) {
for (let folder of path.split('/')) {
for (const folder of path.split('/')) {
if (folder.length > 0 && !SafePath.isCleanFilename(folder)) {
return callback(new Errors.InvalidNameError('invalid element name'))
}
@@ -1381,7 +1381,7 @@ const ProjectEntityUpdateHandler = {
),
isPathValidForRootDoc(docPath) {
let docExtension = Path.extname(docPath)
const docExtension = Path.extname(docPath)
return VALID_ROOT_DOC_REGEXP.test(docExtension)
},
@@ -1458,10 +1458,10 @@ const ProjectEntityUpdateHandler = {
} else if (entityType.indexOf('folder') !== -1) {
changes = { oldDocs: [], oldFiles: [] }
const _recurseFolder = (folder, folderPath) => {
for (let doc of folder.docs) {
for (const doc of folder.docs) {
changes.oldDocs.push({ doc, path: Path.join(folderPath, doc.name) })
}
for (let file of folder.fileRefs) {
for (const file of folder.fileRefs) {
changes.oldFiles.push({
file,
path: Path.join(folderPath, file.name),