Skip to content

ref: Remove @typescript-eslint/no-empty-function eslint rule #17057

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
Jul 17, 2025
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
3 changes: 1 addition & 2 deletions packages/cloudflare/src/opentelemetry/tracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ class SentryCloudflareTracer implements Tracer {
? context
: typeof fn === 'function'
? fn
: // eslint-disable-next-line @typescript-eslint/no-empty-function
() => {}
: () => {}
) as F;

// In OTEL the semantic matches `startSpanManual` because spans are not auto-ended
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/tracing/sentryNonRecordingSpan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export class SentryNonRecordingSpan implements Span {
}

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

/** @inheritdoc */
Expand Down
7 changes: 1 addition & 6 deletions packages/core/src/utils/handleCallbackErrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ import { isThenable } from '../utils/is';
export function handleCallbackErrors<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Fn extends () => any,
>(
fn: Fn,
onError: (error: unknown) => void,
// eslint-disable-next-line @typescript-eslint/no-empty-function
onFinally: () => void = () => {},
): ReturnType<Fn> {
>(fn: Fn, onError: (error: unknown) => void, onFinally: () => void = () => {}): ReturnType<Fn> {
let maybePromiseResult: ReturnType<Fn>;
try {
maybePromiseResult = fn();
Expand Down
4 changes: 3 additions & 1 deletion packages/eslint-config-sdk/src/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ module.exports = {
// Be explicit about class member accessibility (public, private, protected). Turned off
// on tests for ease of use.
'@typescript-eslint/explicit-member-accessibility': ['error'],

// We do not care about empty functions
'@typescript-eslint/no-empty-function': 'off',
},
},
{
Expand Down Expand Up @@ -178,7 +181,6 @@ module.exports = {
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@sentry-internal/sdk/no-focused-tests': 'error',
'@sentry-internal/sdk/no-skipped-tests': 'error',
Expand Down
1 change: 0 additions & 1 deletion packages/feedback/src/modal/integration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ function getUser(): User | undefined {
export const feedbackModalIntegration = ((): FeedbackModalIntegration => {
return {
name: 'FeedbackModal',
// eslint-disable-next-line @typescript-eslint/no-empty-function
setupOnce() {},
createDialog: ({ options, screenshotIntegration, sendFeedback, shadow }) => {
const shadowRoot = shadow as unknown as ShadowRoot;
Expand Down
1 change: 0 additions & 1 deletion packages/feedback/src/screenshot/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { ScreenshotEditorFactory } from './components/ScreenshotEditor';
export const feedbackScreenshotIntegration = ((): FeedbackScreenshotIntegration => {
return {
name: 'FeedbackScreenshot',
// eslint-disable-next-line @typescript-eslint/no-empty-function
setupOnce() {},
createInput: ({ h, hooks, dialog, options }) => {
const outputBuffer = DOCUMENT.createElement('canvas');
Expand Down
3 changes: 0 additions & 3 deletions packages/sveltekit/src/vite/svelteConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,10 @@ async function getNodeAdapterOutputDir(svelteConfig: Config): Promise<string> {
},
// @ts-expect-error - No need to implement the other methods
log: {
// eslint-disable-next-line @typescript-eslint/no-empty-function -- this should be a noop
minor() {},
},
getBuildDirectory: () => '',
// eslint-disable-next-line @typescript-eslint/no-empty-function -- this should be a noop
rimraf: () => {},
// eslint-disable-next-line @typescript-eslint/no-empty-function -- this should be a noop
mkdirp: () => {},

config: {
Expand Down
Loading