Skip to content

build: update biome to v1.5.2 #10102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
"useIgnoreFile": true,
"defaultBranch": "develop"
},
"organizeImports": {
"enabled": true
Expand All @@ -17,13 +18,15 @@
"noUnusedVariables": "error",
"noPrecisionLoss": "error"
},
"complexity": {
"useRegexLiterals": "error"
},
"suspicious": {
"all": false,
"noControlCharactersInRegex": "error"
},
"nursery": {
"noUnusedImports": "error",
"useRegexLiterals": "error"
"noUnusedImports": "error"
},
"performance": {
"all": true,
Expand Down Expand Up @@ -92,6 +95,10 @@
"json": {
"formatter": {
"enabled": true
},
"parser": {
"allowComments": true,
"allowTrailingCommas": true
}
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
const blockUI = (delay = 70) => e => {
const startTime = Date.now();
const blockUI =
(delay = 70) =>
e => {
const startTime = Date.now();

function getElasped() {
const time = Date.now();
return time - startTime;
}
function getElasped() {
const time = Date.now();
return time - startTime;
}

while (getElasped() < delay) {
//
}
while (getElasped() < delay) {
//
}

e.target.classList.add('clicked');
};
e.target.classList.add('clicked');
};

document.querySelector('[data-test-id=not-so-slow-button]').addEventListener('click', blockUI(300));
document.querySelector('[data-test-id=slow-button]').addEventListener('click', blockUI(450));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
const blockUI = (delay = 70) => e => {
const startTime = Date.now();
const blockUI =
(delay = 70) =>
e => {
const startTime = Date.now();

function getElasped() {
const time = Date.now();
return time - startTime;
}
function getElasped() {
const time = Date.now();
return time - startTime;
}

while (getElasped() < delay) {
//
}
while (getElasped() < delay) {
//
}

e.target.classList.add('clicked');
};
e.target.classList.add('clicked');
};

document.querySelector('[data-test-id=not-so-slow-button]').addEventListener('click', blockUI(300));
document.querySelector('[data-test-id=slow-button]').addEventListener('click', blockUI(450));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
const blockUI = (delay = 70) => e => {
const startTime = Date.now();
const blockUI =
(delay = 70) =>
e => {
const startTime = Date.now();

function getElasped() {
const time = Date.now();
return time - startTime;
}
function getElasped() {
const time = Date.now();
return time - startTime;
}

while (getElasped() < delay) {
//
}
while (getElasped() < delay) {
//
}

e.target.classList.add('clicked');
};
e.target.classList.add('clicked');
};

document.querySelector('[data-test-id=not-so-slow-button]').addEventListener('click', blockUI(300));
document.querySelector('[data-test-id=slow-button]').addEventListener('click', blockUI(450));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
const blockUI = (delay = 70) => e => {
const startTime = Date.now();
const blockUI =
(delay = 70) =>
e => {
const startTime = Date.now();

function getElasped() {
const time = Date.now();
return time - startTime;
}
function getElasped() {
const time = Date.now();
return time - startTime;
}

while (getElasped() < delay) {
//
}
while (getElasped() < delay) {
//
}

e.target.classList.add('clicked');
};
e.target.classList.add('clicked');
};

document.querySelector('[data-test-id=not-so-slow-button]').addEventListener('click', blockUI(300));
document.querySelector('[data-test-id=slow-button]').addEventListener('click', blockUI(450));
Expand Down
11 changes: 4 additions & 7 deletions dev-packages/browser-integration-tests/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,10 @@ export const countEnvelopes = async (

page.on('request', requestHandler);

setTimeout(
() => {
page.off('request', requestHandler);
resolve(reqCount);
},
options?.timeout || 1000,
);
setTimeout(() => {
page.off('request', requestHandler);
resolve(reqCount);
}, options?.timeout || 1000);
});

if (options?.url) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts"
],
"include": [
"src/**/*.d.ts"
]
"files": ["src/main.ts"],
"include": ["src/**/*.d.ts"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts"
],
"include": [
"src/**/*.d.ts"
]
"files": ["src/main.ts"],
"include": ["src/**/*.d.ts"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts"
],
"include": [
"src/**/*.d.ts"
]
"files": ["src/main.ts"],
"include": ["src/**/*.d.ts"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [
"jasmine"
]
"types": ["jasmine"]
},
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
"include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@
],
}
},
"include": [
"app/**/*",
"types/**/*"
],
"include": ["app/**/*", "types/**/*"],
"exclude": ["tests/**/*"],
"ts-node": {
"compilerOptions": {
"module": "CommonJS"
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@
],
}
},
"include": [
"app/**/*",
"types/**/*"
],
"include": ["app/**/*", "types/**/*"],
"exclude": ["tests/**/*"],
"ts-node": {
"compilerOptions": {
"module": "CommonJS"
}
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type Config } from 'tailwindcss';
import { fontFamily } from 'tailwindcss/defaultTheme';

export default ({
export default {
content: ['./src/**/*.tsx'],
theme: {
extend: {
Expand All @@ -11,4 +11,4 @@ export default ({
},
},
plugins: [],
} satisfies Config);
} satisfies Config;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"dev-packages/rollup-utils"
],
"devDependencies": {
"@biomejs/biome": "^1.4.0",
"@biomejs/biome": "^1.5.2",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-esm-shim": "^0.1.5",
"@rollup/plugin-json": "^6.1.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/angular/test/errorhandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ class CustomError extends Error {
}

class ErrorLikeShapedClass implements Partial<Error> {
constructor(public name: string, public message: string) {}
constructor(
public name: string,
public message: string,
) {}
}

function createErrorEvent(message: string, innerError: any): ErrorEvent {
Expand Down
6 changes: 1 addition & 5 deletions packages/browser-utils/tsconfig.types.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
// the fact that it introduces a dependency on `@sentry/browser` which doesn't exist anywhere else in the SDK, which
// then prevents us from building that and this at the same time when doing a parallellized build from the repo root
// level.
"exclude": [
"src/index.bundle.ts",
"src/index.bundle.feedback.ts",
"src/index.bundle.replay.ts"
],
"exclude": ["src/index.bundle.ts", "src/index.bundle.feedback.ts", "src/index.bundle.replay.ts"],
"compilerOptions": {
"declaration": true,
"declarationMap": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/browser/src/integrations/browserapierrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function _wrapEventTarget(target: string): void {
return;
}

fill(proto, 'addEventListener', function (original: VoidFunction,): (
fill(proto, 'addEventListener', function (original: VoidFunction): (
...args: Parameters<typeof WINDOW.addEventListener>
) => ReturnType<typeof WINDOW.addEventListener> {
return function (this: unknown, eventName, fn, options): VoidFunction {
Expand Down Expand Up @@ -217,7 +217,7 @@ function _wrapEventTarget(target: string): void {
};
});

fill(proto, 'removeEventListener', function (originalRemoveEventListener: VoidFunction,): (
fill(proto, 'removeEventListener', function (originalRemoveEventListener: VoidFunction): (
this: unknown,
...args: Parameters<typeof WINDOW.removeEventListener>
) => ReturnType<typeof WINDOW.removeEventListener> {
Expand Down
5 changes: 4 additions & 1 deletion packages/browser/src/integrations/reportingobserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ interface ReportingObserverOptions {

/** This is experimental and the types are not included with TypeScript, sadly. */
interface ReportingObserverClass {
new (handler: (reports: Report[]) => void, options: { buffered?: boolean; types?: ReportTypes[] }): {
new (
handler: (reports: Report[]) => void,
options: { buffered?: boolean; types?: ReportTypes[] },
): {
observe: () => void;
};
}
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/utils-hoist/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ export class SentryError extends Error {

public logLevel: ConsoleLevel;

public constructor(public message: string, logLevel: ConsoleLevel = 'warn') {
public constructor(
public message: string,
logLevel: ConsoleLevel = 'warn',
) {
super(message);

this.name = new.target.prototype.constructor.name;
Expand Down
4 changes: 1 addition & 3 deletions packages/core/src/utils-hoist/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ export function urlEncode(object: { [key: string]: any }): string {
* @returns An Event or Error turned into an object - or the value argument itself, when value is neither an Event nor
* an Error.
*/
export function convertToPlainObject<V>(
value: V,
):
export function convertToPlainObject<V>(value: V):
| {
[ownProps: string]: unknown;
type: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ interface FunctionComponent {
}

interface ClassComponent {
new (...args: unknown[]): {
new (
...args: unknown[]
): {
props?: unknown;
render(...args: unknown[]): unknown;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/src/config/loaders/valueInjectionLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type ValueInjectionLoaderOptions = {
// 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
const SKIP_COMMENT_AND_DIRECTIVE_REGEX =
// Note: CodeQL complains that this regex potentially has n^2 runtime. This likely won't affect realistic files.
// biome-ignore lint/nursery/useRegexLiterals: No user input
// biome-ignore lint/complexity/useRegexLiterals: No user input
new RegExp('^(?:\\s*|/\\*(?:.|\\r|\\n)*?\\*/|//.*[\\n\\r])*(?:"[^"]*";?|\'[^\']*\';?)?');

/**
Expand Down
Loading
Loading