[linter] manual-fix after merge

This commit is contained in:
Sergey Konovalov
2025-08-31 11:07:40 +03:00
parent 9f89041495
commit 54de9b94d5
5 changed files with 7218 additions and 4651 deletions

View File

@ -1471,7 +1471,7 @@ exports.watchWithFallback = async function watchWithFallback(ctx, dirPath, fileP
*/
function getImpl(object, property) {
//from https://github.com/node-config/node-config/blob/a8b91ac86b499d11b90974a2c9915ce31266044a/lib/config.js#L137
var t = this,
const _t = this,
elems = Array.isArray(property) ? property : property.split('.'),
name = elems[0],
value = object[name];

View File

@ -38,12 +38,10 @@ const tenantBaseDir = config.get('tenants.baseDir');
// const isMultitenantMode = config.get('tenants.isMultitenantMode');
const defaultTenantSecret = config.get('services.CoAuthoring.secret.browser.string');
const filenameSecret = config.get('tenants.filenameSecret');
const tenantManager = require('../../../../Common/sources/tenantManager');
const jwt = require('jsonwebtoken');
const fs = require('fs');
const path = require('path');
const cookieParser = require('cookie-parser');
const commonDefines = require('../../../../Common/sources/commondefines');
const router = express.Router();
@ -65,8 +63,8 @@ router.get('/me', async (req, res) => {
try {
const decoded = jwt.verify(token, defaultTenantSecret);
res.json(decoded);
return;
} catch (defaultError) {
} catch {
// If default secret fails, try to find the tenant and verify with their secret
const tenantList = fs.readdirSync(tenantBaseDir);
for (const tenant of tenantList) {
@ -78,7 +76,7 @@ router.get('/me', async (req, res) => {
isAdmin: decoded.isAdmin
});
return;
} catch (tenantError) {
} catch {
// Continue to next tenant
continue;
}
@ -93,7 +91,7 @@ router.get('/me', async (req, res) => {
});
router.post('/login', async (req, res) => {
let ctx = new operationContext.Context();
const ctx = new operationContext.Context();
ctx.initDefault()
try {
const { secret } = req.body;

View File

@ -3,6 +3,8 @@ const globals = require('globals');
const prettier = require('eslint-config-prettier');
const {includeIgnoreFile} = require('@eslint/compat');
const path = require('node:path');
const react = require('eslint-plugin-react');
const reactHooks = require('eslint-plugin-react-hooks');
const gitignorePath = path.resolve(__dirname, '.gitignore');
@ -65,5 +67,22 @@ module.exports = [
'max-lines': ['warn', 5000]
}
},
{
files: ['AdminPanel/client/**/*.{js,jsx}'],
plugins: {react, 'react-hooks': reactHooks},
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
parserOptions: {ecmaFeatures: {jsx: true}},
globals: {...globals.browser, ...globals.es2022}
},
settings: {react: {version: 'detect'}},
rules: {
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-vars': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn'
}
},
prettier
];

11836
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,8 @@
"cross-env": "7.0.3",
"eslint": "9.16.0",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.2.0",
"express": "4.21.2",
"globals": "15.12.0",
"husky": "^9.1.7",