Skip to content

Commit 5597529

Browse files
committed
chore: align pre-commit with ESLint behavior and fix non-breaking lints
1 parent 20b9549 commit 5597529

File tree

138 files changed

+452
-503
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+452
-503
lines changed

package.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"build:profile": "cross-env PROFILE=true pnpm run build",
2424
"commit": "npx git-cz -a",
2525
"doc": "typedoc",
26-
"format": "biome check --write .",
27-
"format:check": "biome check .",
26+
"format": "biome check --linter-enabled=false --write .",
27+
"format:check": "biome check --linter-enabled=false .",
2828
"prettier": "prettier --write '**/*.{md,mdx,yml,yaml}'",
2929
"lint": "biome lint .",
3030
"lint:fix": "biome check --write .",
@@ -35,6 +35,16 @@
3535
"test:ui": "vitest --ui"
3636
},
3737
"lint-staged": {
38+
"globOptions": {
39+
"ignore": [
40+
"**/*.gen.ts",
41+
"packages_generated/**",
42+
"**/dist/**",
43+
"**/build/**",
44+
"**/coverage/**",
45+
"**/examples/**"
46+
]
47+
},
3848
"*.{ts,tsx,js,jsx}": [
3949
"biome check --write --no-errors-on-unmatched --files-ignore-unknown=true"
4050
],

packages/client/src/helpers/json.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* biome-ignore lint/style/useNamingConvention: public alias intended as JSON shape */
12
export type JSON =
23
| string
34
| number

packages/client/src/internal/async/interval-retrier.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ export const tryAtIntervals = async <T>(
111111
const timeoutTimestamp = Date.now() + timeout * 1000
112112
let retryCount = 0
113113
while (Date.now() <= timeoutTimestamp) {
114-
const delay = strategy.next((retryCount += 1)).value * 1000
114+
retryCount += 1
115+
const delay = strategy.next(retryCount).value * 1000
115116
// Break if timeout has been reached
116117
if (timeoutTimestamp <= Date.now() + delay) break
117118
// Wait before the next retry

packages/client/src/internal/validations/__tests__/string-validation.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ const validators = [
7878
for (const component of validators) {
7979
describe(component.validator.name, () => {
8080
it(`validates correct ${component.name} format`, () => {
81-
component.valids.forEach(str =>
82-
expect(component.validator(str)).toStrictEqual(true),
83-
)
81+
for (const str of component.valids) {
82+
expect(component.validator(str)).toStrictEqual(true)
83+
}
8484
})
8585
it(`doesn't validate incorrect ${component.name} format`, () => {
86-
component.invalids.forEach(str =>
87-
expect(component.validator(str)).toStrictEqual(false),
88-
)
86+
for (const str of component.invalids) {
87+
expect(component.validator(str)).toStrictEqual(false)
88+
}
8989
})
9090
})
9191
}

packages/client/src/scw/fetch/http-interceptors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
import { dumpRequest, dumpResponse } from './http-dumper.js'
1111

1212
/**
13-
* Mapper d'une entrée d'en-tête.
13+
* Mapper of a header entry.
1414
*
1515
* @internal
1616
*/

packages_generated/account/src/v3/api.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// This file was automatically generated. DO NOT EDIT.
22
// If you have any remark or suggestion do not hesitate to open an issue.
33
import {
4-
enrichForPagination,
54
API as ParentAPI,
5+
enrichForPagination,
66
urlParams,
77
validatePathParam,
88
} from '@scaleway/sdk-client'

packages_generated/account/src/v3/marshalling.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// This file was automatically generated. DO NOT EDIT.
22
// If you have any remark or suggestion do not hesitate to open an issue.
33
import randomName from '@scaleway/random-name'
4-
import type { DefaultValues } from '@scaleway/sdk-client'
54
import {
65
isJSONObject,
76
resolveOneOf,
87
unmarshalArrayOfObject,
98
unmarshalDate,
109
} from '@scaleway/sdk-client'
10+
import type { DefaultValues } from '@scaleway/sdk-client'
1111
import type {
1212
CheckContractSignatureResponse,
1313
Contract,

packages_generated/account/src/v3/validation-rules.gen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ export const ProjectApiCreateProjectRequest = {
3030
name: {
3131
maxLength: 64,
3232
minLength: 1,
33-
pattern: /^[a-zA-Z0-9._\- ]+$/,
33+
pattern: /^[a-zA-Z0-9\._\- ]+$/,
3434
},
3535
}
3636

3737
export const ProjectApiListProjectsRequest = {
3838
name: {
3939
maxLength: 64,
4040
minLength: 1,
41-
pattern: /^[a-zA-Z0-9._\- ]+$/,
41+
pattern: /^[a-zA-Z0-9\._\- ]+$/,
4242
},
4343
page: {
4444
greaterThan: 0,
@@ -56,6 +56,6 @@ export const ProjectApiUpdateProjectRequest = {
5656
name: {
5757
maxLength: 64,
5858
minLength: 1,
59-
pattern: /^[a-zA-Z0-9._\- ]+$/,
59+
pattern: /^[a-zA-Z0-9\._\- ]+$/,
6060
},
6161
}

packages_generated/applesilicon/src/v1alpha1/api.gen.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
// This file was automatically generated. DO NOT EDIT.
22
// If you have any remark or suggestion do not hesitate to open an issue.
3-
4-
import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client'
53
import {
6-
enrichForPagination,
74
API as ParentAPI,
5+
enrichForPagination,
86
toApiLocality,
97
urlParams,
108
validatePathParam,
119
waitForResource,
1210
} from '@scaleway/sdk-client'
11+
import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client'
1312
import {
1413
SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES as SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES_APPLESILICON,
1514
SERVER_TRANSIENT_STATUSES as SERVER_TRANSIENT_STATUSES_APPLESILICON,
@@ -26,8 +25,8 @@ import {
2625
unmarshalConnectivityDiagnostic,
2726
unmarshalListOSResponse,
2827
unmarshalListServerPrivateNetworksResponse,
29-
unmarshalListServersResponse,
3028
unmarshalListServerTypesResponse,
29+
unmarshalListServersResponse,
3130
unmarshalOS,
3231
unmarshalServer,
3332
unmarshalServerPrivateNetwork,
@@ -48,10 +47,10 @@ import type {
4847
ListOSRequest,
4948
ListOSResponse,
5049
ListServerPrivateNetworksResponse,
51-
ListServersRequest,
52-
ListServersResponse,
5350
ListServerTypesRequest,
5451
ListServerTypesResponse,
52+
ListServersRequest,
53+
ListServersResponse,
5554
OS,
5655
PrivateNetworkApiAddServerPrivateNetworkRequest,
5756
PrivateNetworkApiDeleteServerPrivateNetworkRequest,

packages_generated/applesilicon/src/v1alpha1/index.gen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ export type {
2727
ListOSResponse,
2828
ListServerPrivateNetworksRequestOrderBy,
2929
ListServerPrivateNetworksResponse,
30+
ListServerTypesRequest,
31+
ListServerTypesResponse,
3032
ListServersRequest,
3133
ListServersRequestOrderBy,
3234
ListServersResponse,
33-
ListServerTypesRequest,
34-
ListServerTypesResponse,
3535
OS,
3636
OSSupportedServerType,
3737
PrivateNetworkApiAddServerPrivateNetworkRequest,
@@ -53,8 +53,8 @@ export type {
5353
ServerTypeDisk,
5454
ServerTypeGPU,
5555
ServerTypeMemory,
56-
ServerTypeNetwork,
5756
ServerTypeNPU,
57+
ServerTypeNetwork,
5858
ServerTypeStock,
5959
SetServerPrivateNetworksResponse,
6060
StartConnectivityDiagnosticRequest,

0 commit comments

Comments
 (0)