Skip to content

Add a rule like no-unwrapped-debug-code (name TBD) to disallow shipping test/dev-only code to production #2310

Description

@gitKrystan

It's pretty common in our app to accidentally do:

import { isTesting } from '@embroider/macros'; // or isDevelopingApp

if (isTesting()) { /* do something expensive */ }

which is not stripped in production builds like this would be:

import { isTesting, macroCondition } from '@embroider/macros';  // or isDevelopingApp

if (macroCondition(isTesting())) { /* do something expensive */ }

I propose we allow people to lint against this. An autofix would be even nicer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions