Skip to content

Commit

Permalink
Merge pull request #9 from consdu/feature/format
Browse files Browse the repository at this point in the history
Feature/format
  • Loading branch information
consdu authored Dec 28, 2023
2 parents 0ef3510 + 71c7056 commit e22b616
Show file tree
Hide file tree
Showing 63 changed files with 441 additions and 229 deletions.
42 changes: 41 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,48 @@ module.exports = {
},
parser: "@typescript-eslint/parser",
parserOptions: { ecmaVersion: "latest", sourceType: "module" },
plugins: ["react-refresh", "jsx-a11y", "react-hooks"],
plugins: ["react-refresh", "jsx-a11y", "react-hooks", "perfectionist"],
rules: {
"perfectionist/sort-imports": [
"error",
{
groups: [
[
"type",
"parent-type",
"sibling-type",
"index-type",
"internal-type",
],
"react",
"next",
["builtin", "external"],
"alias",
["index", "parent", "sibling", "internal"],
["side-effect", "style"],
"object",
"unknown",
],
"custom-groups": {
value: {
react: [
"react",
"react-dom",
"react-native",
"react-router-dom",
"react-redux",
],
next: ["next", "next/*"],
alias: "@/**",
},
type: {
react: "react",
next: "next",
},
},
"newlines-between": "never",
},
],
"react-refresh/only-export-components": "warn",
"no-console": "error",
},
Expand Down
50 changes: 27 additions & 23 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="description"
content="An app that helps you manage your contact list"
/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#3d8c62" />
<meta name="msapplication-TileColor" content="#2c6f4c" />
<meta name="theme-color" content="#f1f8f4" />
<link
rel="preconnect"
href="https://constantin-dusescu-final-project-back.onrender.com"
/>
<link rel="preconnect" href="https://media.discordapp.net" />
<link rel="dns-prefetch" href="https://media.discordapp.net" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Contact-in</title>
</head>

<head>
<meta charset="UTF-8">
<meta name="description" content="An app that helps you manage your contact list">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#3d8c62">
<meta name="msapplication-TileColor" content="#2c6f4c">
<meta name="theme-color" content="#f1f8f4">
<link rel="preconnect" href="https://constantin-dusescu-final-project-back.onrender.com">
<link rel="preconnect" href="https://media.discordapp.net">
<link rel="dns-prefetch" href="https://media.discordapp.net">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact-in</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
175 changes: 172 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@vitest/coverage-c8": "^0.31.0",
"eslint": "^8.38.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-perfectionist": "^2.5.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.4",
Expand Down
8 changes: 4 additions & 4 deletions src/components/App/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useEffect } from "react";
import useLocalStorage from "../../hooks/useLocalStorage/useLocalStorage";
import useToken from "../../hooks/useToken/useToken";
import { useAppDispatch } from "../../store";
import { loginUserActionCreator } from "../../store/user/userSlice";
import useLocalStorage from "@/hooks/useLocalStorage/useLocalStorage";
import useToken from "@/hooks/useToken/useToken";
import { useAppDispatch } from "@/store";
import { loginUserActionCreator } from "@/store/user/userSlice";
import Layout from "../Layout/Layout";

const App = (): React.ReactElement => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button/Button.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { screen } from "@testing-library/react";
import { renderWithProviders } from "../../testUtils/testUtils";
import { renderWithProviders } from "@/testUtils/testUtils";
import Button from "./Button";

describe("Given a Button component", () => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/ContactCard/ContactCard.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { screen } from "@testing-library/react";
import { vi } from "vitest";
import userEvent from "@testing-library/user-event";
import { vi } from "vitest";
import { contactMock } from "@/factories/contacts/contactsFactory";
import { renderWithProviders, wrapWithRouter } from "@/testUtils/testUtils";
import ContactCard from "./ContactCard";
import { contactMock } from "../../factories/contacts/contactsFactory";
import { renderWithProviders, wrapWithRouter } from "../../testUtils/testUtils";

const handleDeleteClick = vi.fn();
describe("Given a ContactCard component", () => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ContactCard/ContactCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Link } from "react-router-dom";
import { ContactStructure } from "../../types";
import ContactCardStyled from "./ContactCardStyled";
import { IoCloseCircleOutline } from "react-icons/io5";
import { ContactStructure } from "@/types";
import ContactCardStyled from "./ContactCardStyled";

interface ContactCardProps {
contact: ContactStructure;
Expand Down
5 changes: 1 addition & 4 deletions src/components/ContactForm/ContactForm.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { vi } from "vitest";
import { fillContactForm, renderWithProviders } from "@/testUtils/testUtils";
import ContactForm from "./ContactForm";
import {
fillContactForm,
renderWithProviders,
} from "../../testUtils/testUtils";

const handleFormSubmit = vi.fn();

Expand Down
6 changes: 3 additions & 3 deletions src/components/ContactForm/ContactForm.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useState } from "react";
import {
IoPerson,
IoPeopleSharp,
Expand All @@ -10,10 +11,9 @@ import {
IoLogoInstagram,
IoLogoLinkedin,
} from "react-icons/io5";
import ContactFormStyled from "./ContactFormStyled";
import { useState } from "react";
import { ContactStructure } from "../../types";
import { ContactStructure } from "@/types";
import Button from "../Button/Button";
import ContactFormStyled from "./ContactFormStyled";

interface ContactFormProps {
buttonText: string;
Expand Down
4 changes: 2 additions & 2 deletions src/components/ContactList/ContactList.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { screen } from "@testing-library/react";
import { contactsMock } from "@/factories/contacts/contactsFactory";
import { renderWithProviders, wrapWithRouter } from "@/testUtils/testUtils";
import ContactList from "./ContactList";
import { contactsMock } from "../../factories/contacts/contactsFactory";
import { renderWithProviders, wrapWithRouter } from "../../testUtils/testUtils";

describe("Given a ContactList component", () => {
describe("When it receives a collection of contacts and it's rendered", () => {
Expand Down
Loading

0 comments on commit e22b616

Please sign in to comment.