From 7c479f0fff4a1a9754116f438942b7f037948397 Mon Sep 17 00:00:00 2001 From: Anton Akhatov Date: Tue, 26 Dec 2023 23:15:00 +0000 Subject: [PATCH] update eslint & paths --- .eslintrc.json | 14 +- components/App.tsx | 51 - components/Card/Card.tsx | 22 +- components/Card/DesktopCard/DesktopCard.tsx | 15 +- components/Card/MobileCard/MobileCard.tsx | 14 +- .../EditObjectButtonLink.tsx | 0 components/Card/components/Header/Header.tsx | 3 +- .../Card/components/Sources/Sources.tsx | 2 +- components/LeftSidebar/LeftSidebar.tsx | 11 +- .../RangeBaseFilter.constants.ts | 0 .../RangeBaseFilter/RangeBaseFilter.tsx | 0 components/RightSidebar/RightSidebar.tsx | 11 +- constants/colors.ts | 2 +- constants/coords.ts | 1 - constants/map.ts | 1 + .../About}/AboutProjectContent.tsx | 0 .../AboutProjectIcons.module.css | 0 .../AboutProjectIcons/AboutProjectIcons.tsx | 2 +- .../About}/AboutProjectModal.module.css | 0 .../About}/AboutProjectModal.tsx | 4 +- .../About}/AboutProjectProvider.tsx | 0 .../About}/MobileAboutProject.tsx | 4 +- .../About}/Team/TeamGrid.module.css | 0 .../About}/Team/TeamGrid.tsx | 2 +- .../About}/Team/TeamPerson.module.css | 0 .../About}/Team/TeamPerson.tsx | 0 .../About}/Team/team-mock.json | 0 .../About}/Team/types.ts | 0 .../About}/github-icon.svg | 0 .../About}/icon-github.svg | 0 .../About}/icon-telegram.svg | 0 .../svg => features/About}/map-service.svg | 0 .../Building}/BuildingSource.tsx | 12 +- .../Copyright/Copyright.module.css | 0 .../Copyright/Copyright.tsx | 9 +- .../DTP/CardContent/CardContent.module.css | 0 .../DTP/CardContent/CardContent.tsx | 0 .../DTP/CardContent/CardContent.types.tsx | 2 +- .../Participant/Participant.module.css | 0 .../Participants/Participant/Participant.tsx | 4 +- .../Participants/Participants.module.css | 0 .../components/Participants/Participants.tsx | 4 +- .../Participants/Participants.types.ts | 2 +- .../Layers => features}/DTP/DTP.constants.ts | 0 .../Map/layers => features/DTP}/DtpSource.tsx | 8 +- .../DTP/Filter/DTPFilter.module.css | 0 .../DTP/Filter/DTPFilter.state.ts | 0 .../DTP/Filter/DTPFilter.tsx | 4 +- .../DTP/Filter/DTPFilter.types.ts | 0 {components/Layers => features}/DTP/dtp.ts | 2 +- .../DTP/dtpParticipantType.ts | 0 .../DTP/dtpSeverityType.ts | 0 .../DesignCode/CardContent/CardContent.tsx | 4 +- .../DesignCode/DesignCode.constants.ts | 0 .../DesignCode}/DesignCodeMarker.module.css | 0 .../DesignCode}/DesignCodeSource.tsx | 14 +- .../Filter/DesignCodeFilter.module.css | 0 .../Filter/DesignCodeFilter.state.ts | 0 .../DesignCode/Filter/DesignCodeFilter.tsx | 0 .../Filter/DesignCodeFilter.types.ts | 0 .../DesignCode/MapData/MapData.constants.ts | 0 .../DesignCode/designCode.ts | 0 .../DesignCode/designCodeObject.ts | 2 +- .../Facade/CardContent}/Facade.module.css | 0 .../Facade/CardContent}/Facade.tsx | 2 +- .../Facade}/FacadeSource.tsx | 4 +- .../Facade/Filter/FacadeFilter.module.css | 0 .../Facade/Filter/FacadeFilter.tsx | 2 +- .../Filters/Filters.module.css | 0 {components => features}/Filters/Filters.tsx | 11 +- .../Filters/MobileFilters/MobileFilters.tsx | 7 +- .../components/Filter/Filter.module.css | 0 .../Filters/components/Filter/Filter.tsx | 0 .../components/Toggle/Toggle.module.css | 0 .../Filters/components/Toggle/Toggle.tsx | 0 {components => features}/Filters/index.ts | 1 + .../Houses/CardContent/CardContent.module.css | 0 .../Houses/CardContent/CardContent.tsx | 12 +- .../Houses/CardContent/CardContent.types.ts | 2 +- .../Filter/Age/HouseAgeFilter.constants.ts | 0 .../Filter/Age/HouseAgeFilter.module.css | 0 .../Houses/Filter/Age/HouseAgeFilter.tsx | 4 +- .../Filter/Base/HouseBaseFilter.constants.ts | 0 .../Houses/Filter/Base/HouseBaseFilter.tsx | 2 +- .../Filter/Facade/HouseFacadeFilter.tsx | 0 .../Floor/HouseFloorFilter.constants.ts | 0 .../Houses/Filter/Floor/HouseFloorFilter.tsx | 4 +- .../Filter/WearTear/HouseWearTearFilter.tsx | 6 +- .../HealthProgress/HealthProgress.module.css | 0 .../Houses/HealthProgress/HealthProgress.tsx | 0 .../Houses/Houses.constants.ts | 0 .../Layers => features}/Houses/houseBase.ts | 0 .../Lines/CardContent/CardContent.tsx | 2 +- .../Lines/Filter/LinesFilter.module.css | 0 .../Lines/Filter/LinesFilter.state.ts | 0 .../Lines/Filter/LinesFilter.tsx | 2 +- .../Lines/Filter/LinesFilter.types.ts | 0 .../Lines/Lines.constants.ts | 0 .../layers => features/Lines}/LinesSource.tsx | 12 +- .../Layers => features}/Lines/lineType.ts | 0 .../Layers => features}/Lines/lines.ts | 0 {components => features}/Map/Map.tsx | 21 +- .../Map/helpers/colorLuminance.ts | 0 .../Map/helpers/getFeatureState.ts | 0 .../Map/helpers}/useMapObjectState.ts | 0 .../Map/providers/MapProvider.tsx | 2 +- .../Map/providers/usePopup.ts | 4 +- .../OKN/CardContent/CardContent.module.css | 0 .../OKN/CardContent/CardContent.tsx | 2 +- .../components/OKNInfo/OKNInfo.module.css | 0 .../components/OKNInfo/OKNInfo.tsx | 2 +- .../OKN/CardContent/index.ts | 0 .../OKN/Filter/OknFilter.module.css | 0 .../OKN/Filter/OknFilter.state.ts | 0 .../OKN/Filter/OknFilter.tsx | 2 +- .../OKN/Filter/OknFilter.types.ts | 0 .../Layers => features}/OKN/Okn.constants.ts | 0 .../Map/layers => features/OKN}/OknSource.tsx | 12 +- {components/Layers => features}/OKN/okn.ts | 0 .../Layers => features}/OKN/oknConstants.ts | 0 .../Layers => features}/OKN/oknObject.ts | 0 .../CardContent/CardContent.module.css | 0 .../Quarter/CardContent/CardContent.tsx | 14 +- .../Quarter/Filter/QuarterFilter.module.css | 0 .../Quarter/Filter/QuarterFilter.tsx | 2 +- .../Quarter}/QuarterSource.tsx | 10 +- .../Layers => features}/Quarter/quarter.ts | 0 .../Quarter/quarterObject.ts | 0 package.json | 10 +- pages/Index/App.tsx | 30 + .../Layers => pages/Index}/Content.config.ts | 26 +- .../Layers => pages/Index}/Filters.config.tsx | 18 +- pages/Index/Sidebars.tsx | 43 + .../Privacy/PrivacyPage.tsx | 2 +- pages/index.tsx | 2 +- pages/privacy.tsx | 4 +- pnpm-lock.yaml | 2577 ++++++----------- .../UI}/Label/Label.module.css | 0 .../components => shared/UI}/Label/Label.tsx | 0 .../UI}/Label/Label.types.tsx | 0 .../UI}/Link/Link.module.css | 0 .../components => shared/UI}/Link/Link.tsx | 0 shared/helpers/hash.ts | 4 +- shared/helpers/isDesktop.ts | 2 +- .../{use-match-media.ts => useMatchMedia.ts} | 0 state/state.ts | 6 +- types/{map-item.ts => Content.types.ts} | 8 + .../{objectsBase.ts => ObjectsBase.types.ts} | 0 148 files changed, 1140 insertions(+), 1962 deletions(-) delete mode 100644 components/App.tsx rename components/{ => Card/components}/EditObjectButtonLink/EditObjectButtonLink.tsx (100%) rename {shared/UI => components}/RangeBaseFilter/RangeBaseFilter.constants.ts (100%) rename {shared/UI => components}/RangeBaseFilter/RangeBaseFilter.tsx (100%) delete mode 100644 constants/coords.ts rename {components/AboutProjectModal => features/About}/AboutProjectContent.tsx (100%) rename {components => features/About}/AboutProjectIcons/AboutProjectIcons.module.css (100%) rename {components => features/About}/AboutProjectIcons/AboutProjectIcons.tsx (93%) rename {components/AboutProjectModal => features/About}/AboutProjectModal.module.css (100%) rename {components/AboutProjectModal => features/About}/AboutProjectModal.tsx (83%) rename {state/providers => features/About}/AboutProjectProvider.tsx (100%) rename {components/AboutProjectModal => features/About}/MobileAboutProject.tsx (76%) rename {components/AboutProjectModal => features/About}/Team/TeamGrid.module.css (100%) rename {components/AboutProjectModal => features/About}/Team/TeamGrid.tsx (90%) rename {components/AboutProjectModal => features/About}/Team/TeamPerson.module.css (100%) rename {components/AboutProjectModal => features/About}/Team/TeamPerson.tsx (100%) rename {components/AboutProjectModal => features/About}/Team/team-mock.json (100%) rename {components/AboutProjectModal => features/About}/Team/types.ts (100%) rename {components/AboutProjectIcons => features/About}/github-icon.svg (100%) rename {components/AboutProjectModal => features/About}/icon-github.svg (100%) rename {components/AboutProjectModal => features/About}/icon-telegram.svg (100%) rename {components/AboutProjectModal/svg => features/About}/map-service.svg (100%) rename {components/Map/layers => features/Building}/BuildingSource.tsx (91%) rename {components => features}/Copyright/Copyright.module.css (100%) rename {components => features}/Copyright/Copyright.tsx (73%) rename {components/Layers => features}/DTP/CardContent/CardContent.module.css (100%) rename {components/Layers => features}/DTP/CardContent/CardContent.tsx (100%) rename {components/Layers => features}/DTP/CardContent/CardContent.types.tsx (53%) rename {components/Layers => features}/DTP/CardContent/components/Participants/Participant/Participant.module.css (100%) rename {components/Layers => features}/DTP/CardContent/components/Participants/Participant/Participant.tsx (96%) rename {components/Layers => features}/DTP/CardContent/components/Participants/Participants.module.css (100%) rename {components/Layers => features}/DTP/CardContent/components/Participants/Participants.tsx (96%) rename {components/Layers => features}/DTP/CardContent/components/Participants/Participants.types.ts (81%) rename {components/Layers => features}/DTP/DTP.constants.ts (100%) rename {components/Map/layers => features/DTP}/DtpSource.tsx (93%) rename {components/Layers => features}/DTP/Filter/DTPFilter.module.css (100%) rename {components/Layers => features}/DTP/Filter/DTPFilter.state.ts (100%) rename {components/Layers => features}/DTP/Filter/DTPFilter.tsx (97%) rename {components/Layers => features}/DTP/Filter/DTPFilter.types.ts (100%) rename {components/Layers => features}/DTP/dtp.ts (97%) rename {components/Layers => features}/DTP/dtpParticipantType.ts (100%) rename {components/Layers => features}/DTP/dtpSeverityType.ts (100%) rename {components/Layers => features}/DesignCode/CardContent/CardContent.tsx (91%) rename {components/Layers => features}/DesignCode/DesignCode.constants.ts (100%) rename {shared/helpers => features/DesignCode}/DesignCodeMarker.module.css (100%) rename {components/Map/layers => features/DesignCode}/DesignCodeSource.tsx (83%) rename {components/Layers => features}/DesignCode/Filter/DesignCodeFilter.module.css (100%) rename {components/Layers => features}/DesignCode/Filter/DesignCodeFilter.state.ts (100%) rename {components/Layers => features}/DesignCode/Filter/DesignCodeFilter.tsx (100%) rename {components/Layers => features}/DesignCode/Filter/DesignCodeFilter.types.ts (100%) rename {components/Layers => features}/DesignCode/MapData/MapData.constants.ts (100%) rename {components/Layers => features}/DesignCode/designCode.ts (100%) rename {components/Layers => features}/DesignCode/designCodeObject.ts (95%) rename {components/Card/components/Facade => features/Facade/CardContent}/Facade.module.css (100%) rename {components/Card/components/Facade => features/Facade/CardContent}/Facade.tsx (81%) rename {components/Map/layers => features/Facade}/FacadeSource.tsx (91%) rename {components/Layers => features}/Facade/Filter/FacadeFilter.module.css (100%) rename {components/Layers => features}/Facade/Filter/FacadeFilter.tsx (94%) rename {components => features}/Filters/Filters.module.css (100%) rename {components => features}/Filters/Filters.tsx (82%) rename {components => features}/Filters/MobileFilters/MobileFilters.tsx (70%) rename {components => features}/Filters/components/Filter/Filter.module.css (100%) rename {components => features}/Filters/components/Filter/Filter.tsx (100%) rename {components => features}/Filters/components/Toggle/Toggle.module.css (100%) rename {components => features}/Filters/components/Toggle/Toggle.tsx (100%) rename {components => features}/Filters/index.ts (63%) rename {components/Layers => features}/Houses/CardContent/CardContent.module.css (100%) rename {components/Layers => features}/Houses/CardContent/CardContent.tsx (92%) rename {components/Layers => features}/Houses/CardContent/CardContent.types.ts (51%) rename {components/Layers => features}/Houses/Filter/Age/HouseAgeFilter.constants.ts (100%) rename {components/Layers => features}/Houses/Filter/Age/HouseAgeFilter.module.css (100%) rename {components/Layers => features}/Houses/Filter/Age/HouseAgeFilter.tsx (87%) rename {components/Layers => features}/Houses/Filter/Base/HouseBaseFilter.constants.ts (100%) rename {components/Layers => features}/Houses/Filter/Base/HouseBaseFilter.tsx (89%) rename {components/Layers => features}/Houses/Filter/Facade/HouseFacadeFilter.tsx (100%) rename {components/Layers => features}/Houses/Filter/Floor/HouseFloorFilter.constants.ts (100%) rename {components/Layers => features}/Houses/Filter/Floor/HouseFloorFilter.tsx (86%) rename {components/Layers => features}/Houses/Filter/WearTear/HouseWearTearFilter.tsx (79%) rename {components/Layers => features}/Houses/HealthProgress/HealthProgress.module.css (100%) rename {components/Layers => features}/Houses/HealthProgress/HealthProgress.tsx (100%) rename {components/Layers => features}/Houses/Houses.constants.ts (100%) rename {components/Layers => features}/Houses/houseBase.ts (100%) rename {components/Layers => features}/Lines/CardContent/CardContent.tsx (93%) rename {components/Layers => features}/Lines/Filter/LinesFilter.module.css (100%) rename {components/Layers => features}/Lines/Filter/LinesFilter.state.ts (100%) rename {components/Layers => features}/Lines/Filter/LinesFilter.tsx (97%) rename {components/Layers => features}/Lines/Filter/LinesFilter.types.ts (100%) rename {components/Layers => features}/Lines/Lines.constants.ts (100%) rename {components/Map/layers => features/Lines}/LinesSource.tsx (87%) rename {components/Layers => features}/Lines/lineType.ts (100%) rename {components/Layers => features}/Lines/lines.ts (100%) rename {components => features}/Map/Map.tsx (64%) rename {components => features}/Map/helpers/colorLuminance.ts (100%) rename {components => features}/Map/helpers/getFeatureState.ts (100%) rename {components/Map/providers => features/Map/helpers}/useMapObjectState.ts (100%) rename {components => features}/Map/providers/MapProvider.tsx (95%) rename {components => features}/Map/providers/usePopup.ts (92%) rename {components/Layers => features}/OKN/CardContent/CardContent.module.css (100%) rename {components/Layers => features}/OKN/CardContent/CardContent.tsx (95%) rename {components/Layers => features}/OKN/CardContent/components/OKNInfo/OKNInfo.module.css (100%) rename {components/Layers => features}/OKN/CardContent/components/OKNInfo/OKNInfo.tsx (96%) rename {components/Layers => features}/OKN/CardContent/index.ts (100%) rename {components/Layers => features}/OKN/Filter/OknFilter.module.css (100%) rename {components/Layers => features}/OKN/Filter/OknFilter.state.ts (100%) rename {components/Layers => features}/OKN/Filter/OknFilter.tsx (98%) rename {components/Layers => features}/OKN/Filter/OknFilter.types.ts (100%) rename {components/Layers => features}/OKN/Okn.constants.ts (100%) rename {components/Map/layers => features/OKN}/OknSource.tsx (91%) rename {components/Layers => features}/OKN/okn.ts (100%) rename {components/Layers => features}/OKN/oknConstants.ts (100%) rename {components/Layers => features}/OKN/oknObject.ts (100%) rename {components/Layers => features}/Quarter/CardContent/CardContent.module.css (100%) rename {components/Layers => features}/Quarter/CardContent/CardContent.tsx (75%) rename {components/Layers => features}/Quarter/Filter/QuarterFilter.module.css (100%) rename {components/Layers => features}/Quarter/Filter/QuarterFilter.tsx (96%) rename {components/Map/layers => features/Quarter}/QuarterSource.tsx (85%) rename {components/Layers => features}/Quarter/quarter.ts (100%) rename {components/Layers => features}/Quarter/quarterObject.ts (100%) create mode 100644 pages/Index/App.tsx rename {components/Layers => pages/Index}/Content.config.ts (51%) rename {components/Layers => pages/Index}/Filters.config.tsx (71%) create mode 100644 pages/Index/Sidebars.tsx rename components/Privacy.tsx => pages/Privacy/PrivacyPage.tsx (89%) rename {components/Card/components => shared/UI}/Label/Label.module.css (100%) rename {components/Card/components => shared/UI}/Label/Label.tsx (100%) rename {components/Card/components => shared/UI}/Label/Label.types.tsx (100%) rename {components/Card/components => shared/UI}/Link/Link.module.css (100%) rename {components/Card/components => shared/UI}/Link/Link.tsx (100%) rename shared/helpers/{use-match-media.ts => useMatchMedia.ts} (100%) rename types/{map-item.ts => Content.types.ts} (53%) rename types/{objectsBase.ts => ObjectsBase.types.ts} (100%) diff --git a/.eslintrc.json b/.eslintrc.json index ff6ed4c7..7b23c4f8 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -35,23 +35,27 @@ ] } ], - + "import/order": [ "error", { "groups": ["builtin", "external", "internal", "parent", "sibling", "index"] } ], - + "import/no-restricted-paths": [ "error", { "zones": [ // separate ui and logic - { "from": "./components", "target": "./shared" }, - { "from": "./state", "target": "./shared" }, { "from": "./constants", "target": "./shared" }, - { "from": "./pages", "target": "./shared" } + { "from": "./state", "target": "./shared" }, + { "from": "./components", "target": "./shared" }, + { "from": "./features", "target": "./shared" }, + { "from": "./pages", "target": "./shared" }, + { "from": "./types", "target": "./shared" }, + { "from": "./state", "target": "./components" }, + { "from": "./features", "target": "./components" } ] } ] diff --git a/components/App.tsx b/components/App.tsx deleted file mode 100644 index 81016270..00000000 --- a/components/App.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import React from 'react'; -import { Provider } from 'react-redux'; -import { MapProvider } from 'react-map-gl'; - -import { store } from 'state'; - -import { AboutProjectIcons } from 'components/AboutProjectIcons/AboutProjectIcons'; -import { LeftSidebar } from 'components/LeftSidebar/LeftSidebar'; -import { MobileFilters } from 'components/Filters'; -import { RightSidebar } from 'components/RightSidebar/RightSidebar'; -import { MobileCard } from 'components/Card'; -import { useIsDesktop } from 'shared/helpers/isDesktop'; -import { MobileAboutProject } from 'components/AboutProjectModal/MobileAboutProject'; -import { AboutProjectProvider } from 'state/providers/AboutProjectProvider'; -import { AboutProjectModal } from 'components/AboutProjectModal/AboutProjectModal'; -import { MapContextProvider } from './Map/providers/MapProvider'; -import { Footer } from './Footer/Footer'; -import { Copyright } from './Copyright/Copyright'; -import { Map } from './Map/Map'; - -export default function App() { - const isDesktop = useIsDesktop(); - - return ( - - - - - - {isDesktop ? ( - <> - - - - - ) : ( - <> - - - - - )} - - -