Skip to content

Commit d939cc4

Browse files
committed
Fix exports [publish]
1 parent 7d1709b commit d939cc4

File tree

3 files changed

+23
-20
lines changed

3 files changed

+23
-20
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.4.16
4+
5+
Fix CJS/ESM interop issue. Sorry everyone for the trouble.
6+
37
## 0.4.15
48

59
### Add support for custom HOCs (#60)

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-react-refresh",
3-
"version": "0.4.15",
3+
"version": "0.4.16",
44
"type": "module",
55
"license": "MIT",
66
"scripts": {

src/index.ts

+18-19
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
import { onlyExportComponents } from "./only-export-components.ts";
22

3-
const plugin = {
4-
rules: {
5-
"only-export-components": onlyExportComponents,
6-
},
3+
export const rules = {
4+
"only-export-components": onlyExportComponents,
75
};
6+
const plugin = { rules };
87

9-
export default {
10-
rules: plugin.rules,
11-
configs: {
12-
recommended: {
13-
plugins: { "react-refresh": plugin },
14-
rules: { "react-refresh/only-export-components": "error" },
15-
},
16-
vite: {
17-
plugins: { "react-refresh": plugin },
18-
rules: {
19-
"react-refresh/only-export-components": [
20-
"error",
21-
{ allowConstantExport: true },
22-
],
23-
},
8+
export const configs = {
9+
recommended: {
10+
plugins: { "react-refresh": plugin },
11+
rules: { "react-refresh/only-export-components": "error" },
12+
},
13+
vite: {
14+
plugins: { "react-refresh": plugin },
15+
rules: {
16+
"react-refresh/only-export-components": [
17+
"error",
18+
{ allowConstantExport: true },
19+
],
2420
},
2521
},
2622
};
23+
24+
// Probably not needed, but keep for backwards compatibility
25+
export default { rules, configs };

0 commit comments

Comments
 (0)