Skip to content

Commit

Permalink
prettier test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ömer Faruk APLAK committed May 31, 2021
1 parent 3d67b74 commit b229f10
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ build/
dist/
node_modules/
.snapshots/
*.min.js
*.min.js
**/**/coverage
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ node_modules
.cache
dist
.rpt2_cache
.vscode
.husky
coverage

Expand Down
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build/
dist/
node_modules/
.snapshots/
*.min.js
packages/**/coverage/
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"arrowParens": "always",
"semi": true,
"trailingComma": "all",
"singleQuote": false,
"printWidth": 80,
"tabWidth": 4
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"editor.formatOnSave": false
}

2 changes: 1 addition & 1 deletion examples/customThemeLess/src/pages/posts/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import "react-mde/lib/styles/css/react-mde-all.css";

import { IPost, ICategory } from "interfaces";

export const PostEdit: React.FC<IResourceComponentsProps> = (props) => {
export const PostEdit: React.FC<IResourceComponentsProps> = (props) => {
const { formProps, saveButtonProps, queryResult } = useForm<IPost>();

const postData = queryResult?.data?.data;
Expand Down
2 changes: 1 addition & 1 deletion examples/customThemeLess/src/pages/posts/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {

import { IPost, ICategory } from "interfaces";

export const PostList: React.FC<IResourceComponentsProps> = (props) => {
export const PostList: React.FC<IResourceComponentsProps> = (props) => {
const { tableProps } = useTable<IPost>();

const categoryIds =
Expand Down
2 changes: 1 addition & 1 deletion examples/customThemeLess/src/pages/posts/show.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { IPost, ICategory } from "interfaces";

const { Title, Text } = Typography;

export const PostShow: React.FC<IResourceComponentsProps> = (props) => {
export const PostShow: React.FC<IResourceComponentsProps> = (props) => {
const { queryResult } = useShow<IPost>();
const { data, isLoading } = queryResult;
const record = data?.data;
Expand Down
9 changes: 6 additions & 3 deletions examples/export/src/pages/posts/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ export const PostList: React.FC<IResourceComponentsProps> = (props) => {
);

return (
<List {...props} pageHeaderProps={{
extra: <Actions />,
}}>
<List
{...props}
pageHeaderProps={{
extra: <Actions />,
}}
>
<Table {...tableProps} key="id">
<Table.Column key="id" dataIndex="id" title="ID" />
<Table.Column key="title" dataIndex="title" title="Title" />
Expand Down
2 changes: 1 addition & 1 deletion examples/login/src/pages/posts/show.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const PostShow: React.FC<IResourceComponentsProps> = (props) => {
const {
data: categoryData,
isLoading: categoryIsLoading,
} = useOne<ICategory>("categories", record?.category.id || "", {
} = useOne<ICategory>("categories", record?.category.id || "", {
enabled: !!record,
});

Expand Down
2 changes: 1 addition & 1 deletion examples/tutorial/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ export const App: React.FC = () => {
/>
</Admin>
);
}
};
10 changes: 9 additions & 1 deletion examples/tutorial/src/pages/posts/edit.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { useForm, Form, Input, Select, Edit, useSelect, IResourceComponentsProps } from "@pankod/refine";
import {
useForm,
Form,
Input,
Select,
Edit,
useSelect,
IResourceComponentsProps,
} from "@pankod/refine";

import { IPost } from "interfaces";

Expand Down
9 changes: 8 additions & 1 deletion examples/tutorial/src/pages/posts/show.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { Show, useShow, Typography, Tag, useOne, IResourceComponentsProps } from "@pankod/refine";
import {
Show,
useShow,
Typography,
Tag,
useOne,
IResourceComponentsProps,
} from "@pankod/refine";
import { IPost, ICategory } from "interfaces";

const { Title, Text } = Typography;
Expand Down
13 changes: 3 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"start": "lerna run start --stream --parallel",
"test": "lerna run test --stream --parallel",
"test:coverage": "jest --runInBand --silent --ci --coverage",
"lint": "eslint packages example examples",
"lint:fix": "npm run lint -- --quiet --fix",
"lint": "eslint -c ./.eslintrc packages example examples",
"prettier": "prettier -c ./.prettierrc '{packages,examples,example}/**/*.{ts,tsx}'",
"lint:fix": "npm run lint -- --quiet --fix && npm run prettier -- --write",
"build": "lerna run build",
"bootstrap:docker": "lerna bootstrap -- --production --no-optional",
"nuke": "rm -rf node_modules; rm -rf example/node_modules; for d in packages/*/node_modules; do echo $d; rm -rf $d; done; for d in packages/*/dist; do echo $d; rm -rf $d; done; for d in examples/*/node_modules; do echo $d; rm -rf $d; done"
Expand All @@ -26,14 +27,6 @@
"pre-commit": "lint-staged"
}
},
"prettier": {
"arrowParens": "always",
"semi": true,
"trailingComma": "all",
"singleQuote": false,
"printWidth": 10,
"tabWidth": 4
},
"name": "refinejs-repo",
"author": "Pankod",
"devDependencies": {
Expand Down
4 changes: 1 addition & 3 deletions packages/core/src/components/notification/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ export const Notification: React.FC<{
notifications.forEach((notificationItem: INotification) => {
if (notificationItem.isRunning === true) {
if (notificationItem.seconds === 0) {
removeNotification(
notificationItem.id,
);
removeNotification(notificationItem.id);

return;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/hooks/data/useCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type UseCreateReturnType<

export const useCreate = <
TData extends BaseRecord = BaseRecord,
TError extends HttpError = HttpError,
TError extends HttpError = HttpError,
TVariables = {}
>(): UseCreateReturnType<TData, TError, TVariables> => {
const { create } = useContext<IDataContext>(DataContext);
Expand Down
5 changes: 4 additions & 1 deletion packages/json-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ const JsonServer = (
createMany: async (resource, params) => {
const response = await Promise.all(
params.map(async (param) => {
const { data } = await httpClient.post(`${apiUrl}/${resource}`, param);
const { data } = await httpClient.post(
`${apiUrl}/${resource}`,
param,
);
return data;
}),
);
Expand Down

0 comments on commit b229f10

Please sign in to comment.