mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-13 21:53:43 +01:00
Merge pull request #4799 from overleaf/hb-eslint-rules
Re-enable some eslint rules GitOrigin-RevId: 16153adb839bb61784bb40fbc8e43da281fe090d
This commit is contained in:
@@ -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'
|
||||
)
|
||||
})
|
||||
|
||||
@@ -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
|
||||
})
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user