diff --git a/CHANGELOG.md b/CHANGELOG.md index 18350f3..dbdbd5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.4.5 + +- Allow `TaggedTemplateExpression` for styled components (fixes #32) + ## 0.4.4 - Add `allowExportNames` option (fixes #29) diff --git a/package.json b/package.json index 78d680b..06627a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-refresh", - "version": "0.4.4", + "version": "0.4.5", "license": "MIT", "scripts": { "build": "scripts/bundle.ts", diff --git a/src/only-export-components.test.ts b/src/only-export-components.test.ts index 78c1f57..4db1212 100755 --- a/src/only-export-components.test.ts +++ b/src/only-export-components.test.ts @@ -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;", diff --git a/src/only-export-components.ts b/src/only-export-components.ts index c423b6d..c49ec96 100644 --- a/src/only-export-components.ts +++ b/src/only-export-components.ts @@ -253,7 +253,6 @@ const notReactComponentExpression: ToString[] = [ "Literal", "LogicalExpression", "ObjectExpression", - "TaggedTemplateExpression", "TemplateLiteral", "ThisExpression", "UnaryExpression",