ember-cli / ember-cli/eslint-plugin-ember
Add a rule like `no-unwrapped-debug-code` (name TBD) to disallow shipping test/dev-only code to production
- Dominant language
- JavaScript
- Stars
- 263
- Forks
- 214
- Avg merge
- 30m
- Merged PRs (30d)
- 5
Description
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](https://github.com/embroider-build/embroider/tree/main/packages/macros#istesting-isdevelopingapp) 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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.