Merge pull request #4799 from overleaf/hb-eslint-rules

Re-enable some eslint rules

GitOrigin-RevId: 16153adb839bb61784bb40fbc8e43da281fe090d
This commit is contained in:
Hugh O'Brien
2021-09-15 08:03:43 +00:00
committed by Copybot
parent 49b1356976
commit f7900b474b
26 changed files with 136 additions and 82 deletions
+6 -4
View File
@@ -65,8 +65,9 @@ async function _addDefaultExampleProjectFiles(ownerId, projectName, project) {
ownerId
)
const frogPath = path.resolve(
__dirname + '/../app/templates/project_files/example-project/frog.jpg'
const frogPath = path.join(
__dirname,
'/../app/templates/project_files/example-project/frog.jpg'
)
await ProjectEntityUpdateHandler.promises.addFile(
project._id,
@@ -81,8 +82,9 @@ async function _addDefaultExampleProjectFiles(ownerId, projectName, project) {
async function _buildTemplate(templateName, userId, projectName) {
const user = await User.findById(userId, 'first_name last_name')
const templatePath = path.resolve(
__dirname + `/../app/templates/project_files/${templateName}`
const templatePath = path.join(
__dirname,
`/../app/templates/project_files/${templateName}`
)
const template = fs.readFileSync(templatePath)
const data = {
@@ -1,3 +1,4 @@
const path = require('path')
const { promises: fs } = require('fs')
const oneSky = require('@brainly/onesky-utils')
const sanitizeHtml = require('sanitize-html')
@@ -35,7 +36,7 @@ async function run() {
}
await fs.writeFile(
`${__dirname}/../../locales/${code}.json`,
path.join(__dirname, `/../../locales/${code}.json`),
JSON.stringify(lang.translation, null, 2) + '\n'
)
}
@@ -1,3 +1,4 @@
const Path = require('path')
const fs = require('fs')
const LANGUAGES = [
@@ -38,7 +39,7 @@ function transformLocales(mapping, transformLocale) {
})
fs.writeFileSync(
`${__dirname}/../../locales/${language}.json`,
Path.join(__dirname, `/../../locales/${language}.json`),
JSON.stringify(translatedLocales, null, 2) + '\n'
)
})
+4 -1
View File
@@ -1,3 +1,4 @@
const Path = require('path')
const { promises: fs } = require('fs')
const { promisify } = require('util')
const oneSky = require('@brainly/onesky-utils')
@@ -12,7 +13,9 @@ async function uploadLocales() {
fileName: 'en-US.json',
language: 'en-GB',
format: 'HIERARCHICAL_JSON',
content: await fs.readFile(`${__dirname}/../../locales/en.json`),
content: await fs.readFile(
Path.join(__dirname, '/../../locales/en.json')
),
keepStrings: false, // deprecate locales that no longer exist in en.json
})
)