Commit 8c16592
authored
fix(eslint-plugin-reactotron): Fix ESLint Plugin CommonJS Export Compatibility (#1578)
## Please verify the following:
- [x] `yarn build-and-test:local` passes
- [ ] I have added tests for any new features, if relevant
- [ ] `README.md` (or relevant documentation) has been updated with your
changes
## Describe your PR
Fixes:
[infinitered/ignite#2997](infinitered/ignite#2997)
### Problem
The eslint-plugin-reactotron v0.1.8 fails with "Definition for rule
'reactotron/no-tron-in-production' was not found". This affects all new
Ignite CLI projects and any project using the ESLint plugin.
### Root Cause
Migration from Rollup to react-native-builder-bob changed the CommonJS
export format. Builder Bob outputs exports.default = plugin (standard
Babel behavior), but ESLint expects the plugin to be available directly
as the module export, not nested under .default.
### Solution
Modified the source code export structure to improve CommonJS
compatibility:
```ts
// Before
const eslintPluginReactotron: Linter.Plugin = {
rules: {
"no-tron-in-production": noTronInProduction,
},
} satisfies Linter.Plugin
export default eslintPluginReactotron
// After
export const rules: Record<string, any> = {
"no-tron-in-production": noTronInProduction,
}
const plugin: Linter.Plugin = { rules }
export default plugin
```1 parent a94e313 commit 8c16592
1 file changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
24 | 22 | | |
25 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments