Skip to content

Commit 13bb652

Browse files
anonrigandreiborza
andauthored
build: update biome to v1.5.2 (#10102)
Co-authored-by: Andrei Borza <[email protected]>
1 parent c965af2 commit 13bb652

File tree

26 files changed

+167
-163
lines changed

26 files changed

+167
-163
lines changed

biome.json

+10-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"vcs": {
44
"enabled": true,
55
"clientKind": "git",
6-
"useIgnoreFile": true
6+
"useIgnoreFile": true,
7+
"defaultBranch": "develop"
78
},
89
"organizeImports": {
910
"enabled": true
@@ -17,13 +18,15 @@
1718
"noUnusedVariables": "error",
1819
"noPrecisionLoss": "error"
1920
},
21+
"complexity": {
22+
"useRegexLiterals": "error"
23+
},
2024
"suspicious": {
2125
"all": false,
2226
"noControlCharactersInRegex": "error"
2327
},
2428
"nursery": {
25-
"noUnusedImports": "error",
26-
"useRegexLiterals": "error"
29+
"noUnusedImports": "error"
2730
},
2831
"performance": {
2932
"all": true,
@@ -92,6 +95,10 @@
9295
"json": {
9396
"formatter": {
9497
"enabled": true
98+
},
99+
"parser": {
100+
"allowComments": true,
101+
"allowTrailingCommas": true
95102
}
96103
}
97104
}

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-late/subject.js

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
const blockUI = (delay = 70) => e => {
2-
const startTime = Date.now();
1+
const blockUI =
2+
(delay = 70) =>
3+
e => {
4+
const startTime = Date.now();
35

4-
function getElasped() {
5-
const time = Date.now();
6-
return time - startTime;
7-
}
6+
function getElasped() {
7+
const time = Date.now();
8+
return time - startTime;
9+
}
810

9-
while (getElasped() < delay) {
10-
//
11-
}
11+
while (getElasped() < delay) {
12+
//
13+
}
1214

13-
e.target.classList.add('clicked');
14-
};
15+
e.target.classList.add('clicked');
16+
};
1517

1618
document.querySelector('[data-test-id=not-so-slow-button]').addEventListener('click', blockUI(300));
1719
document.querySelector('[data-test-id=slow-button]').addEventListener('click', blockUI(450));

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-parametrized-late/subject.js

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
const blockUI = (delay = 70) => e => {
2-
const startTime = Date.now();
1+
const blockUI =
2+
(delay = 70) =>
3+
e => {
4+
const startTime = Date.now();
35

4-
function getElasped() {
5-
const time = Date.now();
6-
return time - startTime;
7-
}
6+
function getElasped() {
7+
const time = Date.now();
8+
return time - startTime;
9+
}
810

9-
while (getElasped() < delay) {
10-
//
11-
}
11+
while (getElasped() < delay) {
12+
//
13+
}
1214

13-
e.target.classList.add('clicked');
14-
};
15+
e.target.classList.add('clicked');
16+
};
1517

1618
document.querySelector('[data-test-id=not-so-slow-button]').addEventListener('click', blockUI(300));
1719
document.querySelector('[data-test-id=slow-button]').addEventListener('click', blockUI(450));

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-parametrized/subject.js

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
const blockUI = (delay = 70) => e => {
2-
const startTime = Date.now();
1+
const blockUI =
2+
(delay = 70) =>
3+
e => {
4+
const startTime = Date.now();
35

4-
function getElasped() {
5-
const time = Date.now();
6-
return time - startTime;
7-
}
6+
function getElasped() {
7+
const time = Date.now();
8+
return time - startTime;
9+
}
810

9-
while (getElasped() < delay) {
10-
//
11-
}
11+
while (getElasped() < delay) {
12+
//
13+
}
1214

13-
e.target.classList.add('clicked');
14-
};
15+
e.target.classList.add('clicked');
16+
};
1517

1618
document.querySelector('[data-test-id=not-so-slow-button]').addEventListener('click', blockUI(300));
1719
document.querySelector('[data-test-id=slow-button]').addEventListener('click', blockUI(450));

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp/subject.js

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
const blockUI = (delay = 70) => e => {
2-
const startTime = Date.now();
1+
const blockUI =
2+
(delay = 70) =>
3+
e => {
4+
const startTime = Date.now();
35

4-
function getElasped() {
5-
const time = Date.now();
6-
return time - startTime;
7-
}
6+
function getElasped() {
7+
const time = Date.now();
8+
return time - startTime;
9+
}
810

9-
while (getElasped() < delay) {
10-
//
11-
}
11+
while (getElasped() < delay) {
12+
//
13+
}
1214

13-
e.target.classList.add('clicked');
14-
};
15+
e.target.classList.add('clicked');
16+
};
1517

1618
document.querySelector('[data-test-id=not-so-slow-button]').addEventListener('click', blockUI(300));
1719
document.querySelector('[data-test-id=slow-button]').addEventListener('click', blockUI(450));

dev-packages/browser-integration-tests/utils/helpers.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,10 @@ export const countEnvelopes = async (
134134

135135
page.on('request', requestHandler);
136136

137-
setTimeout(
138-
() => {
139-
page.off('request', requestHandler);
140-
resolve(reqCount);
141-
},
142-
options?.timeout || 1000,
143-
);
137+
setTimeout(() => {
138+
page.off('request', requestHandler);
139+
resolve(reqCount);
140+
}, options?.timeout || 1000);
144141
});
145142

146143
if (options?.url) {

dev-packages/e2e-tests/test-applications/angular-17/tsconfig.app.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
"outDir": "./out-tsc/app",
66
"types": []
77
},
8-
"files": [
9-
"src/main.ts"
10-
],
11-
"include": [
12-
"src/**/*.d.ts"
13-
]
8+
"files": ["src/main.ts"],
9+
"include": ["src/**/*.d.ts"]
1410
}

dev-packages/e2e-tests/test-applications/angular-18/tsconfig.app.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
"outDir": "./out-tsc/app",
66
"types": []
77
},
8-
"files": [
9-
"src/main.ts"
10-
],
11-
"include": [
12-
"src/**/*.d.ts"
13-
]
8+
"files": ["src/main.ts"],
9+
"include": ["src/**/*.d.ts"]
1410
}

dev-packages/e2e-tests/test-applications/angular-19/tsconfig.app.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
"outDir": "./out-tsc/app",
77
"types": []
88
},
9-
"files": [
10-
"src/main.ts"
11-
],
12-
"include": [
13-
"src/**/*.d.ts"
14-
]
9+
"files": ["src/main.ts"],
10+
"include": ["src/**/*.d.ts"]
1511
}

dev-packages/e2e-tests/test-applications/angular-19/tsconfig.spec.json

+2-7
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
"extends": "./tsconfig.json",
55
"compilerOptions": {
66
"outDir": "./out-tsc/spec",
7-
"types": [
8-
"jasmine"
9-
]
7+
"types": ["jasmine"]
108
},
11-
"include": [
12-
"src/**/*.spec.ts",
13-
"src/**/*.d.ts"
14-
]
9+
"include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
1510
}

dev-packages/e2e-tests/test-applications/ember-classic/tsconfig.app.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@
1818
],
1919
}
2020
},
21-
"include": [
22-
"app/**/*",
23-
"types/**/*"
24-
],
21+
"include": ["app/**/*", "types/**/*"],
2522
"exclude": ["tests/**/*"],
2623
"ts-node": {
2724
"compilerOptions": {
2825
"module": "CommonJS"
2926
}
3027
}
31-
3228
}

dev-packages/e2e-tests/test-applications/ember-embroider/tsconfig.app.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@
1818
],
1919
}
2020
},
21-
"include": [
22-
"app/**/*",
23-
"types/**/*"
24-
],
21+
"include": ["app/**/*", "types/**/*"],
2522
"exclude": ["tests/**/*"],
2623
"ts-node": {
2724
"compilerOptions": {
2825
"module": "CommonJS"
2926
}
3027
}
31-
3228
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { type Config } from 'tailwindcss';
22
import { fontFamily } from 'tailwindcss/defaultTheme';
33

4-
export default ({
4+
export default {
55
content: ['./src/**/*.tsx'],
66
theme: {
77
extend: {
@@ -11,4 +11,4 @@ export default ({
1111
},
1212
},
1313
plugins: [],
14-
} satisfies Config);
14+
} satisfies Config;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"dev-packages/rollup-utils"
9999
],
100100
"devDependencies": {
101-
"@biomejs/biome": "^1.4.0",
101+
"@biomejs/biome": "^1.5.2",
102102
"@rollup/plugin-commonjs": "^25.0.7",
103103
"@rollup/plugin-esm-shim": "^0.1.5",
104104
"@rollup/plugin-json": "^6.1.0",

packages/angular/test/errorhandler.test.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ class CustomError extends Error {
2424
}
2525

2626
class ErrorLikeShapedClass implements Partial<Error> {
27-
constructor(public name: string, public message: string) {}
27+
constructor(
28+
public name: string,
29+
public message: string,
30+
) {}
2831
}
2932

3033
function createErrorEvent(message: string, innerError: any): ErrorEvent {

packages/browser-utils/tsconfig.types.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
// the fact that it introduces a dependency on `@sentry/browser` which doesn't exist anywhere else in the SDK, which
55
// then prevents us from building that and this at the same time when doing a parallellized build from the repo root
66
// level.
7-
"exclude": [
8-
"src/index.bundle.ts",
9-
"src/index.bundle.feedback.ts",
10-
"src/index.bundle.replay.ts"
11-
],
7+
"exclude": ["src/index.bundle.ts", "src/index.bundle.feedback.ts", "src/index.bundle.replay.ts"],
128
"compilerOptions": {
139
"declaration": true,
1410
"declarationMap": true,

packages/browser/src/integrations/browserapierrors.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function _wrapEventTarget(target: string): void {
171171
return;
172172
}
173173

174-
fill(proto, 'addEventListener', function (original: VoidFunction,): (
174+
fill(proto, 'addEventListener', function (original: VoidFunction): (
175175
...args: Parameters<typeof WINDOW.addEventListener>
176176
) => ReturnType<typeof WINDOW.addEventListener> {
177177
return function (this: unknown, eventName, fn, options): VoidFunction {
@@ -217,7 +217,7 @@ function _wrapEventTarget(target: string): void {
217217
};
218218
});
219219

220-
fill(proto, 'removeEventListener', function (originalRemoveEventListener: VoidFunction,): (
220+
fill(proto, 'removeEventListener', function (originalRemoveEventListener: VoidFunction): (
221221
this: unknown,
222222
...args: Parameters<typeof WINDOW.removeEventListener>
223223
) => ReturnType<typeof WINDOW.removeEventListener> {

packages/browser/src/integrations/reportingobserver.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ interface ReportingObserverOptions {
5454

5555
/** This is experimental and the types are not included with TypeScript, sadly. */
5656
interface ReportingObserverClass {
57-
new (handler: (reports: Report[]) => void, options: { buffered?: boolean; types?: ReportTypes[] }): {
57+
new (
58+
handler: (reports: Report[]) => void,
59+
options: { buffered?: boolean; types?: ReportTypes[] },
60+
): {
5861
observe: () => void;
5962
};
6063
}

packages/core/src/utils-hoist/error.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ export class SentryError extends Error {
77

88
public logLevel: ConsoleLevel;
99

10-
public constructor(public message: string, logLevel: ConsoleLevel = 'warn') {
10+
public constructor(
11+
public message: string,
12+
logLevel: ConsoleLevel = 'warn',
13+
) {
1114
super(message);
1215

1316
this.name = new.target.prototype.constructor.name;

packages/core/src/utils-hoist/object.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ export function urlEncode(object: { [key: string]: any }): string {
109109
* @returns An Event or Error turned into an object - or the value argument itself, when value is neither an Event nor
110110
* an Error.
111111
*/
112-
export function convertToPlainObject<V>(
113-
value: V,
114-
):
112+
export function convertToPlainObject<V>(value: V):
115113
| {
116114
[ownProps: string]: unknown;
117115
type: string;

packages/nextjs/src/common/pages-router-instrumentation/wrapPageComponentWithSentry.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ interface FunctionComponent {
55
}
66

77
interface ClassComponent {
8-
new (...args: unknown[]): {
8+
new (
9+
...args: unknown[]
10+
): {
911
props?: unknown;
1012
render(...args: unknown[]): unknown;
1113
};

packages/nextjs/src/config/loaders/valueInjectionLoader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type ValueInjectionLoaderOptions = {
1212
// This regex is shamelessly stolen from: https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/7f984482c73e4284e8b12a08dfedf23b5a82f0af/packages/bundler-plugin-core/src/index.ts#L535-L539
1313
const SKIP_COMMENT_AND_DIRECTIVE_REGEX =
1414
// Note: CodeQL complains that this regex potentially has n^2 runtime. This likely won't affect realistic files.
15-
// biome-ignore lint/nursery/useRegexLiterals: No user input
15+
// biome-ignore lint/complexity/useRegexLiterals: No user input
1616
new RegExp('^(?:\\s*|/\\*(?:.|\\r|\\n)*?\\*/|//.*[\\n\\r])*(?:"[^"]*";?|\'[^\']*\';?)?');
1717

1818
/**

0 commit comments

Comments
 (0)