Skip to content

Commit

Permalink
Allow TaggedTemplateExpression for styled components (fixes #32)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre committed Dec 2, 2023
1 parent 14e01d9 commit f55d0d2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 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.5

- Allow `TaggedTemplateExpression` for styled components (fixes #32)

## 0.4.4

- Add `allowExportNames` option (fixes #29)
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.4",
"version": "0.4.5",
"license": "MIT",
"scripts": {
"build": "scripts/bundle.ts",
Expand Down
4 changes: 4 additions & 0 deletions src/only-export-components.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ const valid = [
name: "Two components & local function",
code: "const foo = () => {}; export const Bar = () => {}; export const Baz = () => {};",
},
{
name: "styled components",
code: "export const Foo = () => {}; export const Bar = styled.div`padding-bottom: 6px;`;",
},
{
name: "Direct export variable",
code: "export const foo = 3;",
Expand Down
1 change: 0 additions & 1 deletion src/only-export-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ const notReactComponentExpression: ToString<TSESTree.Expression["type"]>[] = [
"Literal",
"LogicalExpression",
"ObjectExpression",
"TaggedTemplateExpression",
"TemplateLiteral",
"ThisExpression",
"UnaryExpression",
Expand Down

0 comments on commit f55d0d2

Please sign in to comment.