Skip to content

Commit f55d0d2

Browse files
committed
Allow TaggedTemplateExpression for styled components (fixes #32)
1 parent 14e01d9 commit f55d0d2

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

CHANGELOG.md

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

3+
## 0.4.5
4+
5+
- Allow `TaggedTemplateExpression` for styled components (fixes #32)
6+
37
## 0.4.4
48

59
- Add `allowExportNames` option (fixes #29)

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.4",
3+
"version": "0.4.5",
44
"license": "MIT",
55
"scripts": {
66
"build": "scripts/bundle.ts",

src/only-export-components.test.ts

+4
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ const valid = [
6565
name: "Two components & local function",
6666
code: "const foo = () => {}; export const Bar = () => {}; export const Baz = () => {};",
6767
},
68+
{
69+
name: "styled components",
70+
code: "export const Foo = () => {}; export const Bar = styled.div`padding-bottom: 6px;`;",
71+
},
6872
{
6973
name: "Direct export variable",
7074
code: "export const foo = 3;",

src/only-export-components.ts

-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ const notReactComponentExpression: ToString<TSESTree.Expression["type"]>[] = [
253253
"Literal",
254254
"LogicalExpression",
255255
"ObjectExpression",
256-
"TaggedTemplateExpression",
257256
"TemplateLiteral",
258257
"ThisExpression",
259258
"UnaryExpression",

0 commit comments

Comments
 (0)