Skip to content

Commit a4818d3

Browse files
committed
Revert "Enforce strict ESLint block formatting"
This reverts commit 5ae4c21.
1 parent 5ae4c21 commit a4818d3

39 files changed

Lines changed: 188 additions & 1169 deletions

eslint.config.mjs

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import eslint from "@eslint/js";
2-
import stylistic from "@stylistic/eslint-plugin";
32
import { defineConfig } from "eslint/config";
43
import eslintConfigPrettier from "eslint-config-prettier";
54
import vitest from "@vitest/eslint-plugin";
65
import tseslint from "typescript-eslint";
76

87
export default defineConfig(
9-
{
10-
ignores: ["**/dist/", "**/node_modules/", ".agents/", "example/", "**/expo-plugin/", "**/react-native.config.*"]
11-
},
8+
{ ignores: ["**/dist/", "**/node_modules/", ".agents/", "example/", "**/expo-plugin/", "**/react-native.config.*"] },
129
eslint.configs.recommended,
1310
{
1411
extends: tseslint.configs.recommendedTypeChecked,
@@ -30,18 +27,8 @@ export default defineConfig(
3027
"@typescript-eslint/no-duplicate-type-constituents": "off",
3128
"@typescript-eslint/restrict-plus-operands": "off",
3229
"@typescript-eslint/no-unused-vars": "error",
33-
"@typescript-eslint/no-unused-expressions": [
34-
"error",
35-
{
36-
allowShortCircuit: true
37-
}
38-
],
39-
"@typescript-eslint/no-misused-promises": [
40-
"error",
41-
{
42-
checksVoidReturn: false
43-
}
44-
]
30+
"@typescript-eslint/no-unused-expressions": ["error", { allowShortCircuit: true }],
31+
"@typescript-eslint/no-misused-promises": ["error", { checksVoidReturn: false }]
4532
}
4633
},
4734
{
@@ -56,37 +43,6 @@ export default defineConfig(
5643
}
5744
},
5845
eslintConfigPrettier,
59-
{
60-
plugins: {
61-
"@stylistic": stylistic
62-
},
63-
rules: {
64-
curly: ["error", "all"],
65-
"@stylistic/object-curly-newline": [
66-
"error",
67-
{
68-
ObjectExpression: {
69-
minProperties: 1
70-
}
71-
}
72-
],
73-
"@stylistic/brace-style": [
74-
"error",
75-
"1tbs",
76-
{
77-
allowSingleLine: false
78-
}
79-
],
80-
"padding-line-between-statements": [
81-
"error",
82-
{
83-
blankLine: "always",
84-
prev: "block-like",
85-
next: ["if", "while", "for", "do"]
86-
}
87-
]
88-
}
89-
},
9046
{
9147
files: ["**/test/**/*.ts"],
9248
plugins: vitest.configs.recommended.plugins,

package-lock.json

Lines changed: 0 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
],
3131
"devDependencies": {
3232
"@eslint/js": "^10.0.1",
33-
"@stylistic/eslint-plugin": "^5.10.0",
3433
"@vitest/eslint-plugin": "^1.6.26",
3534
"eslint": "^10.8.0",
3635
"eslint-config-prettier": "^10.1.8",

packages/angularjs/src/index.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ angular
1010
"$ExceptionlessClient",
1111
($location: ng.ILocationService, $q: ng.IQService, $ExceptionlessClient: BrowserExceptionlessClient) => {
1212
return {
13-
responseError: function responseError(
14-
response: ng.IHttpResponse<{
15-
Message?: string;
16-
}>
17-
) {
13+
responseError: function responseError(response: ng.IHttpResponse<{ Message?: string }>) {
1814
if (response.status === 404) {
1915
void $ExceptionlessClient.submitNotFound(response.config.url);
2016
} else if (response.status !== 401) {
@@ -52,13 +48,7 @@ angular
5248
function decorateRegularCall(property: string, logLevel: string) {
5349
const previousFn = $delegate[property];
5450
return ($delegate[property] = (...args: string[]) => {
55-
if (
56-
(
57-
angular as {
58-
mock?: unknown;
59-
}
60-
).mock
61-
) {
51+
if ((angular as { mock?: unknown }).mock) {
6252
$delegate[property].logs = [];
6353
}
6454

packages/browser/src/plugins/BrowserErrorPlugin.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ export class BrowserErrorPlugin implements IEventPlugin {
5959

6060
const items: ParameterInfo[] = [];
6161
for (const param of params) {
62-
items.push({
63-
name: param
64-
});
62+
items.push({ name: param });
6563
}
6664

6765
return items;

packages/browser/src/plugins/BrowserGlobalHandlerPlugin.ts

Lines changed: 16 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,7 @@ import { ExceptionlessClient, IEventPlugin, PluginContext, toError } from "@exce
22

33
declare let $: (document: Document) => {
44
ajaxError: {
5-
(
6-
document: (
7-
event: Event,
8-
xhr: {
9-
responseText: string;
10-
status: number;
11-
},
12-
settings: {
13-
data: unknown;
14-
url: string;
15-
},
16-
error: string
17-
) => void
18-
): void;
5+
(document: (event: Event, xhr: { responseText: string; status: number }, settings: { data: unknown; url: string }, error: string) => void): void;
196
};
207
};
218

@@ -42,13 +29,7 @@ export class BrowserGlobalHandlerPlugin implements IEventPlugin {
4229
if (!(reason instanceof Error)) {
4330
try {
4431
// Check for reason in legacy CustomEvents (https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent)
45-
const detailReason = (<
46-
{
47-
detail?: {
48-
reason: string;
49-
};
50-
}
51-
>event).detail?.reason;
32+
const detailReason = (<{ detail?: { reason: string } }>event).detail?.reason;
5233
if (detailReason) {
5334
reason = detailReason;
5435
}
@@ -73,34 +54,21 @@ export class BrowserGlobalHandlerPlugin implements IEventPlugin {
7354
});
7455

7556
if (typeof $ !== "undefined" && $(document)) {
76-
$(document).ajaxError(
77-
(
78-
_: Event,
79-
xhr: {
80-
responseText: string;
81-
status: number;
82-
},
83-
settings: {
84-
data: unknown;
85-
url: string;
86-
},
87-
error: string
88-
) => {
89-
if (xhr.status === 404) {
90-
// TODO: Handle async
91-
void this._client?.submitNotFound(settings.url);
92-
} else if (xhr.status !== 401) {
93-
// TODO: Handle async
94-
void this._client
95-
?.createUnhandledException(toError(error), "JQuery.ajaxError")
96-
.setSource(settings.url)
97-
.setProperty("status", xhr.status)
98-
.setProperty("request", settings.data)
99-
.setProperty("response", xhr.responseText?.slice(0, 1024))
100-
.submit();
101-
}
57+
$(document).ajaxError((_: Event, xhr: { responseText: string; status: number }, settings: { data: unknown; url: string }, error: string) => {
58+
if (xhr.status === 404) {
59+
// TODO: Handle async
60+
void this._client?.submitNotFound(settings.url);
61+
} else if (xhr.status !== 401) {
62+
// TODO: Handle async
63+
void this._client
64+
?.createUnhandledException(toError(error), "JQuery.ajaxError")
65+
.setSource(settings.url)
66+
.setProperty("status", xhr.status)
67+
.setProperty("request", settings.data)
68+
.setProperty("response", xhr.responseText?.slice(0, 1024))
69+
.submit();
10270
}
103-
);
71+
});
10472
}
10573

10674
return Promise.resolve();
@@ -122,7 +90,6 @@ export class BrowserGlobalHandlerPlugin implements IEventPlugin {
12290
if (errorName) {
12391
name = errorName;
12492
}
125-
12693
if (errorMessage) {
12794
msg = errorMessage;
12895
}

packages/browser/test/plugins/BrowserErrorPlugin.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ describe("BrowserErrorPlugin", () => {
5656
const error = {
5757
someProperty: "Test"
5858
};
59-
await processError(
60-
new Error("Error With Cause", {
61-
cause: error
62-
})
63-
);
59+
await processError(new Error("Error With Cause", { cause: error }));
6460
const additionalData = getAdditionalData(context.event);
6561
expect(additionalData).not.toBeNull();
6662
expect(additionalData?.cause).toStrictEqual(error);

packages/browser/test/plugins/BrowserIgnoreExtensionErrorsPlugin.test.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@ describe("BrowserIgnoreExtensionErrorsPlugin", () => {
2222
const eventContext = new EventContext();
2323
eventContext.setException(error);
2424

25-
const context = new EventPluginContext(
26-
client,
27-
{
28-
type: "error"
29-
},
30-
eventContext
31-
);
25+
const context = new EventPluginContext(client, { type: "error" }, eventContext);
3226

3327
await plugin.run(context);
3428
return context;

packages/core/src/EventBuilder.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,7 @@ export class EventBuilder {
8787
public setUserIdentity(identity: string): EventBuilder;
8888
public setUserIdentity(identity: string, name: string): EventBuilder;
8989
public setUserIdentity(userInfoOrIdentity: UserInfo | string, name?: string): EventBuilder {
90-
const userInfo =
91-
typeof userInfoOrIdentity !== "string"
92-
? userInfoOrIdentity
93-
: {
94-
identity: userInfoOrIdentity,
95-
name
96-
};
90+
const userInfo = typeof userInfoOrIdentity !== "string" ? userInfoOrIdentity : { identity: userInfoOrIdentity, name };
9791
if (!userInfo || (!userInfo.identity && !userInfo.name)) {
9892
return this;
9993
}
@@ -127,9 +121,7 @@ export class EventBuilder {
127121
*/
128122
public setManualStackingInfo(signatureData: Record<string, string>, title?: string): EventBuilder {
129123
if (signatureData) {
130-
const stack: ManualStackingInfo = {
131-
signature_data: signatureData
132-
};
124+
const stack: ManualStackingInfo = { signature_data: signatureData };
133125
if (title) {
134126
stack.title = title;
135127
}
@@ -147,9 +139,7 @@ export class EventBuilder {
147139
*/
148140
public setManualStackingKey(manualStackingKey: string, title?: string): EventBuilder {
149141
if (manualStackingKey) {
150-
const data = {
151-
ManualStackingKey: manualStackingKey
152-
};
142+
const data = { ManualStackingKey: manualStackingKey };
153143
this.setManualStackingInfo(data, title);
154144
}
155145

packages/core/src/ExceptionlessClient.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,7 @@ export class ExceptionlessClient {
195195
}
196196

197197
public createEvent(context?: EventContext): EventBuilder {
198-
return new EventBuilder(
199-
{
200-
date: new Date()
201-
},
202-
this,
203-
context
204-
);
198+
return new EventBuilder({ date: new Date() }, this, context);
205199
}
206200

207201
/**
@@ -270,10 +264,7 @@ export class ExceptionlessClient {
270264
return;
271265
}
272266

273-
const userDescription: UserDescription = {
274-
email_address: email,
275-
description
276-
};
267+
const userDescription: UserDescription = { email_address: email, description };
277268
const response = await this.config.services.submissionClient.submitUserDescription(referenceId, userDescription);
278269
if (!response.success) {
279270
this.config.services.log.error(`Failed to submit user email and description for event "${referenceId}": ${response.status} ${response.message}`);

0 commit comments

Comments
 (0)