Skip to content

Commit ad5e7c3

Browse files
authored
ref: Remove @typescript-eslint/no-empty-function eslint rule (#17057)
This is IMHO not super helpful, we constantly disable it or add a noop comment for no gain.
1 parent 64738db commit ad5e7c3

File tree

7 files changed

+5
-15
lines changed

7 files changed

+5
-15
lines changed

packages/cloudflare/src/opentelemetry/tracer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ class SentryCloudflareTracer implements Tracer {
7171
? context
7272
: typeof fn === 'function'
7373
? fn
74-
: // eslint-disable-next-line @typescript-eslint/no-empty-function
75-
() => {}
74+
: () => {}
7675
) as F;
7776

7877
// In OTEL the semantic matches `startSpanManual` because spans are not auto-ended

packages/core/src/tracing/sentryNonRecordingSpan.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export class SentryNonRecordingSpan implements Span {
3232
}
3333

3434
/** @inheritdoc */
35-
// eslint-disable-next-line @typescript-eslint/no-empty-function
3635
public end(_timestamp?: SpanTimeInput): void {}
3736

3837
/** @inheritdoc */

packages/core/src/utils/handleCallbackErrors.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@ import { isThenable } from '../utils/is';
1414
export function handleCallbackErrors<
1515
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1616
Fn extends () => any,
17-
>(
18-
fn: Fn,
19-
onError: (error: unknown) => void,
20-
// eslint-disable-next-line @typescript-eslint/no-empty-function
21-
onFinally: () => void = () => {},
22-
): ReturnType<Fn> {
17+
>(fn: Fn, onError: (error: unknown) => void, onFinally: () => void = () => {}): ReturnType<Fn> {
2318
let maybePromiseResult: ReturnType<Fn>;
2419
try {
2520
maybePromiseResult = fn();

packages/eslint-config-sdk/src/base.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ module.exports = {
107107
// Be explicit about class member accessibility (public, private, protected). Turned off
108108
// on tests for ease of use.
109109
'@typescript-eslint/explicit-member-accessibility': ['error'],
110+
111+
// We do not care about empty functions
112+
'@typescript-eslint/no-empty-function': 'off',
110113
},
111114
},
112115
{
@@ -178,7 +181,6 @@ module.exports = {
178181
'@typescript-eslint/explicit-member-accessibility': 'off',
179182
'@typescript-eslint/no-explicit-any': 'off',
180183
'@typescript-eslint/no-non-null-assertion': 'off',
181-
'@typescript-eslint/no-empty-function': 'off',
182184
'@typescript-eslint/no-floating-promises': 'off',
183185
'@sentry-internal/sdk/no-focused-tests': 'error',
184186
'@sentry-internal/sdk/no-skipped-tests': 'error',

packages/feedback/src/modal/integration.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ function getUser(): User | undefined {
2222
export const feedbackModalIntegration = ((): FeedbackModalIntegration => {
2323
return {
2424
name: 'FeedbackModal',
25-
// eslint-disable-next-line @typescript-eslint/no-empty-function
2625
setupOnce() {},
2726
createDialog: ({ options, screenshotIntegration, sendFeedback, shadow }) => {
2827
const shadowRoot = shadow as unknown as ShadowRoot;

packages/feedback/src/screenshot/integration.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { ScreenshotEditorFactory } from './components/ScreenshotEditor';
77
export const feedbackScreenshotIntegration = ((): FeedbackScreenshotIntegration => {
88
return {
99
name: 'FeedbackScreenshot',
10-
// eslint-disable-next-line @typescript-eslint/no-empty-function
1110
setupOnce() {},
1211
createInput: ({ h, hooks, dialog, options }) => {
1312
const outputBuffer = DOCUMENT.createElement('canvas');

packages/sveltekit/src/vite/svelteConfig.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,10 @@ async function getNodeAdapterOutputDir(svelteConfig: Config): Promise<string> {
8686
},
8787
// @ts-expect-error - No need to implement the other methods
8888
log: {
89-
// eslint-disable-next-line @typescript-eslint/no-empty-function -- this should be a noop
9089
minor() {},
9190
},
9291
getBuildDirectory: () => '',
93-
// eslint-disable-next-line @typescript-eslint/no-empty-function -- this should be a noop
9492
rimraf: () => {},
95-
// eslint-disable-next-line @typescript-eslint/no-empty-function -- this should be a noop
9693
mkdirp: () => {},
9794

9895
config: {

0 commit comments

Comments
 (0)