Просмотр исходного кода

Merge pull request #5572 from overleaf/jpa-no-path-concat

[misc] fix eslint violations for node/no-path-concat

GitOrigin-RevId: 5122826fb9ae23c373e8c5a6802ebb35eb20314f
Jakob Ackermann 4 лет назад
Родитель
Сommit
f6795a324a

+ 0 - 1
services/chat/.eslintrc

@@ -22,7 +22,6 @@
   "rules": {
     // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
     // START of temporary overrides
-    "node/no-path-concat": "off",
     "prefer-regex-literals": "off",
     // END of temporary overrides
 

+ 0 - 1
services/clsi/.eslintrc

@@ -22,7 +22,6 @@
   "rules": {
     // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
     // START of temporary overrides
-    "node/no-path-concat": "off",
     "prefer-regex-literals": "off",
     // END of temporary overrides
 

+ 1 - 2
services/clsi/test/acceptance/js/ExampleDocumentTests.js

@@ -1,6 +1,5 @@
 /* eslint-disable
     camelcase,
-    no-path-concat,
     no-return-assign,
     no-unused-vars,
 */
@@ -26,7 +25,7 @@ const fixturePath = path => {
   if (path.slice(0, 3) === 'tmp') {
     return '/tmp/clsi_acceptance_tests' + path.slice(3)
   }
-  return Path.normalize(__dirname + '/../fixtures/' + path)
+  return Path.join(__dirname, '../fixtures/', path)
 }
 const process = require('process')
 console.log(

+ 2 - 2
services/clsi/test/acceptance/js/UrlCachingTests.js

@@ -1,5 +1,4 @@
 /* eslint-disable
-    no-path-concat,
     no-unused-vars,
 */
 // TODO: This file was created by bulk-decaffeinate.
@@ -10,6 +9,7 @@
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  */
+const Path = require('path')
 const Client = require('./helpers/Client')
 const sinon = require('sinon')
 const ClsiApp = require('./helpers/ClsiApp')
@@ -21,7 +21,7 @@ const Server = {
     const express = require('express')
     const app = express()
 
-    const staticServer = express.static(__dirname + '/../fixtures/')
+    const staticServer = express.static(Path.join(__dirname, '../fixtures/'))
     app.get('/:random_id/*', (req, res, next) => {
       this.getFile(req.url)
       req.url = `/${req.params[0]}`

+ 2 - 4
services/clsi/test/acceptance/scripts/settings.test.js

@@ -2,10 +2,8 @@ const Path = require('path')
 
 module.exports = {
   path: {
-    // eslint-disable-next-line no-path-concat
-    compilesDir: Path.resolve(__dirname + '/../../../compiles'),
-    // eslint-disable-next-line no-path-concat
-    clsiCacheDir: Path.resolve(__dirname + '/../../../cache'),
+    compilesDir: Path.join(__dirname, '../../../compiles'),
+    clsiCacheDir: Path.join(__dirname, '../../../cache'),
     // synctexBaseDir: (project_id) -> Path.join(@compilesDir, project_id)
     synctexBaseDir() {
       return '/compile'

+ 0 - 1
services/contacts/.eslintrc

@@ -22,7 +22,6 @@
   "rules": {
     // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
     // START of temporary overrides
-    "node/no-path-concat": "off",
     "prefer-regex-literals": "off",
     // END of temporary overrides
 

+ 0 - 1
services/docstore/.eslintrc

@@ -22,7 +22,6 @@
   "rules": {
     // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
     // START of temporary overrides
-    "node/no-path-concat": "off",
     "prefer-regex-literals": "off",
     // END of temporary overrides
 

+ 0 - 1
services/document-updater/.eslintrc

@@ -22,7 +22,6 @@
   "rules": {
     // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
     // START of temporary overrides
-    "node/no-path-concat": "off",
     "prefer-regex-literals": "off",
     // END of temporary overrides
 

+ 0 - 1
services/filestore/.eslintrc

@@ -22,7 +22,6 @@
   "rules": {
     // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
     // START of temporary overrides
-    "node/no-path-concat": "off",
     "prefer-regex-literals": "off",
     // END of temporary overrides
 

+ 8 - 12
services/filestore/config/settings.defaults.js

@@ -21,17 +21,14 @@ if (process.env.BACKEND == null) {
       process.env.AWS_S3_PUBLIC_FILES_BUCKET_NAME
   } else {
     process.env.BACKEND = 'fs'
-    process.env.USER_FILES_BUCKET_NAME = Path.resolve(
-      // eslint-disable-next-line no-path-concat
-      __dirname + '/../user_files'
+    process.env.USER_FILES_BUCKET_NAME = Path.join(__dirname, '../user_files')
+    process.env.TEMPLATE_FILES_BUCKET_NAME = Path.join(
+      __dirname,
+      '../template_files'
     )
-    process.env.TEMPLATE_FILES_BUCKET_NAME = Path.resolve(
-      // eslint-disable-next-line no-path-concat
-      __dirname + '/../template_files'
-    )
-    process.env.PUBLIC_FILES_BUCKET_NAME = Path.resolve(
-      // eslint-disable-next-line no-path-concat
-      __dirname + '/../public_files'
+    process.env.PUBLIC_FILES_BUCKET_NAME = Path.join(
+      __dirname,
+      '../public_files'
     )
   }
 }
@@ -103,8 +100,7 @@ const settings = {
   },
 
   path: {
-    // eslint-disable-next-line no-path-concat
-    uploadFolder: Path.resolve(__dirname + '/../uploads'),
+    uploadFolder: Path.join(__dirname, '../uploads'),
   },
 
   commands: {

+ 0 - 1
services/notifications/.eslintrc

@@ -22,7 +22,6 @@
   "rules": {
     // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
     // START of temporary overrides
-    "node/no-path-concat": "off",
     "prefer-regex-literals": "off",
     // END of temporary overrides
 

+ 0 - 1
services/real-time/.eslintrc

@@ -22,7 +22,6 @@
   "rules": {
     // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
     // START of temporary overrides
-    "node/no-path-concat": "off",
     "prefer-regex-literals": "off",
     // END of temporary overrides
 

+ 0 - 1
services/spelling/.eslintrc

@@ -22,7 +22,6 @@
   "rules": {
     // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
     // START of temporary overrides
-    "node/no-path-concat": "off",
     "prefer-regex-literals": "off",
     // END of temporary overrides
 

+ 0 - 1
services/track-changes/.eslintrc

@@ -22,7 +22,6 @@
   "rules": {
     // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
     // START of temporary overrides
-    "node/no-path-concat": "off",
     "prefer-regex-literals": "off",
     // END of temporary overrides