Skip to content

Commit

Permalink
Merge pull request #807 from mykhalenych/feature/prettier
Browse files Browse the repository at this point in the history
Feature/prettier
  • Loading branch information
mgrinko authored Feb 16, 2024
2 parents 89304bd + 384cb79 commit b8000b3
Show file tree
Hide file tree
Showing 11 changed files with 676 additions and 404 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/build
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"arrowParens": "avoid",
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"jsxSingleQuote": false,
"printWidth": 80,
"semi": true,
"bracketSpacing": true,
"bracketSameLine": false
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ using the Redux. It should look and work identically, so use the same markup.
components (no need to write them in the store file)

## Instructions
- Install Prettier Extention and use this [VSCode settings](https://mate-academy.github.io/fe-program/tools/vscode/settings.json) to enable format on save.
- Replace `<your_account>` with your Github username in the [DEMO LINK](https://<your_account>.github.io/react_redux-list-of-todos/)
- Follow the [React task guideline](https://github.com/mate-academy/react_task-guideline#react-tasks-guideline)
998 changes: 620 additions & 378 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"devDependencies": {
"@cypress/webpack-dev-server": "^1.8.4",
"@mate-academy/cypress-tools": "^1.0.5",
"@mate-academy/eslint-config-react-typescript": "^1.0.12",
"@mate-academy/scripts": "^1.2.12",
"@mate-academy/eslint-config-react-typescript": "^1.0.15",
"@mate-academy/scripts": "^1.7.0",
"@mate-academy/students-ts-config": "^0.0.4",
"@mate-academy/stylelint-config": "^0.0.11",
"@types/node": "^17.0.23",
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6",
"@mate-academy/stylelint-config": "^0.0.12",
"@types/node": "^16.18.80",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"@types/react-redux": "^7.1.31",
"@types/react-router-dom": "^5.3.3",
"cypress": "^9.5.3",
Expand All @@ -38,8 +38,9 @@
"mochawesome": "^7.1.3",
"mochawesome-merge": "^4.2.0",
"mochawesome-report-generator": "^6.2.0",
"node-sass": "^7.0.1",
"postcss": "^8.4.12",
"node-sass": "^6.0.1",
"prettier": "^3.2.5",
"stylelint": "^15.11.0",
"typescript": "^4.6.3"
},
Expand All @@ -49,7 +50,8 @@
"test": "mate-scripts test -l",
"lint-js": "mate-scripts lint -j",
"lint-css": "mate-scripts lint -s",
"lint": "npm run lint-js && npm run lint-css",
"format": "prettier --write './src/**/*.{ts,tsx}'",
"lint": "npm run format && npm run lint-js && npm run lint-css",
"update": "mate-scripts update",
"postinstall": "npm run update && cypress verify",
"predeploy": "npm run build",
Expand Down
5 changes: 3 additions & 2 deletions src/api.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Todo } from './types/Todo';
import { User } from './types/User';

// eslint-disable-next-line max-len
const BASE_URL = 'https://mate-academy.github.io/react_dynamic-list-of-todos/api';
// eslint-disable-next-line operator-linebreak
const BASE_URL =
'https://mate-academy.github.io/react_dynamic-list-of-todos/api';

function wait(delay: number): Promise<void> {
return new Promise(resolve => {
Expand Down
4 changes: 1 addition & 3 deletions src/app/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ const rootReducer = combineReducers({
// The `store` is passed to the Provider in `/src/index.tsx`
export const store = createStore(
rootReducer,
composeWithDevTools(
applyMiddleware(thunk),
),
composeWithDevTools(applyMiddleware(thunk)),
);

export type RootState = ReturnType<typeof store.getState>;
Expand Down
28 changes: 21 additions & 7 deletions src/components/TodoList/TodoList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable max-len */
/* eslint-disable */
import React from 'react';

export const TodoList: React.FC = () => {
Expand Down Expand Up @@ -47,7 +47,9 @@ export const TodoList: React.FC = () => {
<td className="is-vcentered"> </td>

<td className="is-vcentered is-expanded">
<p className="has-text-danger">quis ut nam facilis et officia qui</p>
<p className="has-text-danger">
quis ut nam facilis et officia qui
</p>
</td>

<td className="has-text-right is-vcentered">
Expand Down Expand Up @@ -78,7 +80,11 @@ export const TodoList: React.FC = () => {

<tr data-cy="todo">
<td className="is-vcentered">4</td>
<td className="is-vcentered"><span className="icon" data-cy="iconCompleted"><i className="fas fa-check" /></span></td>
<td className="is-vcentered">
<span className="icon" data-cy="iconCompleted">
<i className="fas fa-check" />
</span>
</td>
<td className="is-vcentered is-expanded">
<p className="has-text-success">et porro tempora</p>
</td>
Expand All @@ -97,7 +103,9 @@ export const TodoList: React.FC = () => {
<td className="is-vcentered"> </td>

<td className="is-vcentered is-expanded">
<p className="has-text-danger">laboriosam mollitia et enim quasi adipisci quia provident illum</p>
<p className="has-text-danger">
laboriosam mollitia et enim quasi adipisci quia provident illum
</p>
</td>

<td className="has-text-right is-vcentered">
Expand All @@ -114,7 +122,9 @@ export const TodoList: React.FC = () => {
<td className="is-vcentered"> </td>

<td className="is-vcentered is-expanded">
<p className="has-text-danger">qui ullam ratione quibusdam voluptatem quia omnis</p>
<p className="has-text-danger">
qui ullam ratione quibusdam voluptatem quia omnis
</p>
</td>

<td className="has-text-right is-vcentered">
Expand All @@ -131,7 +141,9 @@ export const TodoList: React.FC = () => {
<td className="is-vcentered"> </td>

<td className="is-vcentered is-expanded">
<p className="has-text-danger">illo expedita consequatur quia in</p>
<p className="has-text-danger">
illo expedita consequatur quia in
</p>
</td>

<td className="has-text-right is-vcentered">
Expand Down Expand Up @@ -192,7 +204,9 @@ export const TodoList: React.FC = () => {
</td>

<td className="is-vcentered is-expanded">
<p className="has-text-success">illo est ratione doloremque quia maiores aut</p>
<p className="has-text-success">
illo est ratione doloremque quia maiores aut
</p>
</td>

<td className="has-text-right is-vcentered">
Expand Down
4 changes: 3 additions & 1 deletion src/components/TodoModal/TodoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export const TodoModal: React.FC = () => {
</header>

<div className="modal-card-body">
<p className="block" data-cy="modal-title">fugiat veniam minus</p>
<p className="block" data-cy="modal-title">
fugiat veniam minus
</p>

<p className="block" data-cy="modal-user">
{/* For not completed */}
Expand Down
5 changes: 1 addition & 4 deletions src/features/currentTodo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ export const actions = { setTodo, removeTodo };
type State = Todo | null;
type Action = SetTodoAction | RemoveTodoAction;

const currentTodoReducer = (
state: State = null,
action: Action,
): State => {
const currentTodoReducer = (state: State = null, action: Action): State => {
switch (action.type) {
// Implement all actions here

Expand Down
4 changes: 3 additions & 1 deletion src/features/filter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const actions = { /* put action creators here */};
export const actions = {
/* put action creators here */
};

const filterReducer = () => {
return {
Expand Down

0 comments on commit b8000b3

Please sign in to comment.