Skip to content

Commit c12fa06

Browse files
committed
chore: yarn lint:fix
1 parent 83835f3 commit c12fa06

33 files changed

+1008
-1007
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
],
2020
"config": {
2121
"allow-plugins": {
22-
"dealerdirect/phpcodesniffer-composer-installer": true
22+
"dealerdirect/phpcodesniffer-composer-installer": true,
23+
"phpstan/extension-installer": true
2324
}
2425
},
2526
"require": {

js/src/App1.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import '@/assets/scss/index.scss'
22
import DefaultPage from './pages'
33

44
function App() {
5-
return <DefaultPage />
5+
return <DefaultPage />
66
}
77

88
export default App

js/src/App2.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import '@/assets/scss/index.scss'
22
import DefaultPage from './pages'
33

44
function App2() {
5-
return <DefaultPage />
5+
return <DefaultPage />
66
}
77

88
export default App2

js/src/api/axios.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ import { apiUrl, apiTimeout } from '@/utils'
44
const wpApiSettings = window?.wpApiSettings || {}
55

66
const instance: AxiosInstance = axios.create({
7-
baseURL: apiUrl,
8-
timeout: parseInt(apiTimeout, 10),
9-
headers: {
10-
'X-WP-Nonce': wpApiSettings?.nonce || '',
11-
'Content-Type': 'application/json',
12-
},
7+
baseURL: apiUrl,
8+
timeout: parseInt(apiTimeout, 10),
9+
headers: {
10+
'X-WP-Nonce': wpApiSettings?.nonce || '',
11+
'Content-Type': 'application/json',
12+
},
1313
})
1414

1515
instance.interceptors.response.use(
16-
function (response) {
17-
return response
18-
},
19-
async function (error) {
20-
// Any status codes that falls outside the range of 2xx cause this function to trigger
16+
function (response) {
17+
return response
18+
},
19+
async function (error) {
20+
// Any status codes that falls outside the range of 2xx cause this function to trigger
2121

22-
console.log('error', error)
22+
console.log('error', error)
2323

24-
return Promise.reject(error)
25-
},
24+
return Promise.reject(error)
25+
},
2626
)
2727

2828
export default instance

js/src/api/resources/adminAjax.tsx

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,33 @@ import { ajaxUrl } from '@/utils'
44
import { AxiosRequestConfig } from 'axios'
55

66
export type TAdminAjaxArgs = {
7-
action: string
8-
nonce: string
9-
[key: string]: string | number | undefined
7+
action: string
8+
nonce: string
9+
[key: string]: string | number | undefined
1010
}
1111

1212
export const adminAjax = async ({
13-
args,
14-
config = undefined,
13+
args,
14+
config = undefined,
1515
}: {
16-
args?: TAdminAjaxArgs
17-
config?: AxiosRequestConfig<{ [key: string]: any }> | undefined
16+
args?: TAdminAjaxArgs
17+
config?: AxiosRequestConfig<{ [key: string]: any }> | undefined
1818
}) => {
19-
const formData = new FormData()
19+
const formData = new FormData()
2020

21-
if (!!args) {
22-
Object.keys(args).forEach((key) => {
23-
formData.append(key, args[key] as string)
24-
})
25-
}
21+
if (!!args) {
22+
Object.keys(args).forEach((key) => {
23+
formData.append(key, args[key] as string)
24+
})
25+
}
2626

27-
const result = await axios.post(ajaxUrl, formData, {
28-
...config,
29-
headers: {
30-
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
31-
Accept: 'application/json',
32-
},
33-
})
27+
const result = await axios.post(ajaxUrl, formData, {
28+
...config,
29+
headers: {
30+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
31+
Accept: 'application/json',
32+
},
33+
})
3434

35-
return result
35+
return result
3636
}

js/src/api/resources/create.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ import { TDataProvider } from '@/types'
44
import { AxiosRequestConfig } from 'axios'
55

66
export const createResource = async ({
7-
resource,
8-
dataProvider = 'wp-rest',
9-
args,
10-
config,
7+
resource,
8+
dataProvider = 'wp-rest',
9+
args,
10+
config,
1111
}: {
12-
resource: string
13-
dataProvider?: TDataProvider
14-
args?: {
15-
[key: string]: any
16-
}
17-
config?: AxiosRequestConfig<{ [key: string]: any }> | undefined
12+
resource: string
13+
dataProvider?: TDataProvider
14+
args?: {
15+
[key: string]: any
16+
}
17+
config?: AxiosRequestConfig<{ [key: string]: any }> | undefined
1818
}) => {
19-
const dataProviderUrlParams = getDataProviderUrlParams(dataProvider)
20-
const createResult = await axios.post(
21-
`${apiUrl}/${dataProviderUrlParams}/${resource}`,
22-
args,
23-
config,
24-
)
19+
const dataProviderUrlParams = getDataProviderUrlParams(dataProvider)
20+
const createResult = await axios.post(
21+
`${apiUrl}/${dataProviderUrlParams}/${resource}`,
22+
args,
23+
config,
24+
)
2525

26-
return createResult
26+
return createResult
2727
}

js/src/api/resources/delete.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ import { TDataProvider } from '@/types'
44
import { AxiosRequestConfig } from 'axios'
55

66
export const deleteResource = async ({
7-
resource,
8-
dataProvider = 'wp-rest',
9-
pathParams = [],
10-
config = undefined,
7+
resource,
8+
dataProvider = 'wp-rest',
9+
pathParams = [],
10+
config = undefined,
1111
}: {
12-
resource: string
13-
dataProvider?: TDataProvider
14-
pathParams?: string[]
15-
config?: AxiosRequestConfig<{ [key: string]: any }> | undefined
12+
resource: string
13+
dataProvider?: TDataProvider
14+
pathParams?: string[]
15+
config?: AxiosRequestConfig<{ [key: string]: any }> | undefined
1616
}) => {
17-
const dataProviderUrlParams = getDataProviderUrlParams(dataProvider)
18-
const deleteResult = await axios.delete(
19-
`${apiUrl}/${dataProviderUrlParams}/${resource}/${pathParams.join('/')}`,
20-
config,
21-
)
17+
const dataProviderUrlParams = getDataProviderUrlParams(dataProvider)
18+
const deleteResult = await axios.delete(
19+
`${apiUrl}/${dataProviderUrlParams}/${resource}/${pathParams.join('/')}`,
20+
config,
21+
)
2222

23-
return deleteResult
23+
return deleteResult
2424
}

js/src/api/resources/get.tsx

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,49 @@ import { TDataProvider } from '@/types'
44
import { AxiosRequestConfig } from 'axios'
55

66
export const getResource = async ({
7-
resource,
8-
dataProvider = 'wp-rest',
9-
pathParams = [],
10-
args = {},
11-
config = undefined,
7+
resource,
8+
dataProvider = 'wp-rest',
9+
pathParams = [],
10+
args = {},
11+
config = undefined,
1212
}: {
13-
resource: string
14-
dataProvider?: TDataProvider
15-
pathParams?: string[]
16-
args?: Record<string, string>
17-
config?: AxiosRequestConfig<{ [key: string]: any }> | undefined
13+
resource: string
14+
dataProvider?: TDataProvider
15+
pathParams?: string[]
16+
args?: Record<string, string>
17+
config?: AxiosRequestConfig<{ [key: string]: any }> | undefined
1818
}) => {
19-
const dataProviderUrlParams = getDataProviderUrlParams(dataProvider)
20-
const getResult = await axios.get(
21-
`${apiUrl}/${dataProviderUrlParams}/${resource}/${pathParams.join(
22-
'/',
23-
)}?${new URLSearchParams(args).toString()}`,
24-
config,
25-
)
19+
const dataProviderUrlParams = getDataProviderUrlParams(dataProvider)
20+
const getResult = await axios.get(
21+
`${apiUrl}/${dataProviderUrlParams}/${resource}/${pathParams.join(
22+
'/',
23+
)}?${new URLSearchParams(args).toString()}`,
24+
config,
25+
)
2626

27-
return getResult
27+
return getResult
2828
}
2929

3030
export const getResources = async ({
31-
resource,
32-
dataProvider = 'wp-rest',
33-
pathParams = [],
34-
args = {},
35-
config = undefined,
31+
resource,
32+
dataProvider = 'wp-rest',
33+
pathParams = [],
34+
args = {},
35+
config = undefined,
3636
}: {
37-
resource: string
38-
dataProvider?: TDataProvider
39-
pathParams?: string[]
40-
args?: Record<string, string>
41-
config?: AxiosRequestConfig<{ [key: string]: any }> | undefined
37+
resource: string
38+
dataProvider?: TDataProvider
39+
pathParams?: string[]
40+
args?: Record<string, string>
41+
config?: AxiosRequestConfig<{ [key: string]: any }> | undefined
4242
}) => {
43-
const dataProviderUrlParams = getDataProviderUrlParams(dataProvider)
44-
const getResult = await axios.get(
45-
`${apiUrl}/${dataProviderUrlParams}/${resource}/${pathParams.join(
46-
'/',
47-
)}?${new URLSearchParams(args).toString()}`,
48-
config,
49-
)
43+
const dataProviderUrlParams = getDataProviderUrlParams(dataProvider)
44+
const getResult = await axios.get(
45+
`${apiUrl}/${dataProviderUrlParams}/${resource}/${pathParams.join(
46+
'/',
47+
)}?${new URLSearchParams(args).toString()}`,
48+
config,
49+
)
5050

51-
return getResult
51+
return getResult
5252
}

js/src/api/resources/update.tsx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@ import { TDataProvider } from '@/types'
44
import { AxiosRequestConfig } from 'axios'
55

66
export const updateResource = async ({
7-
resource,
8-
dataProvider = 'wp-rest',
9-
pathParams = [],
10-
args = {},
11-
config = undefined,
7+
resource,
8+
dataProvider = 'wp-rest',
9+
pathParams = [],
10+
args = {},
11+
config = undefined,
1212
}: {
13-
resource: string
14-
dataProvider?: TDataProvider
15-
pathParams?: string[]
16-
args?: {
17-
[key: string]: any
18-
}
19-
config?: AxiosRequestConfig<{ [key: string]: any }> | undefined
13+
resource: string
14+
dataProvider?: TDataProvider
15+
pathParams?: string[]
16+
args?: {
17+
[key: string]: any
18+
}
19+
config?: AxiosRequestConfig<{ [key: string]: any }> | undefined
2020
}) => {
21-
const dataProviderUrlParams = getDataProviderUrlParams(dataProvider)
22-
const updateResult = await axios.post(
23-
`${apiUrl}/${dataProviderUrlParams}/${resource}/${pathParams.join('/')}`,
24-
args,
25-
config,
26-
)
21+
const dataProviderUrlParams = getDataProviderUrlParams(dataProvider)
22+
const updateResult = await axios.post(
23+
`${apiUrl}/${dataProviderUrlParams}/${resource}/${pathParams.join('/')}`,
24+
args,
25+
config,
26+
)
2727

28-
return updateResult
28+
return updateResult
2929
}

js/src/assets/scss/global.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ div[class^="ant-"] {
3030
outline: none !important;
3131
}
3232
span.from {
33-
@apply hidden;
33+
display: none;
3434
}
3535

3636
input[class*="ant-input"],

0 commit comments

Comments
 (0)