Skip to content

Commit 0f9a3ca

Browse files
committed
feat: enable biome recommended linter rules
1 parent 56845fb commit 0f9a3ca

File tree

337 files changed

+1615
-1694
lines changed

Some content is hidden

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

337 files changed

+1615
-1694
lines changed

.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ module.exports = {
2828
rules: {
2929
// Disabled because it's included with Biome's linter
3030
'no-control-regex': 'off',
31+
'no-param-reassign': 'off',
32+
'prefer-const': 'off',
33+
'@typescript-eslint/ban-types': 'off',
34+
'react-hooks/exhaustive-deps': 'off',
3135
},
3236
},
3337
{

.size-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = [
2020
import: '{ init, Replay, BrowserTracing }',
2121
gzip: true,
2222
limit: '75 KB',
23-
modifyWebpackConfig: function (config) {
23+
modifyWebpackConfig: config => {
2424
const webpack = require('webpack');
2525
config.plugins.push(
2626
new webpack.DefinePlugin({

biome.json

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,60 @@
1111
"linter": {
1212
"enabled": true,
1313
"rules": {
14-
"recommended": false,
14+
"recommended": true,
15+
"a11y": {
16+
"all": false
17+
},
18+
"complexity": {
19+
"noForEach": "off",
20+
"noUselessConstructor": "off",
21+
"noStaticOnlyClass": "off",
22+
"useOptionalChain": "off",
23+
"useLiteralKeys": "off"
24+
},
1525
"correctness": {
16-
"all": false,
17-
"noUnusedVariables": "error",
18-
"noPrecisionLoss": "error"
26+
"noEmptyPattern": "off",
27+
"noInnerDeclarations": "off",
28+
"noVoidTypeReturn": "off",
29+
"noEmptyCharacterClassInRegex": "off"
30+
},
31+
"performance": {
32+
"noDelete": "off"
33+
},
34+
"security": {
35+
"all": true
36+
},
37+
"style": {
38+
"noArguments": "off",
39+
"noCommaOperator": "off",
40+
"noNonNullAssertion": "off",
41+
"noUselessElse": "off",
42+
"useTemplate": "off",
43+
"noVar": "off",
44+
"useSingleVarDeclarator": "off",
45+
"useDefaultParameterLast": "off",
46+
"useExponentiationOperator": "off"
1947
},
2048
"suspicious": {
21-
"all": false,
22-
"noControlCharactersInRegex": "error"
49+
"noDebugger": "off",
50+
"noDoubleEquals": "off",
51+
"noExplicitAny": "off",
52+
"noRedeclare": "off",
53+
"noAssignInExpressions": "off",
54+
"noConfusingVoidType": "off",
55+
"noPrototypeBuiltins": "off",
56+
"noShadowRestrictedNames": "off",
57+
"noControlCharactersInRegex": "off"
2358
}
2459
},
25-
"ignore": [".vscode/*", "**/*.json"]
60+
"ignore": [
61+
".vscode/*",
62+
"**/*.json",
63+
"**/*.min.js",
64+
"packages/browser-integration-tests/fixtures/loader.js",
65+
"packages/browser/test/integration/polyfills/*.js",
66+
"packages/replay-worker/examples/worker.js"
67+
]
2668
},
2769
"files": {
2870
"ignoreUnknown": true
@@ -44,6 +86,7 @@
4486
]
4587
},
4688
"javascript": {
89+
"globals": ["expect", "describe", "test", "it", "beforeEach", "afterEach", "beforeAll", "afterAll"],
4790
"formatter": {
4891
"enabled": true,
4992
"quoteStyle": "single",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"codecov": "codecov",
2121
"fix": "run-s fix:lerna fix:biome",
2222
"fix:lerna": "lerna run fix",
23-
"fix:biome": "biome check --apply-unsafe .",
23+
"fix:biome": "biome check --apply .",
2424
"changelog": "ts-node ./scripts/get-commit-list.ts",
2525
"link:yarn": "lerna exec yarn link",
2626
"lint": "run-s lint:lerna lint:biome",

packages/angular/src/tracing.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ let stashedStartTransactionOnLocationChange: boolean;
2727
*/
2828
export function routingInstrumentation(
2929
customStartTransaction: (context: TransactionContext) => Transaction | undefined,
30-
startTransactionOnPageLoad: boolean = true,
31-
startTransactionOnLocationChange: boolean = true,
30+
startTransactionOnPageLoad = true,
31+
startTransactionOnLocationChange = true,
3232
): void {
3333
instrumentationInitialized = true;
3434
stashedStartTransaction = customStartTransaction;
@@ -260,7 +260,8 @@ export function TraceClassDecorator(): ClassDecorator {
260260
* Decorator function that can be used to capture a single lifecycle methods of the component.
261261
*/
262262
export function TraceMethodDecorator(): MethodDecorator {
263-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/ban-types
263+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
264+
// biome-ignore lint/complexity/noBannedTypes: Disable
264265
return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {
265266
const originalMethod = descriptor.value;
266267
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -300,7 +301,7 @@ export function getParameterizedRouteFromSnapshot(route?: ActivatedRouteSnapshot
300301
let currentRoute = route && route.firstChild;
301302
while (currentRoute) {
302303
const path = currentRoute && currentRoute.routeConfig && currentRoute.routeConfig.path;
303-
if (path === null || path === undefined) {
304+
if (path == null) {
304305
break;
305306
}
306307

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
new Promise(function (resolve, reject) {
1+
new Promise((resolve, reject) => {
22
reject('this is unhandled');
33
});

packages/browser-integration-tests/loader-suites/loader/onLoad/captureExceptionInOnLoad/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Sentry.onLoad(function () {
1+
Sentry.onLoad(() => {
22
// You _have_ to call Sentry.init() before calling Sentry.captureException() in Sentry.onLoad()!
33
Sentry.init();
44
Sentry.captureException('Test exception');

packages/browser-integration-tests/loader-suites/loader/onLoad/customBrowserTracing/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
window._testBaseTimestamp = performance.timeOrigin / 1000;
22

3-
Sentry.onLoad(function () {
3+
Sentry.onLoad(() => {
44
Sentry.init({
55
integrations: [
66
// Without this syntax, this will be re-written by the test framework

packages/browser-integration-tests/loader-suites/loader/onLoad/customInit/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
window.__sentryOnLoad = 0;
22

33
setTimeout(() => {
4-
Sentry.onLoad(function () {
4+
Sentry.onLoad(() => {
55
window.__hadSentry = window.sentryIsLoaded();
66

77
Sentry.init({

packages/browser-integration-tests/loader-suites/loader/onLoad/customIntegrations/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class CustomIntegration {
66
setupOnce() {}
77
}
88

9-
Sentry.onLoad(function () {
9+
Sentry.onLoad(() => {
1010
Sentry.init({
1111
integrations: [new CustomIntegration()],
1212
});

0 commit comments

Comments
 (0)