Skip to content

Commit b8d7d72

Browse files
authored
Merge pull request #102 from BinaryStudioAcademy/task/thjs-55-add-prettier-lint-script-linting
thjs-55: Add prettier script linting
2 parents 628165a + c6bc87f commit b8d7d72

File tree

32 files changed

+128
-82
lines changed

32 files changed

+128
-82
lines changed

.lintstagedrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
'*': npm run lint:editorconfig && npm run lint:fs
2+
'*.{js,jsx,scss,json,md,html}': npm run prettify
23
shared/**/*.js: npm run lint:shared:js
34
client/src/**/*.{js,jsx}: npm run lint:client:js
45
client/src/**/*.scss: npm run lint:client:css

client/src/libs/components/checkbox/checkbox.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ const Checkbox = ({ name, label, control }) => {
1515
id="toggle-checkbox"
1616
className={`${styles.switch} ${styles.pointer}`}
1717
/>
18-
<label className={styles.pointer} htmlFor="toggle-checkbox">{label}</label>
18+
<label className={styles.pointer} htmlFor="toggle-checkbox">
19+
{label}
20+
</label>
1921
</div>
2022
);
2123
};

client/src/libs/components/message/message.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ import PropTypes from 'prop-types';
33
import styles from './styles.module.scss';
44

55
const Message = ({ children }) => (
6-
<div className={styles.message}>
7-
{children}
8-
</div>
6+
<div className={styles.message}>{children}</div>
97
);
108

119
Message.propTypes = {
12-
children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]).isRequired
10+
children: PropTypes.oneOfType([
11+
PropTypes.element,
12+
PropTypes.arrayOf(PropTypes.element)
13+
]).isRequired
1314
};
1415

1516
export { Message };

client/src/libs/components/notifications/notifications.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'react-toastify/dist/ReactToastify.css';
22

33
import { ToastContainer } from 'react-toastify';
44

5-
import { useDispatch,useEffect } from '~/libs/hooks/hooks.js';
5+
import { useDispatch, useEffect } from '~/libs/hooks/hooks.js';
66
import { userType } from '~/libs/prop-types/property-types.js';
77
import { actions as notificationActionCreator } from '~/slices/notifications/notifications.js';
88

client/src/libs/components/segment/segment.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ import PropTypes from 'prop-types';
33
import styles from './styles.module.scss';
44

55
const Segment = ({ children }) => (
6-
<div className={styles.segment}>
7-
{children}
8-
</div>
6+
<div className={styles.segment}>{children}</div>
97
);
108

119
Segment.propTypes = {
1210
children: PropTypes.node.isRequired
1311
};
1412

1513
export { Segment };
16-

client/src/libs/components/spinner/spinner.jsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ import PropTypes from 'prop-types';
22

33
import styles from './styles.module.scss';
44

5-
const Spinner = ({ isOverflow }) => (isOverflow
6-
? (
5+
const Spinner = ({ isOverflow }) =>
6+
isOverflow ? (
77
<div className={styles.container}>
88
<div className={styles.loader}>Loading...</div>
99
</div>
10-
)
11-
: (
10+
) : (
1211
<div className={styles.loader}>Loading...</div>
13-
));
12+
);
1413

1514
Spinner.propTypes = {
1615
isOverflow: PropTypes.bool

client/src/libs/hooks/hooks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export { useAppForm } from './app-form/app-form.hook.js';
2-
export { useCallback, useEffect, useMemo,useRef, useState } from 'react';
3-
export { useDispatch,useSelector } from 'react-redux';
2+
export { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3+
export { useDispatch, useSelector } from 'react-redux';
44
export { useLocation, useParams } from 'react-router-dom';
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export {
22
ImagePayloadKey,
3-
ImagesApiPath } from 'shared/src/packages/image/image.js';
3+
ImagesApiPath
4+
} from 'shared/src/packages/image/image.js';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { PostPayloadKey,PostsApiPath } from 'shared/src/packages/post/post';
1+
export { PostPayloadKey, PostsApiPath } from 'shared/src/packages/post/post';
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
const DEFAULT_USER_AVATAR = 'https://forwardsummit.ca/wp-content/uploads/2019/01/avatar-default.png';
1+
const DEFAULT_USER_AVATAR =
2+
'https://forwardsummit.ca/wp-content/uploads/2019/01/avatar-default.png';
23

34
export { DEFAULT_USER_AVATAR };

0 commit comments

Comments
 (0)