From f6795a324a1cacf32ce091bab042df9b29172276 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Wed, 27 Oct 2021 11:49:53 +0200 Subject: [PATCH] Merge pull request #5572 from overleaf/jpa-no-path-concat [misc] fix eslint violations for node/no-path-concat GitOrigin-RevId: 5122826fb9ae23c373e8c5a6802ebb35eb20314f --- services/chat/.eslintrc | 1 - services/clsi/.eslintrc | 1 - .../acceptance/js/ExampleDocumentTests.js | 3 +-- .../test/acceptance/js/UrlCachingTests.js | 4 ++-- .../test/acceptance/scripts/settings.test.js | 6 ++---- services/contacts/.eslintrc | 1 - services/docstore/.eslintrc | 1 - services/document-updater/.eslintrc | 1 - services/filestore/.eslintrc | 1 - .../filestore/config/settings.defaults.js | 20 ++++++++----------- services/notifications/.eslintrc | 1 - services/real-time/.eslintrc | 1 - services/spelling/.eslintrc | 1 - services/track-changes/.eslintrc | 1 - 14 files changed, 13 insertions(+), 30 deletions(-) diff --git a/services/chat/.eslintrc b/services/chat/.eslintrc index b3d597e163..17fc388ece 100644 --- a/services/chat/.eslintrc +++ b/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 diff --git a/services/clsi/.eslintrc b/services/clsi/.eslintrc index b3d597e163..17fc388ece 100644 --- a/services/clsi/.eslintrc +++ b/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 diff --git a/services/clsi/test/acceptance/js/ExampleDocumentTests.js b/services/clsi/test/acceptance/js/ExampleDocumentTests.js index efe0f63c44..c132245b53 100644 --- a/services/clsi/test/acceptance/js/ExampleDocumentTests.js +++ b/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( diff --git a/services/clsi/test/acceptance/js/UrlCachingTests.js b/services/clsi/test/acceptance/js/UrlCachingTests.js index 4ff6467e15..7434297e0a 100644 --- a/services/clsi/test/acceptance/js/UrlCachingTests.js +++ b/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]}` diff --git a/services/clsi/test/acceptance/scripts/settings.test.js b/services/clsi/test/acceptance/scripts/settings.test.js index d6dda48107..79be996344 100644 --- a/services/clsi/test/acceptance/scripts/settings.test.js +++ b/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' diff --git a/services/contacts/.eslintrc b/services/contacts/.eslintrc index b3d597e163..17fc388ece 100644 --- a/services/contacts/.eslintrc +++ b/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 diff --git a/services/docstore/.eslintrc b/services/docstore/.eslintrc index b3d597e163..17fc388ece 100644 --- a/services/docstore/.eslintrc +++ b/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 diff --git a/services/document-updater/.eslintrc b/services/document-updater/.eslintrc index b3d597e163..17fc388ece 100644 --- a/services/document-updater/.eslintrc +++ b/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 diff --git a/services/filestore/.eslintrc b/services/filestore/.eslintrc index b3d597e163..17fc388ece 100644 --- a/services/filestore/.eslintrc +++ b/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 diff --git a/services/filestore/config/settings.defaults.js b/services/filestore/config/settings.defaults.js index 8c2ccfee28..d720984e1d 100644 --- a/services/filestore/config/settings.defaults.js +++ b/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: { diff --git a/services/notifications/.eslintrc b/services/notifications/.eslintrc index b3d597e163..17fc388ece 100644 --- a/services/notifications/.eslintrc +++ b/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 diff --git a/services/real-time/.eslintrc b/services/real-time/.eslintrc index b3d597e163..17fc388ece 100644 --- a/services/real-time/.eslintrc +++ b/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 diff --git a/services/spelling/.eslintrc b/services/spelling/.eslintrc index b3d597e163..17fc388ece 100644 --- a/services/spelling/.eslintrc +++ b/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 diff --git a/services/track-changes/.eslintrc b/services/track-changes/.eslintrc index b3d597e163..17fc388ece 100644 --- a/services/track-changes/.eslintrc +++ b/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