fix linter

This commit is contained in:
Сюткина Дарья Александровна (4047910) 2023-12-29 19:31:00 +04:00
parent e14421ccc0
commit b44357f2a5
15 changed files with 143 additions and 3637 deletions

View File

@ -1,7 +1,3 @@
{ {
"extends": [ "extends": ["eslint:recommended", "next/core-web-vitals"]
"next/core-web-vitals",
"molindo/typescript",
"molindo/react"
]
} }

0
Dockerfile Normal file
View File

3744
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,12 +19,12 @@
"styled-components": "^6.1.1" "styled-components": "^6.1.1"
}, },
"devDependencies": { "devDependencies": {
"@next/eslint-plugin-next": "^14.0.4",
"@types/node": "^20", "@types/node": "^20",
"@types/react": "^18", "@types/react": "^18",
"@types/react-dom": "^18", "@types/react-dom": "^18",
"autoprefixer": "^10.0.1", "autoprefixer": "^10.0.1",
"eslint": "^8.55.0", "eslint": "^8.55.0",
"eslint-config-molindo": "^7.0.0",
"eslint-config-next": "^14.0.3", "eslint-config-next": "^14.0.3",
"postcss": "^8", "postcss": "^8",
"sass": "^1.69.5", "sass": "^1.69.5",

View File

@ -34,7 +34,7 @@ export default function Experts() {
}} }}
dataSource={data} dataSource={data}
renderItem={(item) => ( renderItem={(item) => (
<List.Item key={item.title}> <List.Item key={item.name}>
<List.Item.Meta <List.Item.Meta
avatar={<Avatar src={item.avatar} />} avatar={<Avatar src={item.avatar} />}
title={item.name} title={item.name}
@ -55,7 +55,7 @@ export default function Experts() {
<div className="card-profile__subtitle">{item.specialityDesc}</div> <div className="card-profile__subtitle">{item.specialityDesc}</div>
<div className="card-profile__desc">{item.description}</div> <div className="card-profile__desc">{item.description}</div>
<div className="card-profile__footer"> <div className="card-profile__footer">
<Link href={item.href}> <Link href={item.href as any}>
<Text <Text
copyable={{ copyable={{
icon: <RightOutlined key="copy-icon" style={{ fontSize: '15px' }}/>, icon: <RightOutlined key="copy-icon" style={{ fontSize: '15px' }}/>,

View File

@ -6,12 +6,13 @@ const ROUTES = ['sessions', 'notifications', 'support', 'information', 'settings
export const AccountMenu = () => { export const AccountMenu = () => {
const t = useTranslations('Account'); const t = useTranslations('Account');
const userId = 5;
return ( return (
<ul> <ul>
{ROUTES.map((item) => ( {ROUTES.map((item) => (
<li key={item}> <li key={item}>
<Link href={`/account/${item}`}> <Link href={`/${userId}/${item}` as any}>
{t(`menu.${item}`)} {t(`menu.${item}`)}
</Link> </Link>
</li> </li>

View File

@ -124,7 +124,7 @@ export const ExpertsFilter = () => {
}) })
}, [filter]); }, [filter]);
const getList = useCallback((data) => ( const getList = useCallback((data: any[]) => (
<div className="b-filter__inner"> <div className="b-filter__inner">
<List <List
itemLayout="vertical" itemLayout="vertical"

View File

@ -36,7 +36,7 @@ export const Footer = () => {
<div className="b-footer__coll-2"> <div className="b-footer__coll-2">
<div className="b-footer__coll-2__item"> <div className="b-footer__coll-2__item">
{FOOTER_ROUTES.map((item) => ( {FOOTER_ROUTES.map((item) => (
<Link key={item} href={`/${item}`} className="b-footer__link">{t(`menu.${item}`)}</Link> <Link key={item} href={`/${item}` as any} className="b-footer__link">{t(`menu.${item}`)}</Link>
))} ))}
</div> </div>
<div className="b-footer__social"> <div className="b-footer__social">

View File

@ -1,7 +1,7 @@
import React from 'react'; import React, { ReactNode } from 'react';
import { HeaderAuthLinks } from './HeaderAuthLinks'; import { HeaderAuthLinks } from './HeaderAuthLinks';
export const HeaderMenu = ({ children }) => ( export const HeaderMenu = ({ children }: { children: ReactNode }) => (
<div className="b-header__nav"> <div className="b-header__nav">
<nav> <nav>
<ul className="b-header__nav__list "> <ul className="b-header__nav__list ">

View File

@ -1,13 +1,13 @@
'use client' 'use client'
import React, {FC, useState} from 'react'; import React, { FC, ReactNode, useState } from 'react';
import { HeaderAuthLinks } from './HeaderAuthLinks'; import { HeaderAuthLinks } from './HeaderAuthLinks';
type HeaderMenuMobileProps = { type HeaderMenuMobileProps = {
open: boolean; children: ReactNode;
}; };
export const HeaderMobileMenu: FC<HeaderMenuMobileProps> = ({ open, children }) => { export const HeaderMobileMenu: FC<HeaderMenuMobileProps> = ({ children }) => {
const [showMobileMenu, setShowMobileMenu] = useState<boolean>(false); const [showMobileMenu, setShowMobileMenu] = useState<boolean>(false);
return ( return (
@ -19,7 +19,7 @@ export const HeaderMobileMenu: FC<HeaderMenuMobileProps> = ({ open, children })
alt="" alt=""
/> />
</div> </div>
{open ? ( {showMobileMenu ? (
<div className="menu-mobile"> <div className="menu-mobile">
<div className="menu-mobile__inner"> <div className="menu-mobile__inner">
<div className="menu-mobile__header"> <div className="menu-mobile__header">

View File

@ -16,7 +16,7 @@ export const LanguageSwitcher = ({ locale }: { locale: string }) => {
const onClick: MenuProps['onClick'] = (e) => { const onClick: MenuProps['onClick'] = (e) => {
startTransition(() => { startTransition(() => {
router.replace(pathname, { locale: e.key }); router.replace(pathname as any, { locale: e.key });
}); });
}; };

View File

@ -15,7 +15,7 @@ export const Header: FC<HeaderProps> = ({ locale }) => {
const routes = HEAD_ROUTES.map((item) => ( const routes = HEAD_ROUTES.map((item) => (
<li key={item}> <li key={item}>
<Link href={`/${item}`}>{t(`menu.${item}`)}</Link> <Link href={`/${item}` as any}>{t(`menu.${item}`)}</Link>
</li> </li>
)); ));

View File

@ -1,5 +1,5 @@
import { AdditionalFilter, Filter } from '../types/experts'; import { AdditionalFilter, Filter } from '../types/experts';
import { LOCALES } from "./locale"; import { LOCALES } from './locale';
export enum FilterType { export enum FilterType {
'WorkLifeBalance' = 'workLifeBalance', 'WorkLifeBalance' = 'workLifeBalance',

View File

@ -1,11 +1,17 @@
import { createLocalizedPathnamesNavigation } from 'next-intl/navigation'; import { createLocalizedPathnamesNavigation, Pathnames } from 'next-intl/navigation';
import { ALLOWED_LOCALES, LOCALE_PREFIX } from './constants/locale'; import { ALLOWED_LOCALES, LOCALE_PREFIX } from './constants/locale';
export const { Link, redirect, usePathname, useRouter } = export const { Link, redirect, usePathname, useRouter } =
createLocalizedPathnamesNavigation({ createLocalizedPathnamesNavigation({
locales: ALLOWED_LOCALES, locales: ALLOWED_LOCALES,
pathnames: { pathnames: {
'/': '/' '/': '/',
}, '/experts': '/experts',
'/experts/[expertId]': '/experts/[expertId]',
'/news': '/news',
'/privacy-policy': '/privacy-policy',
'/[userId]': '/[userId]',
'/[userId]/[...slug]': '/[userId]/[...slug]',
} satisfies Pathnames<typeof ALLOWED_LOCALES>,
localePrefix: LOCALE_PREFIX localePrefix: LOCALE_PREFIX
}); });

View File

@ -1,5 +1,4 @@
{ {
"extends": "eslint-config-molindo/tsconfig.json",
"compilerOptions": { "compilerOptions": {
"baseUrl": "src", "baseUrl": "src",
"target": "es5", "target": "es5",