Skip to content

Commit c419d15

Browse files
committed
eslint cleanup
1 parent 922383e commit c419d15

37 files changed

+42
-47
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
},
116116
"scripts": {
117117
"clean": "rm -rf public/assets/*.{js,css,map}",
118+
"lint": "eslint ./resources/scripts/**/*.{ts,tsx} --ext .ts,.tsx",
118119
"watch": "cross-env NODE_ENV=development ./node_modules/.bin/webpack --watch --progress",
119120
"build": "cross-env NODE_ENV=development ./node_modules/.bin/webpack --progress",
120121
"build:production": "yarn run clean && cross-env NODE_ENV=production ./node_modules/.bin/webpack --mode production",

resources/scripts/.eslintrc.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ rules:
4949
"@typescript-eslint/no-explicit-any": 0
5050
"@typescript-eslint/no-non-null-assertion": 0
5151
"@typescript-eslint/ban-ts-comment": 0
52-
# @todo this would be nice to have, but don't want to deal with the warning spam at the moment.
52+
# This would be nice to have, but don't want to deal with the warning spam at the moment.
5353
"@typescript-eslint/explicit-module-boundary-types": 0
5454
no-restricted-imports:
5555
- error
@@ -58,6 +58,8 @@ rules:
5858
message: Please import from styled-components/macro.
5959
patterns:
6060
- "!styled-components/macro"
61+
# Not sure, this rule just doesn't work right and is protected by our use of Typescript anyways
62+
# so I'm just not going to worry about it.
6163
"react/prop-types": 0
6264
"react/display-name": 0
6365
"react/jsx-indent-props":

resources/scripts/api/account/createApiKey.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { ApiKey, rawDataToApiKey } from '@/api/account/getApiKeys';
33

44
export default (description: string, allowedIps: string): Promise<ApiKey & { secretToken: string }> => {
55
return new Promise((resolve, reject) => {
6-
http.post(`/api/client/account/api-keys`, {
6+
http.post('/api/client/account/api-keys', {
77
description,
8-
// eslint-disable-next-line @typescript-eslint/camelcase
98
allowed_ips: allowedIps.length > 0 ? allowedIps.split('\n') : [],
109
})
1110
.then(({ data }) => resolve({
1211
...rawDataToApiKey(data.attributes),
12+
// eslint-disable-next-line camelcase
1313
secretToken: data.meta?.secret_token ?? '',
1414
}))
1515
.catch(reject);

resources/scripts/api/account/updateAccountPassword.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ interface Data {
99
export default ({ current, password, confirmPassword }: Data): Promise<void> => {
1010
return new Promise((resolve, reject) => {
1111
http.put('/api/client/account/password', {
12-
// eslint-disable-next-line @typescript-eslint/camelcase
1312
current_password: current,
1413
password: password,
15-
// eslint-disable-next-line @typescript-eslint/camelcase
1614
password_confirmation: confirmPassword,
1715
})
1816
.then(() => resolve())

resources/scripts/api/auth/loginCheckpoint.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ import { LoginResponse } from '@/api/auth/login';
44
export default (token: string, code: string, recoveryToken?: string): Promise<LoginResponse> => {
55
return new Promise((resolve, reject) => {
66
http.post('/auth/login/checkpoint', {
7-
/* eslint-disable @typescript-eslint/camelcase */
87
confirmation_token: token,
98
authentication_code: code,
109
recovery_token: (recoveryToken && recoveryToken.length > 0) ? recoveryToken : undefined,
11-
/* eslint-enable @typescript-eslint/camelcase */
1210
})
1311
.then(response => resolve({
1412
complete: response.data.data.complete,

resources/scripts/api/auth/performPasswordReset.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export default (email: string, data: Data): Promise<PasswordResetResponse> => {
1717
email,
1818
token: data.token,
1919
password: data.password,
20-
// eslint-disable-next-line @typescript-eslint/camelcase
2120
password_confirmation: data.passwordConfirmation,
2221
})
2322
.then(response => resolve({

resources/scripts/api/getServers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ import http, { getPaginationSet, PaginatedResult } from '@/api/http';
33

44
export default (query?: string, includeAdmin?: boolean): Promise<PaginatedResult<Server>> => {
55
return new Promise((resolve, reject) => {
6-
http.get(`/api/client`, {
6+
http.get('/api/client', {
77
params: {
88
include: [ 'allocation' ],
9-
// eslint-disable-next-line @typescript-eslint/camelcase
109
filter: includeAdmin ? 'all' : undefined,
1110
query,
1211
},

resources/scripts/api/getSystemPermissions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import http from '@/api/http';
33

44
export default (): Promise<PanelPermissions> => {
55
return new Promise((resolve, reject) => {
6-
http.get(`/api/client/permissions`)
6+
http.get('/api/client/permissions')
77
.then(({ data }) => resolve(data.attributes.permissions))
88
.catch(reject);
99
});

resources/scripts/api/http.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const http: AxiosInstance = axios.create({
55
timeout: 20000,
66
headers: {
77
'X-Requested-With': 'XMLHttpRequest',
8-
'Accept': 'application/json',
8+
Accept: 'application/json',
99
'Content-Type': 'application/json',
1010
'X-CSRF-Token': (window as any).X_CSRF_TOKEN as string || '',
1111
},

resources/scripts/api/server/files/renameFile.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ interface Data {
88
export default (uuid: string, { renameFrom, renameTo }: Data): Promise<void> => {
99
return new Promise((resolve, reject) => {
1010
http.put(`/api/client/servers/${uuid}/files/rename`, {
11-
// eslint-disable-next-line @typescript-eslint/camelcase
1211
rename_from: renameFrom,
13-
// eslint-disable-next-line @typescript-eslint/camelcase
1412
rename_to: renameTo,
1513
})
1614
.then(() => resolve())

0 commit comments

Comments
 (0)