Skip to content

Commit

Permalink
Fix exports [publish]
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre committed Dec 2, 2024
1 parent 7d1709b commit d939cc4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.4.16

Fix CJS/ESM interop issue. Sorry everyone for the trouble.

## 0.4.15

### Add support for custom HOCs (#60)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-react-refresh",
"version": "0.4.15",
"version": "0.4.16",
"type": "module",
"license": "MIT",
"scripts": {
Expand Down
37 changes: 18 additions & 19 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
import { onlyExportComponents } from "./only-export-components.ts";

const plugin = {
rules: {
"only-export-components": onlyExportComponents,
},
export const rules = {
"only-export-components": onlyExportComponents,
};
const plugin = { rules };

export default {
rules: plugin.rules,
configs: {
recommended: {
plugins: { "react-refresh": plugin },
rules: { "react-refresh/only-export-components": "error" },
},
vite: {
plugins: { "react-refresh": plugin },
rules: {
"react-refresh/only-export-components": [
"error",
{ allowConstantExport: true },
],
},
export const configs = {
recommended: {
plugins: { "react-refresh": plugin },
rules: { "react-refresh/only-export-components": "error" },
},
vite: {
plugins: { "react-refresh": plugin },
rules: {
"react-refresh/only-export-components": [
"error",
{ allowConstantExport: true },
],
},
},
};

// Probably not needed, but keep for backwards compatibility
export default { rules, configs };

0 comments on commit d939cc4

Please sign in to comment.