diff --git a/.eslintrc.js b/.eslintrc.js index 0459a05c..448e589e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -73,6 +73,7 @@ module.exports = { 'unicorn/import-style': 'off', 'unicorn/numeric-separators-style': 'off', 'unicorn/prefer-node-protocol': 'off', + 'unicorn/consistent-function-scoping': 'warn', 'promise/always-return': 'off', diff --git a/package.json b/package.json index c7da9869..720b571e 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "preview": "astro preview", "server": "node server/server.mjs", "start": "astro dev", - "start:local": "cross-env PUBLIC_API_URL=http://localhost:8080 astro dev", + "start:local": "cross-env PUBLIC_API_URL=http://127.0.0.1:8080 astro dev", "typecheck": "astro check && tsc --noEmit", "typecheck:watch": "tsc --noEmit --watch", "vercel-build": "astro build" diff --git a/src/components/_shared/StatMetrics.tsx b/src/components/_shared/StatMetrics.tsx index aedec322..c8b2b42f 100644 --- a/src/components/_shared/StatMetrics.tsx +++ b/src/components/_shared/StatMetrics.tsx @@ -23,8 +23,6 @@ const pseudonames = { authors: 'authors' } -const nos = (s) => s.slice(0, -1) - export const StatMetrics = (props: StatMetricsProps) => { return (
@@ -33,7 +31,7 @@ export const StatMetrics = (props: StatMetricsProps) => { {props.stat[entity] + ' ' + - t(nos(pseudonames[entity] || entity)) + + t((pseudonames[entity] || entity).slice(-1)) + plural(props.stat[entity] || 0, locale() === 'ru' ? ['ов', '', 'а'] : ['s', '', 's'])} )}